summaryrefslogtreecommitdiffstats
path: root/xshared.h
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-02-07 04:00:50 +0100
committerJan Engelhardt <jengelh@medozas.de>2011-04-06 12:54:22 +0200
commitaa37acc1423126f555135935c687eb91995b9440 (patch)
tree39fdfa04a20875aeb2a47f0ef1bc2085d5796d0d /xshared.h
parent458d84de2412b43604a8efe2b82a2084a2859a46 (diff)
libxtables: guided option parser
This patchset seeks to drastically reduce the code in the individual extensions by centralizing their argument parsing (breakdown of strings), validation, and in part, assignment. As a secondary goal, this reduces the number of static storage duration variables in flight. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xshared.h')
-rw-r--r--xshared.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/xshared.h b/xshared.h
index 94abb392..be53535b 100644
--- a/xshared.h
+++ b/xshared.h
@@ -26,6 +26,24 @@ enum {
struct xtables_rule_match;
struct xtables_target;
+/**
+ * xtables_afinfo - protocol family dependent information
+ * @kmod: kernel module basename (e.g. "ip_tables")
+ * @libprefix: prefix of .so library name (e.g. "libipt_")
+ * @family: nfproto family
+ * @ipproto: used by setsockopt (e.g. IPPROTO_IP)
+ * @so_rev_match: optname to check revision support of match
+ * @so_rev_target: optname to check revision support of target
+ */
+struct xtables_afinfo {
+ const char *kmod;
+ const char *libprefix;
+ uint8_t family;
+ uint8_t ipproto;
+ int so_rev_match;
+ int so_rev_target;
+};
+
struct iptables_command_state {
union {
struct ipt_entry fw;
@@ -59,4 +77,6 @@ extern const char *proto_to_name(uint8_t, int);
extern struct xtables_match *load_proto(struct iptables_command_state *);
extern int subcmd_main(int, char **, const struct subcommand *);
+extern const struct xtables_afinfo *afinfo;
+
#endif /* IPTABLES_XSHARED_H */