}
-void
+bool
fw3_parse_options(void *s, const struct fw3_option *opts,
struct uci_section *section)
{
struct uci_option *o;
const struct fw3_option *opt;
struct list_head *dest;
+ bool valid = true;
uci_foreach_element(§ion->options, e)
{
if (!opt->elem_size)
{
warn_elem(e, "must not be a list");
+ valid = false;
}
else
{
if (!opt->parse(dest, l->name, true))
{
warn_elem(e, "has invalid value '%s'", l->name);
+ valid = false;
continue;
}
}
if (!opt->elem_size)
{
if (!opt->parse((char *)s + opt->offset, o->v.string, false))
+ {
warn_elem(e, "has invalid value '%s'", o->v.string);
+ valid = false;
+ }
}
else
{
if (!opt->parse(dest, p, true))
{
warn_elem(e, "has invalid value '%s'", p);
+ valid = false;
continue;
}
}
if (!known)
warn_elem(e, "is unknown");
}
+
+ return valid;
}
bool fw3_parse_mark(void *ptr, const char *val, bool is_list);
bool fw3_parse_setmatch(void *ptr, const char *val, bool is_list);
-void fw3_parse_options(void *s, const struct fw3_option *opts,
+bool fw3_parse_options(void *s, const struct fw3_option *opts,
struct uci_section *section);
const char * fw3_address_to_string(struct fw3_address *address,