Skip to content

Commit

Permalink
Add New 'compat_rev' Member to 'xtables_globals'
Browse files Browse the repository at this point in the history
Library verisons greater than 10 have an added member in the
xtables_global struct.
  • Loading branch information
mmellison committed May 12, 2016
1 parent fdae2ef commit 942a6b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion iptc/xtables.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ class xtables_globals(ct.Structure):
("program_version", ct.c_char_p),
("orig_opts", ct.c_void_p),
("opts", ct.c_void_p),
("exit_err", ct.CFUNCTYPE(None, ct.c_int, ct.c_char_p))]
("exit_err", ct.CFUNCTYPE(None, ct.c_int, ct.c_char_p)),
("compat_rev", ct.CFUNCTYPE(ct.c_int, ct.c_char_p, ct.c_uint8,
ct.c_int))]


# struct used by getopt()
Expand Down Expand Up @@ -759,6 +761,11 @@ def new(*args):
_xt_globals.opts = None
_xt_globals.exit_err = _xt_exit

if xtables_version > 10:
_COMPAT_REV_FN = ct.CFUNCTYPE(ct.c_int, ct.c_char_p, ct.c_uint8, ct.c_int)
_xt_compat_rev = _COMPAT_REV_FN(_lib_xtables.xtables_compatible_revision)
_xt_globals.compat_rev = _xt_compat_rev


_loaded_exts = {}

Expand Down

0 comments on commit 942a6b9

Please sign in to comment.