X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=options.c;h=5c529b30f2b512d1de903836a13f670779bec420;hp=344d33d1fbd8d5a12ec04e8f091367a29addf24e;hb=ff9d5e13c9150c62fe698e4bc5541e6f92b241d0;hpb=0b61c395fc64cbc6d3550d80410a26aa49f1681c diff --git a/options.c b/options.c index 344d33d..5c529b3 100644 --- a/options.c +++ b/options.c @@ -40,7 +40,7 @@ parse_enum(void *ptr, const char *val, const char **values, int min, int max) } -const char *fw3_flag_names[FW3_DEFAULT_DROP_INVALID + 1] = { +const char *fw3_flag_names[__FW3_FLAG_MAX] = { "filter", "nat", "mangle", @@ -97,6 +97,11 @@ static const char *include_types[] = { "restore", }; +static const char *reflection_sources[] = { + "internal", + "external", +}; + bool fw3_parse_bool(void *ptr, const char *val) @@ -132,8 +137,8 @@ fw3_parse_string(void *ptr, const char *val) bool fw3_parse_target(void *ptr, const char *val) { - return parse_enum(ptr, val, &fw3_flag_names[FW3_TARGET_ACCEPT], - FW3_TARGET_ACCEPT, FW3_TARGET_SNAT); + return parse_enum(ptr, val, &fw3_flag_names[FW3_FLAG_ACCEPT], + FW3_FLAG_ACCEPT, FW3_FLAG_SNAT); } bool @@ -664,6 +669,13 @@ fw3_parse_include_type(void *ptr, const char *val) FW3_INC_TYPE_SCRIPT, FW3_INC_TYPE_RESTORE); } +bool +fw3_parse_reflection_source(void *ptr, const char *val) +{ + return parse_enum(ptr, val, reflection_sources, + FW3_REFLECTION_INTERNAL, FW3_REFLECTION_EXTERNAL); +} + void fw3_parse_options(void *s, const struct fw3_option *opts,