Commit f5c1bf13 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement manual channel configuration.

parent 6f40d443
......@@ -445,6 +445,28 @@ parse_nconf(gnc_t gnc, void *closure)
if(c < -1)
goto error;
nconf->split_horizon = v;
} else if(strcmp(token, "channel") == 0) {
char *t, *end;
c = getword(c, &t, gnc, closure);
if(c < -1)
goto error;
if(strcmp(t, "noninterfering") == 0)
nconf->channel = NET_CHANNEL_NONINTERFERING;
else if(strcmp(t, "interfering") == 0)
nconf->channel = NET_CHANNEL_INTERFERING;
else {
nconf->channel = strtol(t, &end, 0);
if(*end != '\0')
goto error;
}
free(t);
if((nconf->channel < 1 || nconf->channel > 254) &&
nconf->channel != NET_CHANNEL_NONINTERFERING)
goto error;
} else {
goto error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment