projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make nat reflection src address configurable by introducing a reflection_src paramete...
[project/firewall3.git]
/
options.c
diff --git
a/options.c
b/options.c
index
6c5e2cf
..
5c529b3
100644
(file)
--- 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",
"filter",
"nat",
"mangle",
@@
-55,6
+55,10
@@
const char *fw3_flag_names[FW3_DEFAULT_DROP_INVALID + 1] = {
"NOTRACK",
"DNAT",
"SNAT",
"NOTRACK",
"DNAT",
"SNAT",
+
+ "ACCEPT",
+ "REJECT",
+ "DROP",
};
static const char *limit_units[] = {
};
static const char *limit_units[] = {
@@
-93,6
+97,11
@@
static const char *include_types[] = {
"restore",
};
"restore",
};
+static const char *reflection_sources[] = {
+ "internal",
+ "external",
+};
+
bool
fw3_parse_bool(void *ptr, const char *val)
bool
fw3_parse_bool(void *ptr, const char *val)
@@
-128,8
+137,8
@@
fw3_parse_string(void *ptr, const char *val)
bool
fw3_parse_target(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
}
bool
@@
-660,6
+669,13
@@
fw3_parse_include_type(void *ptr, const char *val)
FW3_INC_TYPE_SCRIPT, FW3_INC_TYPE_RESTORE);
}
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,
void
fw3_parse_options(void *s, const struct fw3_option *opts,