From 2325c0fedf7507f94aa3bb11cc65a70d33836f8f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 27 Aug 2011 11:12:49 +0200 Subject: libiptc: combine common types Make an xt_chainlabel type out of ipt_chainlabel and ip6t_chainlabel, and add backward-API #defines. The ABI naturally does not change either, so no soversion bump. Signed-off-by: Jan Engelhardt --- include/libiptc/xtcshared.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 include/libiptc/xtcshared.h (limited to 'include/libiptc/xtcshared.h') diff --git a/include/libiptc/xtcshared.h b/include/libiptc/xtcshared.h new file mode 100644 index 00000000..aaf87a4b --- /dev/null +++ b/include/libiptc/xtcshared.h @@ -0,0 +1,6 @@ +#ifndef _LIBXTC_SHARED_H +#define _LIBXTC_SHARED_H 1 + +typedef char xt_chainlabel[32]; + +#endif /* _LIBXTC_SHARED_H */ -- cgit v1.2.3 From 1639fe86579f86f5f6a954a9b0adde2e16ad1980 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 27 Aug 2011 11:39:52 +0200 Subject: libiptc: combine common types: _handle No real API/ABI change incurred, since the definition of the structs' types is not visible anyhow. Signed-off-by: Jan Engelhardt --- include/libiptc/xtcshared.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libiptc/xtcshared.h') diff --git a/include/libiptc/xtcshared.h b/include/libiptc/xtcshared.h index aaf87a4b..89a51511 100644 --- a/include/libiptc/xtcshared.h +++ b/include/libiptc/xtcshared.h @@ -2,5 +2,6 @@ #define _LIBXTC_SHARED_H 1 typedef char xt_chainlabel[32]; +struct xtc_handle; #endif /* _LIBXTC_SHARED_H */ -- cgit v1.2.3 From de4d2d3b716d83a6d3831aaf902c5adb5d1d14c9 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 27 Aug 2011 12:50:32 +0200 Subject: libiptc: use a family-invariant xtc_ops struct for code reduction Signed-off-by: Jan Engelhardt --- include/libiptc/xtcshared.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/libiptc/xtcshared.h') 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 */ -- cgit v1.2.3