X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=options.h;h=f62f0deec4e6c3674c281ef2699d89e10c228b26;hp=ced138ad2c0ab1ebf6d13b90edebff4506326b98;hb=c9092f26645a28a4315846d91e8c8b1ae25bec57;hpb=1ccbcc2642e5cfeed375cf56130ab6ecaad35052 diff --git a/options.h b/options.h index ced138a..f62f0de 100644 --- a/options.h +++ b/options.h @@ -55,32 +55,33 @@ enum fw3_table enum fw3_family { FW3_FAMILY_ANY = 0, - FW3_FAMILY_V4 = 1, - FW3_FAMILY_V6 = 2, + FW3_FAMILY_V4 = 4, + FW3_FAMILY_V6 = 5, }; enum fw3_target { FW3_TARGET_UNSPEC = 0, - FW3_TARGET_ACCEPT = 1, - FW3_TARGET_REJECT = 2, - FW3_TARGET_DROP = 3, - FW3_TARGET_NOTRACK = 4, - FW3_TARGET_DNAT = 5, - FW3_TARGET_SNAT = 6, + FW3_TARGET_ACCEPT = 6, + FW3_TARGET_REJECT = 7, + FW3_TARGET_DROP = 8, + FW3_TARGET_NOTRACK = 9, + FW3_TARGET_DNAT = 10, + FW3_TARGET_SNAT = 11, }; enum fw3_default { FW3_DEFAULT_UNSPEC = 0, - FW3_DEFAULT_CUSTOM_CHAINS = 1, - FW3_DEFAULT_SYN_FLOOD = 2, - FW3_DEFAULT_MTU_FIX = 3, - FW3_DEFAULT_DROP_INVALID = 4, - FW3_DEFAULT_IPV4_LOADED = 5, - FW3_DEFAULT_IPV6_LOADED = 6, + FW3_DEFAULT_CUSTOM_CHAINS = 12, + FW3_DEFAULT_SYN_FLOOD = 13, + FW3_DEFAULT_MTU_FIX = 14, + FW3_DEFAULT_DROP_INVALID = 15, }; +extern const char *fw3_flag_names[FW3_DEFAULT_DROP_INVALID + 1]; + + enum fw3_limit_unit { FW3_LIMIT_UNIT_SECOND = 0, @@ -129,6 +130,7 @@ struct fw3_address struct list_head list; bool set; + bool range; bool invert; enum fw3_family family; int mask; @@ -137,6 +139,11 @@ struct fw3_address struct in6_addr v6; struct ether_addr mac; } address; + union { + struct in_addr v4; + struct in6_addr v6; + struct ether_addr mac; + } address2; }; struct fw3_mac @@ -212,12 +219,13 @@ struct fw3_defaults bool disable_ipv6; - uint8_t flags; + uint16_t flags; }; struct fw3_zone { struct list_head list; + struct list_head running_list; const char *name; @@ -246,8 +254,8 @@ struct fw3_zone bool custom_chains; - uint8_t src_flags; - uint8_t dst_flags; + uint16_t src_flags; + uint16_t dst_flags; }; struct fw3_rule @@ -339,6 +347,7 @@ struct fw3_forward struct fw3_ipset { struct list_head list; + struct list_head running_list; const char *name; enum fw3_family family; @@ -356,6 +365,8 @@ struct fw3_ipset int timeout; const char *external; + + uint16_t flags; }; struct fw3_state @@ -368,7 +379,12 @@ struct fw3_state struct list_head forwards; struct list_head ipsets; + struct fw3_defaults running_defaults; + struct list_head running_zones; + struct list_head running_ipsets; + bool disable_ipsets; + bool statefile; }; @@ -403,7 +419,7 @@ bool fw3_parse_protocol(void *ptr, const char *val); bool fw3_parse_ipset_method(void *ptr, const char *val); bool fw3_parse_ipset_datatype(void *ptr, const char *val); -void fw3_parse_options(void *s, struct fw3_option *opts, int n, +void fw3_parse_options(void *s, const struct fw3_option *opts, struct uci_section *section); void fw3_format_in_out(struct fw3_device *in, struct fw3_device *out);