/*
* firewall3 - 3rd OpenWrt UCI firewall implementation
*
- * Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
+ * Copyright (C) 2013-2014 Jo-Philipp Wich <jow@openwrt.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
"MARK",
"DNAT",
"SNAT",
+ "MASQUERADE",
"ACCEPT",
"REJECT",
fw3_parse_target(void *ptr, const char *val, bool is_list)
{
return parse_enum(ptr, val, &fw3_flag_names[FW3_FLAG_ACCEPT],
- FW3_FLAG_ACCEPT, FW3_FLAG_SNAT);
+ FW3_FLAG_ACCEPT, FW3_FLAG_MASQUERADE);
}
bool
return true;
}
+bool
+fw3_parse_direction(void *ptr, const char *val, bool is_list)
+{
+ bool *is_out = ptr;
+ bool valid = true;
+
+ if (!strcmp(val, "in") || !strcmp(val, "ingress"))
+ *is_out = false;
+ else if (!strcmp(val, "out") || !strcmp(val, "egress"))
+ *is_out = true;
+ else
+ valid = false;
+
+ return valid;
+}
+
bool
fw3_parse_options(void *s, const struct fw3_option *opts,