}
-const char *fw3_flag_names[FW3_DEFAULT_DROP_INVALID + 1] = {
+const char *fw3_flag_names[__FW3_FLAG_MAX] = {
"filter",
"nat",
"mangle",
"NOTRACK",
"DNAT",
"SNAT",
+
+ "ACCEPT",
+ "REJECT",
+ "DROP",
};
static const char *limit_units[] = {
"restore",
};
+static const char *reflection_sources[] = {
+ "internal",
+ "external",
+};
+
bool
fw3_parse_bool(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
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,