Commit 544a453a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove "option" keyword -- options need no introduction.

parent 099f28c2
......@@ -141,19 +141,11 @@ Specify a file to write our process id to. The default is
The list of interfaces on which the protocol should operate.
.SH CONFIGURATION FILE FORMAT
The configuration file is a sequence of lines each of which specifies
either an interface or a filtering rule. Blank lines are ignored. Comments
are introduced with an octothorp
a global option, an interface specification or a filtering
rule. Comments are introduced by an octothorp
.RB `` # ''
and terminate at the end of the line.
.SS Global options
Global options are set by a line with the following format:
.IP
.B option
.IR value ...
.PP
where each
.I value
can be one of the following:
.TP
.BI protocol-group " group"
This specifies the link-local multicast address to be used by the
......@@ -264,8 +256,8 @@ where
.I name
is the name of the interface (something like
.BR eth0 ).
The default values for all interfaces can be changed by
a line of the form
The default value of an interface parameter can be specified changed
by a line of the form
.IP
.B default
.RI [ parameter ...]
......@@ -273,7 +265,7 @@ a line of the form
Each
.I parameter
specifies a parameter of the given interface. It can be one of:
can be one of:
.TP
.BR wired " {" true | false | auto }
This specifies whether to enable optimisations specific to wired interfaces.
......
......@@ -567,20 +567,8 @@ add_ifconf(struct interface_conf *if_conf, struct interface_conf **if_confs)
}
static int
parse_option(int c, gnc_t gnc, void *closure)
parse_option(int c, gnc_t gnc, void *closure, char *token)
{
char *token;
while(1) {
c = skip_whitespace(c, gnc, closure);
if(c < 0 || c == '\n' || c == '#') {
c = skip_to_eol(c, gnc, closure);
break;
}
c = getword(c, &token, gnc, closure);
if(c < -1)
goto error;
if(strcmp(token, "protocol-port") == 0 ||
strcmp(token, "kernel-priority") == 0 ||
strcmp(token, "allow-duplicates") == 0 ||
......@@ -682,12 +670,17 @@ parse_option(int c, gnc_t gnc, void *closure)
} else {
goto error;
}
free(token);
}
c = skip_whitespace(c, gnc, closure);
if(c < 0 || c == '\n' || c == '#') {
c = skip_to_eol(c, gnc, closure);
return 1;
}
/* Fall through */
error:
return -1;
}
static int
......@@ -748,13 +741,11 @@ parse_config(gnc_t gnc, void *closure)
if_conf, default_interface_conf);
free(if_conf);
}
} else if(strcmp(token, "option") == 0) {
} else {
int rc;
rc = parse_option(c, gnc, closure);
rc = parse_option(c, gnc, closure, token);
if(rc < 0)
return -1;
} else {
return -1;
}
free(token);
}
......
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