1 Description: Sync header from iptables
2 The current versions in several suites have the same content:
3 - 1.6.0+snapshot20161117-6 (stretch)
5 Bug: https://bugs.debian.og/868059
7 Author: Cyril Brulebois <cyril@debamax.com>
8 Last-Update: 2017-11-22
9 --- a/include/xtables.h
10 +++ b/include/xtables.h
11 @@ -205,9 +205,24 @@ enum xtables_ext_flags {
12 XTABLES_EXT_ALIAS = 1 << 0,
17 +struct xt_xlate_mt_params {
19 + const struct xt_entry_match *match;
24 +struct xt_xlate_tg_params {
26 + const struct xt_entry_target *target;
31 /* Include file for additions: new matches and targets. */
34 +struct xtables_match {
36 * ABI/API version this module requires. Must be first member,
37 * as the rest of this struct may be subject to ABI changes.
38 @@ -269,6 +284,10 @@ struct xtables_match
39 void (*x6_fcheck)(struct xt_fcheck_call *);
40 const struct xt_option_entry *x6_options;
42 + /* Translate iptables to nft */
43 + int (*xlate)(struct xt_xlate *xl,
44 + const struct xt_xlate_mt_params *params);
46 /* Size of per-extension instance extra "global" scratch space */
49 @@ -280,8 +299,7 @@ struct xtables_match
50 unsigned int loaded; /* simulate loading so options are merged properly */
53 -struct xtables_target
55 +struct xtables_target {
57 * ABI/API version this module requires. Must be first member,
58 * as the rest of this struct may be subject to ABI changes.
59 @@ -346,6 +364,10 @@ struct xtables_target
60 void (*x6_fcheck)(struct xt_fcheck_call *);
61 const struct xt_option_entry *x6_options;
63 + /* Translate iptables to nft */
64 + int (*xlate)(struct xt_xlate *xl,
65 + const struct xt_xlate_tg_params *params);
69 /* Ignore these men behind the curtain: */
70 @@ -406,6 +428,17 @@ struct xtables_globals
72 #define XT_GETOPT_TABLEEND {.name = NULL, .has_arg = false}
77 + * For writing clean nftables translations code
88 @@ -548,6 +581,14 @@ extern void xtables_lmap_free(struct xta
89 extern int xtables_lmap_name2id(const struct xtables_lmap *, const char *);
90 extern const char *xtables_lmap_id2name(const struct xtables_lmap *, int);
92 +/* xlate infrastructure */
93 +struct xt_xlate *xt_xlate_alloc(int size);
94 +void xt_xlate_free(struct xt_xlate *xl);
95 +void xt_xlate_add(struct xt_xlate *xl, const char *fmt, ...);
96 +void xt_xlate_add_comment(struct xt_xlate *xl, const char *comment);
97 +const char *xt_xlate_get_comment(struct xt_xlate *xl);
98 +const char *xt_xlate_get(struct xt_xlate *xl);
100 #ifdef XTABLES_INTERNAL
102 /* Shipped modules rely on this... */