diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-08-27 12:50:32 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-09-11 17:31:35 +0200 |
commit | de4d2d3b716d83a6d3831aaf902c5adb5d1d14c9 (patch) | |
tree | 3d9a38fd4c2b36d3613099f9b77a47c4a3c64cc9 /include | |
parent | 14da56743c6cdf25da35b7b5ca7a5d201771990d (diff) |
libiptc: use a family-invariant xtc_ops struct for code reduction
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/libiptc/libip6tc.h | 2 | ||||
-rw-r--r-- | include/libiptc/libiptc.h | 2 | ||||
-rw-r--r-- | include/libiptc/xtcshared.h | 13 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/libiptc/libip6tc.h b/include/libiptc/libip6tc.h index 61c1e7f5..c656bc43 100644 --- a/include/libiptc/libip6tc.h +++ b/include/libiptc/libip6tc.h @@ -159,4 +159,6 @@ int ipv6_prefix_length(const struct in6_addr *a); extern void dump_entries6(struct xtc_handle *const); +extern const struct xtc_ops ip6tc_ops; + #endif /* _LIBIP6TC_H */ diff --git a/include/libiptc/libiptc.h b/include/libiptc/libiptc.h index 6f64f5a9..24cdbdb7 100644 --- a/include/libiptc/libiptc.h +++ b/include/libiptc/libiptc.h @@ -162,6 +162,8 @@ const char *iptc_strerror(int err); extern void dump_entries(struct xtc_handle *const); +extern const struct xtc_ops iptc_ops; + #ifdef __cplusplus } #endif diff --git a/include/libiptc/xtcshared.h b/include/libiptc/xtcshared.h index 89a51511..773ebc4c 100644 --- a/include/libiptc/xtcshared.h +++ b/include/libiptc/xtcshared.h @@ -3,5 +3,18 @@ typedef char xt_chainlabel[32]; struct xtc_handle; +struct xt_counters; + +struct xtc_ops { + int (*commit)(struct xtc_handle *); + void (*free)(struct xtc_handle *); + int (*builtin)(const char *, struct xtc_handle *const); + int (*is_chain)(const char *, struct xtc_handle *const); + int (*flush_entries)(const xt_chainlabel, struct xtc_handle *); + int (*create_chain)(const xt_chainlabel, struct xtc_handle *); + int (*set_policy)(const xt_chainlabel, const xt_chainlabel, + struct xt_counters *, struct xtc_handle *); + const char *(*strerror)(int); +}; #endif /* _LIBXTC_SHARED_H */ |