Skip to content

Commit 9a94057

Browse files
committed
xtables v12 match structure also has member xt_xlate
1 parent b9744c3 commit 9a94057

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

iptc/xtables.py

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,59 @@ class _xtables_match_v10(ct.Structure):
411411

412412

413413
_xtables_match_v11 = _xtables_match_v10
414-
_xtables_match_v12 = _xtables_match_v10
414+
415+
416+
class _xtables_match_v12(ct.Structure):
417+
_fields_ = [("version", ct.c_char_p),
418+
("next", ct.c_void_p),
419+
("name", ct.c_char_p),
420+
("real_name", ct.c_char_p),
421+
("revision", ct.c_uint8),
422+
("ext_flags", ct.c_uint8),
423+
("family", ct.c_uint16),
424+
("size", ct.c_size_t),
425+
("userspacesize", ct.c_size_t),
426+
("help", ct.CFUNCTYPE(None)),
427+
("init", ct.CFUNCTYPE(None, ct.POINTER(xt_entry_match))),
428+
# fourth parameter entry is struct ipt_entry for example
429+
# int (*parse)(int c, char **argv, int invert, unsigned int
430+
# *flags, const void *entry, struct xt_entry_match **match)
431+
("parse", ct.CFUNCTYPE(ct.c_int, ct.c_int,
432+
ct.POINTER(ct.c_char_p), ct.c_int,
433+
ct.POINTER(ct.c_uint), ct.c_void_p,
434+
ct.POINTER(ct.POINTER(
435+
xt_entry_match)))),
436+
("final_check", ct.CFUNCTYPE(None, ct.c_uint)),
437+
# prints out the match iff non-NULL: put space at end
438+
# first parameter ip is struct ipt_ip * for example
439+
("print", ct.CFUNCTYPE(None, ct.c_void_p,
440+
ct.POINTER(xt_entry_match), ct.c_int)),
441+
# saves the match info in parsable form to stdout.
442+
# first parameter ip is struct ipt_ip * for example
443+
("save", ct.CFUNCTYPE(None, ct.c_void_p,
444+
ct.POINTER(xt_entry_match))),
445+
# Print match name or alias
446+
("alias", ct.CFUNCTYPE(ct.c_char_p,
447+
ct.POINTER(xt_entry_match))),
448+
# pointer to list of extra command-line options
449+
("extra_opts", ct.POINTER(option)),
450+
451+
# introduced with the new iptables API
452+
("x6_parse", ct.CFUNCTYPE(None, ct.POINTER(xt_option_call))),
453+
("x6_fcheck", ct.CFUNCTYPE(None, ct.POINTER(xt_fcheck_call))),
454+
("x6_options", ct.POINTER(xt_option_entry)),
455+
456+
('xt_xlate', ct.c_int),
457+
458+
# size of per-extension instance extra "global" scratch space
459+
("udata_size", ct.c_size_t),
460+
461+
# ignore these men behind the curtain:
462+
("udata", ct.c_void_p),
463+
("option_offset", ct.c_uint),
464+
("m", ct.POINTER(xt_entry_match)),
465+
("mflags", ct.c_uint),
466+
("loaded", ct.c_uint)]
415467

416468

417469
class xtables_match(ct.Union):

0 commit comments

Comments
 (0)