X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=xtables-10.h;h=7ea5315a45a5551f150e60d63e9bc6b92caf6830;hp=2372b8c402178ed78c3d680e8c9f0d81d9c3e25c;hb=HEAD;hpb=7b63363c22a62e14d05f41c418b98fe4b45db9c3 diff --git a/xtables-10.h b/xtables-10.h index 2372b8c..7ea5315 100644 --- a/xtables-10.h +++ b/xtables-10.h @@ -1,7 +1,7 @@ /* * firewall3 - 3rd OpenWrt UCI firewall implementation * - * Copyright (C) 2013 Jo-Philipp Wich + * Copyright (C) 2013 Jo-Philipp Wich * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -125,4 +125,32 @@ fw3_xt_merge_target_options(struct xtables_globals *g, struct xtables_target *t) t->extra_opts, &t->option_offset); } +static inline void +fw3_xt_print_matches(void *ip, struct xtables_rule_match *matches) +{ + struct xtables_rule_match *rm; + struct xtables_match *m; + + for (rm = matches; rm; rm = rm->next) + { + m = rm->match; + printf(" -m %s", fw3_xt_get_match_name(m)); + + if (m->save) + m->save(ip, m->m); + } +} + +static inline void +fw3_xt_print_target(void *ip, struct xtables_target *target) +{ + if (target) + { + printf(" -j %s", fw3_xt_get_target_name(target)); + + if (target->save) + target->save(ip, target->t); + } +} + #endif