X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=iptables.h;h=96d71bf850f3c485fd80576fa208c4f1e68b05a7;hb=76976c044de639bb4bf170aa1c7a33fbeca1f1a5;hp=c8d1add9ce452920044b8e395c6d30bdc9ea0bfc;hpb=3a3d85b3c787271e4860ca590d716cf557c1fb7e;p=project%2Ffirewall3.git diff --git a/iptables.h b/iptables.h index c8d1add..96d71bf 100644 --- a/iptables.h +++ b/iptables.h @@ -117,8 +117,9 @@ struct fw3_ipt_handle *fw3_ipt_open(enum fw3_family family, void fw3_ipt_set_policy(struct fw3_ipt_handle *h, const char *chain, enum fw3_flag policy); + +void fw3_ipt_flush_chain(struct fw3_ipt_handle *h, const char *chain); void fw3_ipt_delete_chain(struct fw3_ipt_handle *h, const char *chain); -void fw3_ipt_delete_rules(struct fw3_ipt_handle *h, const char *target); void fw3_ipt_create_chain(struct fw3_ipt_handle *h, const char *fmt, ...); @@ -167,7 +168,14 @@ struct fw3_ipt_rule * fw3_ipt_rule_create(struct fw3_ipt_handle *handle, struct fw3_address *src, struct fw3_address *dest); -void fw3_ipt_rule_append(struct fw3_ipt_rule *r, const char *fmt, ...); +void __fw3_ipt_rule_append(struct fw3_ipt_rule *r, bool repl, + const char *fmt, ...); + +#define fw3_ipt_rule_append(rule, ...) \ + __fw3_ipt_rule_append(rule, false, __VA_ARGS__) + +#define fw3_ipt_rule_replace(rule, ...) \ + __fw3_ipt_rule_append(rule, true, __VA_ARGS__) static inline void fw3_ipt_rule_target(struct fw3_ipt_rule *r, const char *fmt, ...)