]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libiptc: Extend struct xtc_ops
authorPhil Sutter <phil@nwl.cc>
Wed, 19 Sep 2018 14:25:56 +0000 (16:25 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 13 Nov 2018 11:12:47 +0000 (12:12 +0100)
Add a few more callbacks used by iptables-save.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
include/libiptc/xtcshared.h
libiptc/Makefile.am
libiptc/libiptc.c

index 773ebc4c77e2c8152d19c9d4dac08f2737868909..341f9d4fac5d0fc4637945a0802e186254ba42be 100644 (file)
@@ -7,11 +7,16 @@ struct xt_counters;
 
 struct xtc_ops {
        int (*commit)(struct xtc_handle *);
+       struct xtc_handle *(*init)(const char *);
        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 *);
+       const char *(*first_chain)(struct xtc_handle *);
+       const char *(*next_chain)(struct xtc_handle *);
+       const char *(*get_policy)(const char *, struct xt_counters *,
+                                 struct xtc_handle *);
        int (*set_policy)(const xt_chainlabel, const xt_chainlabel,
                          struct xt_counters *, struct xtc_handle *);
        const char *(*strerror)(int);
index f789d34e00c946bb4c207d86f597524d19815678..638295dbb737087f09e6eff2b2a23599ebc3761e 100644 (file)
@@ -10,6 +10,6 @@ libiptc_la_SOURCES  =
 libiptc_la_LIBADD   = libip4tc.la libip6tc.la
 libiptc_la_LDFLAGS  = -version-info 0:0:0 ${libiptc_LDFLAGS2}
 libip4tc_la_SOURCES = libip4tc.c
-libip4tc_la_LDFLAGS = -version-info 1:0:1
+libip4tc_la_LDFLAGS = -version-info 2:0:0
 libip6tc_la_SOURCES = libip6tc.c
-libip6tc_la_LDFLAGS = -version-info 1:0:1 ${libiptc_LDFLAGS2}
+libip6tc_la_LDFLAGS = -version-info 2:0:0 ${libiptc_LDFLAGS2}
index 9ecec581e119ed9e18c0264472bb1d961983b6a5..f4fb09fb509e54f71af35c1c30b3c1563766fc4d 100644 (file)
@@ -2751,11 +2751,15 @@ TC_STRERROR(int err)
 
 const struct xtc_ops TC_OPS = {
        .commit        = TC_COMMIT,
+       .init          = TC_INIT,
        .free          = TC_FREE,
        .builtin       = TC_BUILTIN,
        .is_chain      = TC_IS_CHAIN,
        .flush_entries = TC_FLUSH_ENTRIES,
        .create_chain  = TC_CREATE_CHAIN,
+       .first_chain   = TC_FIRST_CHAIN,
+       .next_chain    = TC_NEXT_CHAIN,
+       .get_policy    = TC_GET_POLICY,
        .set_policy    = TC_SET_POLICY,
        .strerror      = TC_STRERROR,
 };