/*
* firewall3 - 3rd OpenWrt UCI firewall implementation
*
- * Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
+ * Copyright (C) 2013 Jo-Philipp Wich <jo@mein.io>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#ifndef __FW3_XTABLES_5_H
#define __FW3_XTABLES_5_H
+static inline void
+fw3_xt_reset(void)
+{
+ xtables_matches = NULL;
+ xtables_targets = NULL;
+}
+
+
static inline const char *
fw3_xt_get_match_name(struct xtables_match *m)
{
g->opts = xtables_merge_options(g->opts, 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;
+
+ printf(" ");
+
+ 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);
+ }
+}
+
/* xtables api addons */