X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=options.h;h=96afcd2dda4730051d0ec272e9d6c4b420621683;hp=2209cbe4363f1de2e729e0ea42efde9b0155425c;hb=8eb517c56988da4c5a4c755672ae8f99e97bb4b2;hpb=6a736bbffb88c44aa5b4780e5a94519a0b4e5523 diff --git a/options.h b/options.h index 2209cbe..96afcd2 100644 --- a/options.h +++ b/options.h @@ -35,6 +35,8 @@ #include #include +#include + #include #include @@ -108,6 +110,12 @@ enum fw3_ipset_type FW3_IPSET_TYPE_SET = 5, }; +enum fw3_include_type +{ + FW3_INC_TYPE_SCRIPT = 0, + FW3_INC_TYPE_RESTORE = 1, +}; + struct fw3_ipset_datatype { struct list_head list; @@ -196,6 +204,17 @@ struct fw3_limit enum fw3_limit_unit unit; }; +struct fw3_time +{ + bool utc; + struct tm datestart; + struct tm datestop; + uint32_t timestart; + uint32_t timestop; + uint32_t monthdays; /* bit 0 is invert + 1 .. 31 */ + uint8_t weekdays; /* bit 0 is invert + 1 .. 7 */ +}; + struct fw3_defaults { enum fw3_target policy_input; @@ -209,7 +228,6 @@ struct fw3_defaults bool tcp_syncookies; bool tcp_ecn; - bool tcp_westwood; bool tcp_window_scaling; bool accept_redirects; @@ -286,9 +304,10 @@ struct fw3_rule struct list_head icmp_type; - enum fw3_target target; - struct fw3_limit limit; + struct fw3_time time; + + enum fw3_target target; const char *extra; }; @@ -322,6 +341,8 @@ struct fw3_redirect struct fw3_address ip_redir; struct fw3_port port_redir; + struct fw3_time time; + enum fw3_target target; const char *extra; @@ -369,6 +390,18 @@ struct fw3_ipset uint16_t flags; }; +struct fw3_include +{ + struct list_head list; + struct list_head running_list; + + const char *name; + enum fw3_family family; + + const char *path; + enum fw3_include_type type; +}; + struct fw3_state { struct uci_context *uci; @@ -378,6 +411,7 @@ struct fw3_state struct list_head redirects; struct list_head forwards; struct list_head ipsets; + struct list_head includes; struct fw3_defaults running_defaults; struct list_head running_zones; @@ -416,9 +450,17 @@ bool fw3_parse_port(void *ptr, const char *val); bool fw3_parse_family(void *ptr, const char *val); bool fw3_parse_icmptype(void *ptr, const char *val); 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); +bool fw3_parse_include_type(void *ptr, const char *val); + +bool fw3_parse_date(void *ptr, const char *val); +bool fw3_parse_time(void *ptr, const char *val); +bool fw3_parse_weekdays(void *ptr, const char *val); +bool fw3_parse_monthdays(void *ptr, const char *val); + void fw3_parse_options(void *s, const struct fw3_option *opts, struct uci_section *section); @@ -430,6 +472,7 @@ void fw3_format_protocol(struct fw3_protocol *proto, enum fw3_family family); void fw3_format_icmptype(struct fw3_icmptype *icmp, enum fw3_family family); void fw3_format_limit(struct fw3_limit *limit); void fw3_format_ipset(struct fw3_ipset *ipset, bool invert); +void fw3_format_time(struct fw3_time *time); void __fw3_format_comment(const char *comment, ...); #define fw3_format_comment(...) __fw3_format_comment(__VA_ARGS__, NULL)