Debian Codegraph @

src/expr/nat.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */cxx . . $ `<file>/src/expr/nat.c`/
2 /*
3 * (C) 2012-2014 Pablo Neira Ayuso <[email protected]>
4 * (C) 2012 Intel Corporation
5 *
6 * Authors:
7 * Tomasz Bursztyka <[email protected]>
8 */
9
10 #include "internal.h"cxx . . $ `<file>/include/internal.h`/
11
12 #include <stdio.h>
13 #include <stdint.h>
14 #include <limits.h>
15 #include <string.h>
16 #include <errno.h>
17 #include <arpa/inet.h>
18 #include <libmnl/libmnl.h>
19 #include <linux/netfilter/nf_tables.h>cxx . . $ `<file>/include/linux/netfilter/nf_tables.h`/
20 #include <libnftnl/expr.h>cxx . . $ `<file>/include/libnftnl/expr.h`/
21 #include <libnftnl/rule.h>cxx . . $ `<file>/include/libnftnl/rule.h`/
22
23 struct nftnl_expr_natcxx . . $ nftnl_expr_nat# {
24 enum nft_registerscxx . . $ nft_registers# sreg_addr_mincxx . . $ nftnl_expr_nat#sreg_addr_min.;
25 enum nft_registerscxx . . $ nft_registers# sreg_addr_maxcxx . . $ nftnl_expr_nat#sreg_addr_max.;
26 enum nft_registerscxx . . $ nft_registers# sreg_proto_mincxx . . $ nftnl_expr_nat#sreg_proto_min.;
27 enum nft_registerscxx . . $ nft_registers# sreg_proto_maxcxx . . $ nftnl_expr_nat#sreg_proto_max.;
28 int familycxx . . $ nftnl_expr_nat#family.;
29 enum nft_nat_typescxx . . $ nft_nat_types# typecxx . . $ nftnl_expr_nat#type.;
30 uint32_tcxx . . $ uint32_t# flagscxx . . $ nftnl_expr_nat#flags.;
31 };
32
33 static int
34 nftnl_expr_nat_setcxx . . $ nftnl_expr_nat_set(211371a3e3842127).(struct nftnl_exprcxx . . $ nftnl_expr# *e, uint16_tcxx . . $ uint16_t# type,
35 const void *data, uint32_tcxx . . $ uint32_t# data_len, uint32_tcxx . . $ uint32_t# byteorder)
36 {
37 struct nftnl_expr_natcxx . . $ nftnl_expr_nat# *nat = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e);
38
39 switch(type) {
40 case NFTNL_EXPR_NAT_TYPEcxx . . $ NFTNL_EXPR_NAT_TYPE.:
41 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->typecxx . . $ nftnl_expr_nat#type., data, data_len);
42 break;
43 case NFTNL_EXPR_NAT_FAMILYcxx . . $ NFTNL_EXPR_NAT_FAMILY.:
44 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->familycxx . . $ nftnl_expr_nat#family., data, data_len);
45 break;
46 case NFTNL_EXPR_NAT_REG_ADDR_MINcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MIN.:
47 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->sreg_addr_mincxx . . $ nftnl_expr_nat#sreg_addr_min., data, data_len);
48 break;
49 case NFTNL_EXPR_NAT_REG_ADDR_MAXcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MAX.:
50 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->sreg_addr_maxcxx . . $ nftnl_expr_nat#sreg_addr_max., data, data_len);
51 break;
52 case NFTNL_EXPR_NAT_REG_PROTO_MINcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MIN.:
53 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->sreg_proto_mincxx . . $ nftnl_expr_nat#sreg_proto_min., data, data_len);
54 break;
55 case NFTNL_EXPR_NAT_REG_PROTO_MAXcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MAX.:
56 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->sreg_proto_maxcxx . . $ nftnl_expr_nat#sreg_proto_max., data, data_len);
57 break;
58 case NFTNL_EXPR_NAT_FLAGScxx . . $ NFTNL_EXPR_NAT_FLAGS.:
59 memcpycxx . . $ memcpy(cc817cb175f282d).(&nat->flagscxx . . $ nftnl_expr_nat#flags., data, data_len);
60 break;
61 }
62
63 return 0;
64 }
65
66 static const void *
67 nftnl_expr_nat_getcxx . . $ nftnl_expr_nat_get(9de263c4f9e71c4b).(const struct nftnl_exprcxx . . $ nftnl_expr# *e, uint16_tcxx . . $ uint16_t# type,
68 uint32_tcxx . . $ uint32_t# *data_len)
69 {
70 struct nftnl_expr_natcxx . . $ nftnl_expr_nat# *nat = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e);
71
72 switch(type) {
73 case NFTNL_EXPR_NAT_TYPEcxx . . $ NFTNL_EXPR_NAT_TYPE.:
74 *data_len = sizeof(nat->typecxx . . $ nftnl_expr_nat#type.);
75 return &nat->typecxx . . $ nftnl_expr_nat#type.;
76 case NFTNL_EXPR_NAT_FAMILYcxx . . $ NFTNL_EXPR_NAT_FAMILY.:
77 *data_len = sizeof(nat->familycxx . . $ nftnl_expr_nat#family.);
78 return &nat->familycxx . . $ nftnl_expr_nat#family.;
79 case NFTNL_EXPR_NAT_REG_ADDR_MINcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MIN.:
80 *data_len = sizeof(nat->sreg_addr_mincxx . . $ nftnl_expr_nat#sreg_addr_min.);
81 return &nat->sreg_addr_mincxx . . $ nftnl_expr_nat#sreg_addr_min.;
82 case NFTNL_EXPR_NAT_REG_ADDR_MAXcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MAX.:
83 *data_len = sizeof(nat->sreg_addr_maxcxx . . $ nftnl_expr_nat#sreg_addr_max.);
84 return &nat->sreg_addr_maxcxx . . $ nftnl_expr_nat#sreg_addr_max.;
85 case NFTNL_EXPR_NAT_REG_PROTO_MINcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MIN.:
86 *data_len = sizeof(nat->sreg_proto_mincxx . . $ nftnl_expr_nat#sreg_proto_min.);
87 return &nat->sreg_proto_mincxx . . $ nftnl_expr_nat#sreg_proto_min.;
88 case NFTNL_EXPR_NAT_REG_PROTO_MAXcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MAX.:
89 *data_len = sizeof(nat->sreg_proto_maxcxx . . $ nftnl_expr_nat#sreg_proto_max.);
90 return &nat->sreg_proto_maxcxx . . $ nftnl_expr_nat#sreg_proto_max.;
91 case NFTNL_EXPR_NAT_FLAGScxx . . $ NFTNL_EXPR_NAT_FLAGS.:
92 *data_len = sizeof(nat->flagscxx . . $ nftnl_expr_nat#flags.);
93 return &nat->flagscxx . . $ nftnl_expr_nat#flags.;
94 }
95 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
96 }
97
98 static int nftnl_expr_nat_cbcxx . . $ nftnl_expr_nat_cb(de2ef18c48fd675c).(const struct nlattrcxx . . $ nlattr# *attr, void *data)
99 {
100 const struct nlattrcxx . . $ nlattr# **tb = data;
101 int type = mnl_attr_get_typecxx . . $ mnl_attr_get_type(1da47bcc4c4b975).(attr);
102
103 if (mnl_attr_type_validcxx . . $ mnl_attr_type_valid(47df1cce1c7be855).(attr, NFTA_NAT_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:1478:9`!) < 0)
104 return MNL_CB_OKcxx . . $ `<external>/12386019527593959648/libmnl.h:174:9`!;
105
106 switch(type) {
107 case NFTA_NAT_TYPEcxx . . $ NFTA_NAT_TYPE.:
108 case NFTA_NAT_FAMILYcxx . . $ NFTA_NAT_FAMILY.:
109 case NFTA_NAT_REG_ADDR_MINcxx . . $ NFTA_NAT_REG_ADDR_MIN.:
110 case NFTA_NAT_REG_ADDR_MAXcxx . . $ NFTA_NAT_REG_ADDR_MAX.:
111 case NFTA_NAT_REG_PROTO_MINcxx . . $ NFTA_NAT_REG_PROTO_MIN.:
112 case NFTA_NAT_REG_PROTO_MAXcxx . . $ NFTA_NAT_REG_PROTO_MAX.:
113 case NFTA_NAT_FLAGScxx . . $ NFTA_NAT_FLAGS.:
114 if (mnl_attr_validatecxx . . $ mnl_attr_validate(e419697a5e1ae2b1).(attr, MNL_TYPE_U32cxx . . $ MNL_TYPE_U32.) < 0)
115 abi_breakagecxx . . $ `include/utils.h:28:9`!();
116 break;
117 }
118
119 tb[type] = attr;
120 return MNL_CB_OKcxx . . $ `<external>/12386019527593959648/libmnl.h:174:9`!;
121 }
122
123 static int
124 nftnl_expr_nat_parsecxx . . $ nftnl_expr_nat_parse(ed61207049d8af9a).(struct nftnl_exprcxx . . $ nftnl_expr# *e, struct nlattrcxx . . $ nlattr# *attr)
125 {
126 struct nftnl_expr_natcxx . . $ nftnl_expr_nat# *nat = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e);
127 struct nlattrcxx . . $ nlattr# *tb[NFTA_NAT_MAXcxx . . $ `include/linux/netfilter/nf_tables.h:1478:9`!+1] = {};
128
129 if (mnl_attr_parse_nestedcxx . . $ mnl_attr_parse_nested(f99c0e9fa94f99d9).(attr, nftnl_expr_nat_cbcxx . . $ nftnl_expr_nat_cb(de2ef18c48fd675c)., tb) < 0)
130 return -1;
131
132 if (tb[NFTA_NAT_TYPEcxx . . $ NFTA_NAT_TYPE.]) {
133 nat->typecxx . . $ nftnl_expr_nat#type. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_TYPE]));
134 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_TYPEcxx . . $ NFTNL_EXPR_NAT_TYPE.);
135 }
136 if (tb[NFTA_NAT_FAMILYcxx . . $ NFTA_NAT_FAMILY.]) {
137 nat->familycxx . . $ nftnl_expr_nat#family. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_FAMILY]));
138 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_FAMILYcxx . . $ NFTNL_EXPR_NAT_FAMILY.);
139 }
140 if (tb[NFTA_NAT_REG_ADDR_MINcxx . . $ NFTA_NAT_REG_ADDR_MIN.]) {
141 nat->sreg_addr_mincxx . . $ nftnl_expr_nat#sreg_addr_min. =
142 ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_REG_ADDR_MIN]));
143 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_REG_ADDR_MINcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MIN.);
144 }
145 if (tb[NFTA_NAT_REG_ADDR_MAXcxx . . $ NFTA_NAT_REG_ADDR_MAX.]) {
146 nat->sreg_addr_maxcxx . . $ nftnl_expr_nat#sreg_addr_max. =
147 ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_REG_ADDR_MAX]));
148 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_REG_ADDR_MAXcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MAX.);
149 }
150 if (tb[NFTA_NAT_REG_PROTO_MINcxx . . $ NFTA_NAT_REG_PROTO_MIN.]) {
151 nat->sreg_proto_mincxx . . $ nftnl_expr_nat#sreg_proto_min. =
152 ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_REG_PROTO_MIN]));
153 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_REG_PROTO_MINcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MIN.);
154 }
155 if (tb[NFTA_NAT_REG_PROTO_MAXcxx . . $ NFTA_NAT_REG_PROTO_MAX.]) {
156 nat->sreg_proto_maxcxx . . $ nftnl_expr_nat#sreg_proto_max. =
157 ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_REG_PROTO_MAX]));
158 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_REG_PROTO_MAXcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MAX.);
159 }
160 if (tb[NFTA_NAT_FLAGScxx . . $ NFTA_NAT_FLAGS.]) {
161 nat->flagscxx . . $ nftnl_expr_nat#flags. = ntohlcxx . . $ `<external>/9581057695539925927/in.h:428:12`!(mnl_attr_get_u32(tb[NFTA_NAT_FLAGS]));
162 e->flagscxx . . $ nftnl_expr#flags. |= (1 << NFTNL_EXPR_NAT_FLAGScxx . . $ NFTNL_EXPR_NAT_FLAGS.);
163 }
164
165 return 0;
166 }
167
168 static void
169 nftnl_expr_nat_buildcxx . . $ nftnl_expr_nat_build(93c7528a9cf90b41).(struct nlmsghdrcxx . . $ nlmsghdr# *nlh, const struct nftnl_exprcxx . . $ nftnl_expr# *e)
170 {
171 struct nftnl_expr_natcxx . . $ nftnl_expr_nat# *nat = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e);
172
173 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_TYPEcxx . . $ NFTNL_EXPR_NAT_TYPE.))
174 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_TYPEcxx . . $ NFTA_NAT_TYPE., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->type));
175 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_FAMILYcxx . . $ NFTNL_EXPR_NAT_FAMILY.))
176 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_FAMILYcxx . . $ NFTA_NAT_FAMILY., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->family));
177 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_ADDR_MINcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MIN.))
178 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_REG_ADDR_MINcxx . . $ NFTA_NAT_REG_ADDR_MIN.,
179 htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->sreg_addr_min));
180 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_ADDR_MAXcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MAX.))
181 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_REG_ADDR_MAXcxx . . $ NFTA_NAT_REG_ADDR_MAX.,
182 htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->sreg_addr_max));
183 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_PROTO_MINcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MIN.))
184 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_REG_PROTO_MINcxx . . $ NFTA_NAT_REG_PROTO_MIN.,
185 htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->sreg_proto_min));
186 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_PROTO_MAXcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MAX.))
187 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_REG_PROTO_MAXcxx . . $ NFTA_NAT_REG_PROTO_MAX.,
188 htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->sreg_proto_max));
189 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_FLAGScxx . . $ NFTNL_EXPR_NAT_FLAGS.))
190 mnl_attr_put_u32cxx . . $ mnl_attr_put_u32(b46fd0aeb0cfb96d).(nlh, NFTA_NAT_FLAGScxx . . $ NFTA_NAT_FLAGS., htonlcxx . . $ `<external>/9581057695539925927/in.h:430:12`!(nat->flags));
191 }
192
193 static inline const char *nat2strcxx . . $ nat2str(4310ac79bf069db).(uint16_tcxx . . $ uint16_t# nat)
194 {
195 switch (nat) {
196 case NFT_NAT_SNATcxx . . $ NFT_NAT_SNAT.:
197 return "snat";
198 case NFT_NAT_DNATcxx . . $ NFT_NAT_DNAT.:
199 return "dnat";
200 default:
201 return "unknown";
202 }
203 }
204
205 static int
206 nftnl_expr_nat_snprintfcxx . . $ nftnl_expr_nat_snprintf(2b4af69501aef780).(char *buf, size_t remain,
207 uint32_tcxx . . $ uint32_t# flags, const struct nftnl_exprcxx . . $ nftnl_expr# *e)
208 {
209 struct nftnl_expr_natcxx . . $ nftnl_expr_nat# *nat = nftnl_expr_datacxx . . $ `include/expr_ops.h:31:9`!(e);
210 int offset = 0, ret = 0;
211
212 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, remain, "%s ", nat2strcxx . . $ nat2str(4310ac79bf069db).(nat->typecxx . . $ nftnl_expr_nat#type.));
213 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
214
215 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain, "%s ",
216 nftnl_family2strcxx . . $ nftnl_family2str(81a3ae90da26a711).(nat->familycxx . . $ nftnl_expr_nat#family.));
217 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
218
219 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_ADDR_MINcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MIN.)) {
220 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain,
221 "addr_min reg %u ", nat->sreg_addr_mincxx . . $ nftnl_expr_nat#sreg_addr_min.);
222 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
223 }
224
225 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_ADDR_MAXcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MAX.)) {
226 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain,
227 "addr_max reg %u ", nat->sreg_addr_maxcxx . . $ nftnl_expr_nat#sreg_addr_max.);
228 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
229 }
230
231 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_PROTO_MINcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MIN.)) {
232 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain,
233 "proto_min reg %u ", nat->sreg_proto_mincxx . . $ nftnl_expr_nat#sreg_proto_min.);
234 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
235 }
236
237 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_REG_PROTO_MAXcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MAX.)) {
238 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain,
239 "proto_max reg %u ", nat->sreg_proto_maxcxx . . $ nftnl_expr_nat#sreg_proto_max.);
240 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
241 }
242
243 if (e->flagscxx . . $ nftnl_expr#flags. & (1 << NFTNL_EXPR_NAT_FLAGScxx . . $ NFTNL_EXPR_NAT_FLAGS.)) {
244 ret = snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf + offset, remain, "flags 0x%x ", nat->flagscxx . . $ nftnl_expr_nat#flags.);
245 SNPRINTF_BUFFER_SIZEcxx . . $ `include/utils.h:55:9`!(ret, remain, offset);
246 }
247
248 return offset;
249 }
250
251 static struct attr_policycxx . . $ attr_policy# nat_attr_policycxx . . $ nat_attr_policy.[__NFTNL_EXPR_NAT_MAXcxx . . $ __NFTNL_EXPR_NAT_MAX.] = {
252 [NFTNL_EXPR_NAT_TYPEcxx . . $ NFTNL_EXPR_NAT_TYPE.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
253 [NFTNL_EXPR_NAT_FAMILYcxx . . $ NFTNL_EXPR_NAT_FAMILY.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
254 [NFTNL_EXPR_NAT_REG_ADDR_MINcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MIN.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
255 [NFTNL_EXPR_NAT_REG_ADDR_MAXcxx . . $ NFTNL_EXPR_NAT_REG_ADDR_MAX.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
256 [NFTNL_EXPR_NAT_REG_PROTO_MINcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MIN.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
257 [NFTNL_EXPR_NAT_REG_PROTO_MAXcxx . . $ NFTNL_EXPR_NAT_REG_PROTO_MAX.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
258 [NFTNL_EXPR_NAT_FLAGScxx . . $ NFTNL_EXPR_NAT_FLAGS.] = { .maxlen = sizeof(uint32_tcxx . . $ uint32_t#) },
259 };
260
261 struct expr_opscxx . . $ expr_ops# expr_ops_natcxx . . $ expr_ops_nat. = {
262 .name = "nat",
263 .alloc_len = sizeof(struct nftnl_expr_natcxx . . $ nftnl_expr_nat#),
264 .nftnl_max_attr = __NFTNL_EXPR_NAT_MAXcxx . . $ __NFTNL_EXPR_NAT_MAX. - 1,
265 .attr_policy = nat_attr_policycxx . . $ nat_attr_policy.,
266 .set = nftnl_expr_nat_setcxx . . $ nftnl_expr_nat_set(211371a3e3842127).,
267 .get = nftnl_expr_nat_getcxx . . $ nftnl_expr_nat_get(9de263c4f9e71c4b).,
268 .parse = nftnl_expr_nat_parsecxx . . $ nftnl_expr_nat_parse(ed61207049d8af9a).,
269 .build = nftnl_expr_nat_buildcxx . . $ nftnl_expr_nat_build(93c7528a9cf90b41).,
270 .output = nftnl_expr_nat_snprintfcxx . . $ nftnl_expr_nat_snprintf(2b4af69501aef780).,
271 };