1#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6
7type __u8 = u8;
8type __u16 = u16;
9type __u32 = u32;
10type __be16 = u16;
11type __be32 = u32;
12type __be64 = u64;
13type pid_t = ::core::ffi::c_int;
14type socklen_t = ::core::ffi::c_uint;
15
16pub const NETLINK_ROUTE: u32 = 0;
17pub const NETLINK_UNUSED: u32 = 1;
18pub const NETLINK_USERSOCK: u32 = 2;
19pub const NETLINK_FIREWALL: u32 = 3;
20pub const NETLINK_SOCK_DIAG: u32 = 4;
21pub const NETLINK_NFLOG: u32 = 5;
22pub const NETLINK_XFRM: u32 = 6;
23pub const NETLINK_SELINUX: u32 = 7;
24pub const NETLINK_ISCSI: u32 = 8;
25pub const NETLINK_AUDIT: u32 = 9;
26pub const NETLINK_FIB_LOOKUP: u32 = 10;
27pub const NETLINK_CONNECTOR: u32 = 11;
28pub const NETLINK_NETFILTER: u32 = 12;
29pub const NETLINK_IP6_FW: u32 = 13;
30pub const NETLINK_DNRTMSG: u32 = 14;
31pub const NETLINK_KOBJECT_UEVENT: u32 = 15;
32pub const NETLINK_GENERIC: u32 = 16;
33pub const NETLINK_SCSITRANSPORT: u32 = 18;
34pub const NETLINK_ECRYPTFS: u32 = 19;
35pub const NETLINK_RDMA: u32 = 20;
36pub const NETLINK_CRYPTO: u32 = 21;
37pub const NETLINK_SMC: u32 = 22;
38pub const NETLINK_INET_DIAG: u32 = 4;
39pub const NLM_F_REQUEST: u32 = 1;
40pub const NLM_F_MULTI: u32 = 2;
41pub const NLM_F_ACK: u32 = 4;
42pub const NLM_F_ECHO: u32 = 8;
43pub const NLM_F_DUMP_INTR: u32 = 16;
44pub const NLM_F_DUMP_FILTERED: u32 = 32;
45pub const NLM_F_ROOT: u32 = 256;
46pub const NLM_F_MATCH: u32 = 512;
47pub const NLM_F_ATOMIC: u32 = 1024;
48pub const NLM_F_DUMP: u32 = 768;
49pub const NLM_F_REPLACE: u32 = 256;
50pub const NLM_F_EXCL: u32 = 512;
51pub const NLM_F_CREATE: u32 = 1024;
52pub const NLM_F_APPEND: u32 = 2048;
53pub const NLM_F_NONREC: u32 = 256;
54pub const NLM_F_BULK: u32 = 512;
55pub const NLM_F_CAPPED: u32 = 256;
56pub const NLM_F_ACK_TLVS: u32 = 512;
57pub const NLMSG_ALIGNTO: u32 = 4;
58pub const NLMSG_HDRLEN: u32 = 16;
59pub const NLMSG_NOOP: u32 = 1;
60pub const NLMSG_ERROR: u32 = 2;
61pub const NLMSG_DONE: u32 = 3;
62pub const NLMSG_OVERRUN: u32 = 4;
63pub const NLMSG_MIN_TYPE: u32 = 16;
64pub const NETLINK_ADD_MEMBERSHIP: u32 = 1;
65pub const NETLINK_DROP_MEMBERSHIP: u32 = 2;
66pub const NETLINK_PKTINFO: u32 = 3;
67pub const NETLINK_BROADCAST_ERROR: u32 = 4;
68pub const NETLINK_NO_ENOBUFS: u32 = 5;
69pub const NETLINK_RX_RING: u32 = 6;
70pub const NETLINK_TX_RING: u32 = 7;
71pub const NETLINK_LISTEN_ALL_NSID: u32 = 8;
72pub const NETLINK_LIST_MEMBERSHIPS: u32 = 9;
73pub const NETLINK_CAP_ACK: u32 = 10;
74pub const NETLINK_EXT_ACK: u32 = 11;
75pub const NETLINK_GET_STRICT_CHK: u32 = 12;
76pub const NF_DROP: u32 = 0;
77pub const NF_ACCEPT: u32 = 1;
78pub const NF_STOLEN: u32 = 2;
79pub const NF_QUEUE: u32 = 3;
80pub const NF_REPEAT: u32 = 4;
81pub const NF_STOP: u32 = 5;
82pub const NF_MAX_VERDICT: u32 = 5;
83pub const NF_VERDICT_MASK: u32 = 255;
84pub const NF_VERDICT_FLAG_QUEUE_BYPASS: u32 = 32768;
85pub const NF_VERDICT_QMASK: u32 = 4294901760;
86pub const NF_VERDICT_QBITS: u32 = 16;
87pub const NF_VERDICT_BITS: u32 = 16;
88pub const NF_NETLINK_CONNTRACK_NEW: u32 = 1;
89pub const NF_NETLINK_CONNTRACK_UPDATE: u32 = 2;
90pub const NF_NETLINK_CONNTRACK_DESTROY: u32 = 4;
91pub const NF_NETLINK_CONNTRACK_EXP_NEW: u32 = 8;
92pub const NF_NETLINK_CONNTRACK_EXP_UPDATE: u32 = 16;
93pub const NF_NETLINK_CONNTRACK_EXP_DESTROY: u32 = 32;
94pub const NFNL_NFA_NEST: u32 = 32768;
95pub const NFA_ALIGNTO: u32 = 4;
96pub const NFNLGRP_NONE: u32 = 0;
97pub const NFNLGRP_CONNTRACK_NEW: u32 = 1;
98pub const NFNLGRP_CONNTRACK_UPDATE: u32 = 2;
99pub const NFNLGRP_CONNTRACK_DESTROY: u32 = 3;
100pub const NFNLGRP_CONNTRACK_EXP_NEW: u32 = 4;
101pub const NFNLGRP_CONNTRACK_EXP_UPDATE: u32 = 5;
102pub const NFNLGRP_CONNTRACK_EXP_DESTROY: u32 = 6;
103pub const NFNLGRP_NFTABLES: u32 = 7;
104pub const NFNLGRP_ACCT_QUOTA: u32 = 8;
105pub const NFNLGRP_NFTRACE: u32 = 9;
106pub const NFNLGRP_MAX: u32 = 9;
107pub const NFNETLINK_V0: u32 = 0;
108pub const NFNL_SUBSYS_NONE: u32 = 0;
109pub const NFNL_SUBSYS_CTNETLINK: u32 = 1;
110pub const NFNL_SUBSYS_CTNETLINK_EXP: u32 = 2;
111pub const NFNL_SUBSYS_QUEUE: u32 = 3;
112pub const NFNL_SUBSYS_ULOG: u32 = 4;
113pub const NFNL_SUBSYS_OSF: u32 = 5;
114pub const NFNL_SUBSYS_IPSET: u32 = 6;
115pub const NFNL_SUBSYS_ACCT: u32 = 7;
116pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: u32 = 8;
117pub const NFNL_SUBSYS_CTHELPER: u32 = 9;
118pub const NFNL_SUBSYS_NFTABLES: u32 = 10;
119pub const NFNL_SUBSYS_NFT_COMPAT: u32 = 11;
120pub const NFNL_SUBSYS_HOOK: u32 = 12;
121pub const NFNL_SUBSYS_COUNT: u32 = 13;
122pub const NFNL_MSG_BATCH_BEGIN: u32 = 16;
123pub const NFNL_MSG_BATCH_END: u32 = 17;
124pub const NFNL_BATCH_MAX: u32 = 1;
125pub const CTA_NAT: u32 = 6;
126pub const CTA_MAX: u32 = 26;
127pub const CTA_TUPLE_MAX: u32 = 3;
128pub const CTA_IP_MAX: u32 = 4;
129pub const CTA_PROTO_MAX: u32 = 9;
130pub const CTA_PROTOINFO_MAX: u32 = 3;
131pub const CTA_PROTOINFO_TCP_MAX: u32 = 5;
132pub const CTA_PROTOINFO_DCCP_MAX: u32 = 4;
133pub const CTA_PROTOINFO_SCTP_MAX: u32 = 3;
134pub const CTA_COUNTERS_MAX: u32 = 5;
135pub const CTA_TIMESTAMP_MAX: u32 = 3;
136pub const CTA_NAT_MINIP: u32 = 1;
137pub const CTA_NAT_MAXIP: u32 = 2;
138pub const CTA_NAT_MAX: u32 = 5;
139pub const CTA_PROTONAT_MAX: u32 = 2;
140pub const CTA_SEQADJ_MAX: u32 = 3;
141pub const CTA_NAT_SEQ_MAX: u32 = 3;
142pub const CTA_SYNPROXY_MAX: u32 = 3;
143pub const CTA_EXPECT_MAX: u32 = 11;
144pub const CTA_EXPECT_NAT_MAX: u32 = 2;
145pub const CTA_HELP_MAX: u32 = 2;
146pub const CTA_SECCTX_MAX: u32 = 1;
147pub const CTA_STATS_MAX: u32 = 15;
148pub const CTA_STATS_GLOBAL_MAX: u32 = 2;
149pub const CTA_STATS_EXP_MAX: u32 = 3;
150pub const CTA_FILTER_MAX: u32 = 2;
151pub const NFQA_VLAN_MAX: u32 = 2;
152pub const NFQA_MAX: u32 = 22;
153pub const NFQA_CFG_MAX: u32 = 5;
154pub const NFQA_CFG_F_FAIL_OPEN: u32 = 1;
155pub const NFQA_CFG_F_CONNTRACK: u32 = 2;
156pub const NFQA_CFG_F_GSO: u32 = 4;
157pub const NFQA_CFG_F_UID_GID: u32 = 8;
158pub const NFQA_CFG_F_SECCTX: u32 = 16;
159pub const NFQA_CFG_F_MAX: u32 = 32;
160pub const NFQA_SKB_CSUMNOTREADY: u32 = 1;
161pub const NFQA_SKB_GSO: u32 = 2;
162pub const NFQA_SKB_CSUM_NOTVERIFIED: u32 = 4;
163pub const NFDBITS: u32 = 64;
164pub const MNL_SOCKET_AUTOPID: u32 = 0;
165pub const MNL_SOCKET_DUMP_SIZE: u32 = 32768;
166pub const MNL_ALIGNTO: u32 = 4;
167pub const MNL_NLMSG_HDRLEN: u32 = 16;
168pub const MNL_ATTR_HDRLEN: u32 = 4;
169pub const MNL_CB_ERROR: i32 = -1;
170pub const MNL_CB_STOP: u32 = 0;
171pub const MNL_CB_OK: u32 = 1;
172#[repr(C)]
173pub struct nlmsghdr {
174 pub nlmsg_len: __u32,
175 pub nlmsg_type: __u16,
176 pub nlmsg_flags: __u16,
177 pub nlmsg_seq: __u32,
178 pub nlmsg_pid: __u32,
179}
180#[repr(C)]
181pub struct nlattr {
182 pub nla_len: __u16,
183 pub nla_type: __u16,
184}
185#[repr(C)]
186pub struct nfgenmsg {
187 pub nfgen_family: __u8,
188 pub version: __u8,
189 pub res_id: __be16,
190}
191pub const CTA_UNSPEC: ctattr_type = 0;
192pub const CTA_TUPLE_ORIG: ctattr_type = 1;
193pub const CTA_TUPLE_REPLY: ctattr_type = 2;
194pub const CTA_STATUS: ctattr_type = 3;
195pub const CTA_PROTOINFO: ctattr_type = 4;
196pub const CTA_HELP: ctattr_type = 5;
197pub const CTA_NAT_SRC: ctattr_type = 6;
198pub const CTA_TIMEOUT: ctattr_type = 7;
199pub const CTA_MARK: ctattr_type = 8;
200pub const CTA_COUNTERS_ORIG: ctattr_type = 9;
201pub const CTA_COUNTERS_REPLY: ctattr_type = 10;
202pub const CTA_USE: ctattr_type = 11;
203pub const CTA_ID: ctattr_type = 12;
204pub const CTA_NAT_DST: ctattr_type = 13;
205pub const CTA_TUPLE_MASTER: ctattr_type = 14;
206pub const CTA_SEQ_ADJ_ORIG: ctattr_type = 15;
207pub const CTA_NAT_SEQ_ADJ_ORIG: ctattr_type = 15;
208pub const CTA_SEQ_ADJ_REPLY: ctattr_type = 16;
209pub const CTA_NAT_SEQ_ADJ_REPLY: ctattr_type = 16;
210pub const CTA_SECMARK: ctattr_type = 17;
211pub const CTA_ZONE: ctattr_type = 18;
212pub const CTA_SECCTX: ctattr_type = 19;
213pub const CTA_TIMESTAMP: ctattr_type = 20;
214pub const CTA_MARK_MASK: ctattr_type = 21;
215pub const CTA_LABELS: ctattr_type = 22;
216pub const CTA_LABELS_MASK: ctattr_type = 23;
217pub const CTA_SYNPROXY: ctattr_type = 24;
218pub const CTA_FILTER: ctattr_type = 25;
219pub const CTA_STATUS_MASK: ctattr_type = 26;
220pub const __CTA_MAX: ctattr_type = 27;
221pub type ctattr_type = ::core::ffi::c_uint;
222pub const CTA_TUPLE_UNSPEC: ctattr_tuple = 0;
223pub const CTA_TUPLE_IP: ctattr_tuple = 1;
224pub const CTA_TUPLE_PROTO: ctattr_tuple = 2;
225pub const CTA_TUPLE_ZONE: ctattr_tuple = 3;
226pub const __CTA_TUPLE_MAX: ctattr_tuple = 4;
227pub type ctattr_tuple = ::core::ffi::c_uint;
228pub const CTA_IP_UNSPEC: ctattr_ip = 0;
229pub const CTA_IP_V4_SRC: ctattr_ip = 1;
230pub const CTA_IP_V4_DST: ctattr_ip = 2;
231pub const CTA_IP_V6_SRC: ctattr_ip = 3;
232pub const CTA_IP_V6_DST: ctattr_ip = 4;
233pub const __CTA_IP_MAX: ctattr_ip = 5;
234pub type ctattr_ip = ::core::ffi::c_uint;
235pub const CTA_PROTO_UNSPEC: ctattr_l4proto = 0;
236pub const CTA_PROTO_NUM: ctattr_l4proto = 1;
237pub const CTA_PROTO_SRC_PORT: ctattr_l4proto = 2;
238pub const CTA_PROTO_DST_PORT: ctattr_l4proto = 3;
239pub const CTA_PROTO_ICMP_ID: ctattr_l4proto = 4;
240pub const CTA_PROTO_ICMP_TYPE: ctattr_l4proto = 5;
241pub const CTA_PROTO_ICMP_CODE: ctattr_l4proto = 6;
242pub const CTA_PROTO_ICMPV6_ID: ctattr_l4proto = 7;
243pub const CTA_PROTO_ICMPV6_TYPE: ctattr_l4proto = 8;
244pub const CTA_PROTO_ICMPV6_CODE: ctattr_l4proto = 9;
245pub const __CTA_PROTO_MAX: ctattr_l4proto = 10;
246pub type ctattr_l4proto = ::core::ffi::c_uint;
247pub const CTA_PROTOINFO_UNSPEC: ctattr_protoinfo = 0;
248pub const CTA_PROTOINFO_TCP: ctattr_protoinfo = 1;
249pub const CTA_PROTOINFO_DCCP: ctattr_protoinfo = 2;
250pub const CTA_PROTOINFO_SCTP: ctattr_protoinfo = 3;
251pub const __CTA_PROTOINFO_MAX: ctattr_protoinfo = 4;
252pub type ctattr_protoinfo = ::core::ffi::c_uint;
253pub const CTA_PROTOINFO_TCP_UNSPEC: ctattr_protoinfo_tcp = 0;
254pub const CTA_PROTOINFO_TCP_STATE: ctattr_protoinfo_tcp = 1;
255pub const CTA_PROTOINFO_TCP_WSCALE_ORIGINAL: ctattr_protoinfo_tcp = 2;
256pub const CTA_PROTOINFO_TCP_WSCALE_REPLY: ctattr_protoinfo_tcp = 3;
257pub const CTA_PROTOINFO_TCP_FLAGS_ORIGINAL: ctattr_protoinfo_tcp = 4;
258pub const CTA_PROTOINFO_TCP_FLAGS_REPLY: ctattr_protoinfo_tcp = 5;
259pub const __CTA_PROTOINFO_TCP_MAX: ctattr_protoinfo_tcp = 6;
260pub type ctattr_protoinfo_tcp = ::core::ffi::c_uint;
261pub const CTA_PROTOINFO_DCCP_UNSPEC: ctattr_protoinfo_dccp = 0;
262pub const CTA_PROTOINFO_DCCP_STATE: ctattr_protoinfo_dccp = 1;
263pub const CTA_PROTOINFO_DCCP_ROLE: ctattr_protoinfo_dccp = 2;
264pub const CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ: ctattr_protoinfo_dccp = 3;
265pub const CTA_PROTOINFO_DCCP_PAD: ctattr_protoinfo_dccp = 4;
266pub const __CTA_PROTOINFO_DCCP_MAX: ctattr_protoinfo_dccp = 5;
267pub type ctattr_protoinfo_dccp = ::core::ffi::c_uint;
268pub const CTA_PROTOINFO_SCTP_UNSPEC: ctattr_protoinfo_sctp = 0;
269pub const CTA_PROTOINFO_SCTP_STATE: ctattr_protoinfo_sctp = 1;
270pub const CTA_PROTOINFO_SCTP_VTAG_ORIGINAL: ctattr_protoinfo_sctp = 2;
271pub const CTA_PROTOINFO_SCTP_VTAG_REPLY: ctattr_protoinfo_sctp = 3;
272pub const __CTA_PROTOINFO_SCTP_MAX: ctattr_protoinfo_sctp = 4;
273pub type ctattr_protoinfo_sctp = ::core::ffi::c_uint;
274pub const CTA_COUNTERS_UNSPEC: ctattr_counters = 0;
275pub const CTA_COUNTERS_PACKETS: ctattr_counters = 1;
276pub const CTA_COUNTERS_BYTES: ctattr_counters = 2;
277pub const CTA_COUNTERS32_PACKETS: ctattr_counters = 3;
278pub const CTA_COUNTERS32_BYTES: ctattr_counters = 4;
279pub const CTA_COUNTERS_PAD: ctattr_counters = 5;
280pub const __CTA_COUNTERS_MAX: ctattr_counters = 6;
281pub type ctattr_counters = ::core::ffi::c_uint;
282pub const CTA_TIMESTAMP_UNSPEC: ctattr_tstamp = 0;
283pub const CTA_TIMESTAMP_START: ctattr_tstamp = 1;
284pub const CTA_TIMESTAMP_STOP: ctattr_tstamp = 2;
285pub const CTA_TIMESTAMP_PAD: ctattr_tstamp = 3;
286pub const __CTA_TIMESTAMP_MAX: ctattr_tstamp = 4;
287pub type ctattr_tstamp = ::core::ffi::c_uint;
288pub const CTA_NAT_UNSPEC: ctattr_nat = 0;
289pub const CTA_NAT_V4_MINIP: ctattr_nat = 1;
290pub const CTA_NAT_V4_MAXIP: ctattr_nat = 2;
291pub const CTA_NAT_PROTO: ctattr_nat = 3;
292pub const CTA_NAT_V6_MINIP: ctattr_nat = 4;
293pub const CTA_NAT_V6_MAXIP: ctattr_nat = 5;
294pub const __CTA_NAT_MAX: ctattr_nat = 6;
295pub type ctattr_nat = ::core::ffi::c_uint;
296pub const CTA_PROTONAT_UNSPEC: ctattr_protonat = 0;
297pub const CTA_PROTONAT_PORT_MIN: ctattr_protonat = 1;
298pub const CTA_PROTONAT_PORT_MAX: ctattr_protonat = 2;
299pub const __CTA_PROTONAT_MAX: ctattr_protonat = 3;
300pub type ctattr_protonat = ::core::ffi::c_uint;
301pub const CTA_SEQADJ_UNSPEC: ctattr_seqadj = 0;
302pub const CTA_SEQADJ_CORRECTION_POS: ctattr_seqadj = 1;
303pub const CTA_SEQADJ_OFFSET_BEFORE: ctattr_seqadj = 2;
304pub const CTA_SEQADJ_OFFSET_AFTER: ctattr_seqadj = 3;
305pub const __CTA_SEQADJ_MAX: ctattr_seqadj = 4;
306pub type ctattr_seqadj = ::core::ffi::c_uint;
307pub const CTA_NAT_SEQ_UNSPEC: ctattr_natseq = 0;
308pub const CTA_NAT_SEQ_CORRECTION_POS: ctattr_natseq = 1;
309pub const CTA_NAT_SEQ_OFFSET_BEFORE: ctattr_natseq = 2;
310pub const CTA_NAT_SEQ_OFFSET_AFTER: ctattr_natseq = 3;
311pub const __CTA_NAT_SEQ_MAX: ctattr_natseq = 4;
312pub type ctattr_natseq = ::core::ffi::c_uint;
313pub const CTA_SYNPROXY_UNSPEC: ctattr_synproxy = 0;
314pub const CTA_SYNPROXY_ISN: ctattr_synproxy = 1;
315pub const CTA_SYNPROXY_ITS: ctattr_synproxy = 2;
316pub const CTA_SYNPROXY_TSOFF: ctattr_synproxy = 3;
317pub const __CTA_SYNPROXY_MAX: ctattr_synproxy = 4;
318pub type ctattr_synproxy = ::core::ffi::c_uint;
319pub const CTA_EXPECT_UNSPEC: ctattr_expect = 0;
320pub const CTA_EXPECT_MASTER: ctattr_expect = 1;
321pub const CTA_EXPECT_TUPLE: ctattr_expect = 2;
322pub const CTA_EXPECT_MASK: ctattr_expect = 3;
323pub const CTA_EXPECT_TIMEOUT: ctattr_expect = 4;
324pub const CTA_EXPECT_ID: ctattr_expect = 5;
325pub const CTA_EXPECT_HELP_NAME: ctattr_expect = 6;
326pub const CTA_EXPECT_ZONE: ctattr_expect = 7;
327pub const CTA_EXPECT_FLAGS: ctattr_expect = 8;
328pub const CTA_EXPECT_CLASS: ctattr_expect = 9;
329pub const CTA_EXPECT_NAT: ctattr_expect = 10;
330pub const CTA_EXPECT_FN: ctattr_expect = 11;
331pub const __CTA_EXPECT_MAX: ctattr_expect = 12;
332pub type ctattr_expect = ::core::ffi::c_uint;
333pub const CTA_EXPECT_NAT_UNSPEC: ctattr_expect_nat = 0;
334pub const CTA_EXPECT_NAT_DIR: ctattr_expect_nat = 1;
335pub const CTA_EXPECT_NAT_TUPLE: ctattr_expect_nat = 2;
336pub const __CTA_EXPECT_NAT_MAX: ctattr_expect_nat = 3;
337pub type ctattr_expect_nat = ::core::ffi::c_uint;
338pub const CTA_HELP_UNSPEC: ctattr_help = 0;
339pub const CTA_HELP_NAME: ctattr_help = 1;
340pub const CTA_HELP_INFO: ctattr_help = 2;
341pub const __CTA_HELP_MAX: ctattr_help = 3;
342pub type ctattr_help = ::core::ffi::c_uint;
343pub const CTA_SECCTX_UNSPEC: ctattr_secctx = 0;
344pub const CTA_SECCTX_NAME: ctattr_secctx = 1;
345pub const __CTA_SECCTX_MAX: ctattr_secctx = 2;
346pub type ctattr_secctx = ::core::ffi::c_uint;
347pub const CTA_STATS_UNSPEC: ctattr_stats_cpu = 0;
348pub const CTA_STATS_SEARCHED: ctattr_stats_cpu = 1;
349pub const CTA_STATS_FOUND: ctattr_stats_cpu = 2;
350pub const CTA_STATS_NEW: ctattr_stats_cpu = 3;
351pub const CTA_STATS_INVALID: ctattr_stats_cpu = 4;
352pub const CTA_STATS_IGNORE: ctattr_stats_cpu = 5;
353pub const CTA_STATS_DELETE: ctattr_stats_cpu = 6;
354pub const CTA_STATS_DELETE_LIST: ctattr_stats_cpu = 7;
355pub const CTA_STATS_INSERT: ctattr_stats_cpu = 8;
356pub const CTA_STATS_INSERT_FAILED: ctattr_stats_cpu = 9;
357pub const CTA_STATS_DROP: ctattr_stats_cpu = 10;
358pub const CTA_STATS_EARLY_DROP: ctattr_stats_cpu = 11;
359pub const CTA_STATS_ERROR: ctattr_stats_cpu = 12;
360pub const CTA_STATS_SEARCH_RESTART: ctattr_stats_cpu = 13;
361pub const CTA_STATS_CLASH_RESOLVE: ctattr_stats_cpu = 14;
362pub const CTA_STATS_CHAIN_TOOLONG: ctattr_stats_cpu = 15;
363pub const __CTA_STATS_MAX: ctattr_stats_cpu = 16;
364pub type ctattr_stats_cpu = ::core::ffi::c_uint;
365pub const CTA_STATS_GLOBAL_UNSPEC: ctattr_stats_global = 0;
366pub const CTA_STATS_GLOBAL_ENTRIES: ctattr_stats_global = 1;
367pub const CTA_STATS_GLOBAL_MAX_ENTRIES: ctattr_stats_global = 2;
368pub const __CTA_STATS_GLOBAL_MAX: ctattr_stats_global = 3;
369pub type ctattr_stats_global = ::core::ffi::c_uint;
370pub const CTA_STATS_EXP_UNSPEC: ctattr_expect_stats = 0;
371pub const CTA_STATS_EXP_NEW: ctattr_expect_stats = 1;
372pub const CTA_STATS_EXP_CREATE: ctattr_expect_stats = 2;
373pub const CTA_STATS_EXP_DELETE: ctattr_expect_stats = 3;
374pub const __CTA_STATS_EXP_MAX: ctattr_expect_stats = 4;
375pub type ctattr_expect_stats = ::core::ffi::c_uint;
376pub const CTA_FILTER_UNSPEC: ctattr_filter = 0;
377pub const CTA_FILTER_ORIG_FLAGS: ctattr_filter = 1;
378pub const CTA_FILTER_REPLY_FLAGS: ctattr_filter = 2;
379pub const __CTA_FILTER_MAX: ctattr_filter = 3;
380pub type ctattr_filter = ::core::ffi::c_uint;
381pub const NFQNL_MSG_PACKET: nfqnl_msg_types = 0;
382pub const NFQNL_MSG_VERDICT: nfqnl_msg_types = 1;
383pub const NFQNL_MSG_CONFIG: nfqnl_msg_types = 2;
384pub const NFQNL_MSG_VERDICT_BATCH: nfqnl_msg_types = 3;
385pub const NFQNL_MSG_MAX: nfqnl_msg_types = 4;
386pub type nfqnl_msg_types = ::core::ffi::c_uint;
387#[repr(C, packed)]
388pub struct nfqnl_msg_packet_hdr {
389 pub packet_id: __be32,
390 pub hw_protocol: __be16,
391 pub hook: __u8,
392}
393#[repr(C)]
394pub struct nfqnl_msg_packet_hw {
395 pub hw_addrlen: __be16,
396 pub _pad: __u16,
397 pub hw_addr: [__u8; 8usize],
398}
399#[repr(C)]
400pub struct nfqnl_msg_packet_timestamp {
401 pub sec: __be64,
402 pub usec: __be64,
403}
404pub const NFQA_VLAN_UNSPEC: nfqnl_vlan_attr = 0;
405pub const NFQA_VLAN_PROTO: nfqnl_vlan_attr = 1;
406pub const NFQA_VLAN_TCI: nfqnl_vlan_attr = 2;
407pub const __NFQA_VLAN_MAX: nfqnl_vlan_attr = 3;
408pub type nfqnl_vlan_attr = ::core::ffi::c_uint;
409pub const NFQA_UNSPEC: nfqnl_attr_type = 0;
410pub const NFQA_PACKET_HDR: nfqnl_attr_type = 1;
411pub const NFQA_VERDICT_HDR: nfqnl_attr_type = 2;
412pub const NFQA_MARK: nfqnl_attr_type = 3;
413pub const NFQA_TIMESTAMP: nfqnl_attr_type = 4;
414pub const NFQA_IFINDEX_INDEV: nfqnl_attr_type = 5;
415pub const NFQA_IFINDEX_OUTDEV: nfqnl_attr_type = 6;
416pub const NFQA_IFINDEX_PHYSINDEV: nfqnl_attr_type = 7;
417pub const NFQA_IFINDEX_PHYSOUTDEV: nfqnl_attr_type = 8;
418pub const NFQA_HWADDR: nfqnl_attr_type = 9;
419pub const NFQA_PAYLOAD: nfqnl_attr_type = 10;
420pub const NFQA_CT: nfqnl_attr_type = 11;
421pub const NFQA_CT_INFO: nfqnl_attr_type = 12;
422pub const NFQA_CAP_LEN: nfqnl_attr_type = 13;
423pub const NFQA_SKB_INFO: nfqnl_attr_type = 14;
424pub const NFQA_EXP: nfqnl_attr_type = 15;
425pub const NFQA_UID: nfqnl_attr_type = 16;
426pub const NFQA_GID: nfqnl_attr_type = 17;
427pub const NFQA_SECCTX: nfqnl_attr_type = 18;
428pub const NFQA_VLAN: nfqnl_attr_type = 19;
429pub const NFQA_L2HDR: nfqnl_attr_type = 20;
430pub const NFQA_PRIORITY: nfqnl_attr_type = 21;
431pub const NFQA_CGROUP_CLASSID: nfqnl_attr_type = 22;
432pub const __NFQA_MAX: nfqnl_attr_type = 23;
433pub type nfqnl_attr_type = ::core::ffi::c_uint;
434#[repr(C)]
435pub struct nfqnl_msg_verdict_hdr {
436 pub verdict: __be32,
437 pub id: __be32,
438}
439pub const NFQNL_CFG_CMD_NONE: nfqnl_msg_config_cmds = 0;
440pub const NFQNL_CFG_CMD_BIND: nfqnl_msg_config_cmds = 1;
441pub const NFQNL_CFG_CMD_UNBIND: nfqnl_msg_config_cmds = 2;
442pub const NFQNL_CFG_CMD_PF_BIND: nfqnl_msg_config_cmds = 3;
443pub const NFQNL_CFG_CMD_PF_UNBIND: nfqnl_msg_config_cmds = 4;
444pub type nfqnl_msg_config_cmds = ::core::ffi::c_uint;
445#[repr(C)]
446pub struct nfqnl_msg_config_cmd {
447 pub command: __u8,
448 pub _pad: __u8,
449 pub pf: __be16,
450}
451pub const NFQNL_COPY_NONE: nfqnl_config_mode = 0;
452pub const NFQNL_COPY_META: nfqnl_config_mode = 1;
453pub const NFQNL_COPY_PACKET: nfqnl_config_mode = 2;
454pub type nfqnl_config_mode = ::core::ffi::c_uint;
455#[repr(C, packed)]
456pub struct nfqnl_msg_config_params {
457 pub copy_range: __be32,
458 pub copy_mode: __u8,
459}
460pub const NFQA_CFG_UNSPEC: nfqnl_attr_config = 0;
461pub const NFQA_CFG_CMD: nfqnl_attr_config = 1;
462pub const NFQA_CFG_PARAMS: nfqnl_attr_config = 2;
463pub const NFQA_CFG_QUEUE_MAXLEN: nfqnl_attr_config = 3;
464pub const NFQA_CFG_MASK: nfqnl_attr_config = 4;
465pub const NFQA_CFG_FLAGS: nfqnl_attr_config = 5;
466pub const __NFQA_CFG_MAX: nfqnl_attr_config = 6;
467pub type nfqnl_attr_config = ::core::ffi::c_uint;
468#[repr(C)]
469#[derive(Debug, Copy, Clone)]
470pub struct mnl_socket {
471 _unused: [u8; 0],
472}
473#[repr(C)]
474#[derive(Debug, Copy, Clone)]
475pub struct mnl_nlmsg_batch {
476 _unused: [u8; 0],
477}
478pub const MNL_TYPE_UNSPEC: mnl_attr_data_type = 0;
479pub const MNL_TYPE_U8: mnl_attr_data_type = 1;
480pub const MNL_TYPE_U16: mnl_attr_data_type = 2;
481pub const MNL_TYPE_U32: mnl_attr_data_type = 3;
482pub const MNL_TYPE_U64: mnl_attr_data_type = 4;
483pub const MNL_TYPE_STRING: mnl_attr_data_type = 5;
484pub const MNL_TYPE_FLAG: mnl_attr_data_type = 6;
485pub const MNL_TYPE_MSECS: mnl_attr_data_type = 7;
486pub const MNL_TYPE_NESTED: mnl_attr_data_type = 8;
487pub const MNL_TYPE_NESTED_COMPAT: mnl_attr_data_type = 9;
488pub const MNL_TYPE_NUL_STRING: mnl_attr_data_type = 10;
489pub const MNL_TYPE_BINARY: mnl_attr_data_type = 11;
490pub const MNL_TYPE_MAX: mnl_attr_data_type = 12;
491pub type mnl_attr_data_type = ::core::ffi::c_uint;
492pub type mnl_attr_cb_t = ::core::option::Option<
493 unsafe extern "C" fn(attr: *const nlattr, data: *mut ::core::ffi::c_void) -> ::core::ffi::c_int,
494>;
495pub type mnl_cb_t = ::core::option::Option<
496 unsafe extern "C" fn(
497 nlh: *const nlmsghdr,
498 data: *mut ::core::ffi::c_void,
499 ) -> ::core::ffi::c_int,
500>;
501unsafe extern "C" {
502 pub fn mnl_socket_open(bus: ::core::ffi::c_int) -> *mut mnl_socket;
503 pub fn mnl_socket_open2(bus: ::core::ffi::c_int, flags: ::core::ffi::c_int) -> *mut mnl_socket;
504 pub fn mnl_socket_fdopen(fd: ::core::ffi::c_int) -> *mut mnl_socket;
505 pub fn mnl_socket_bind(
506 nl: *mut mnl_socket,
507 groups: ::core::ffi::c_uint,
508 pid: pid_t,
509 ) -> ::core::ffi::c_int;
510 pub fn mnl_socket_close(nl: *mut mnl_socket) -> ::core::ffi::c_int;
511 pub fn mnl_socket_get_fd(nl: *const mnl_socket) -> ::core::ffi::c_int;
512 pub fn mnl_socket_get_portid(nl: *const mnl_socket) -> ::core::ffi::c_uint;
513 pub fn mnl_socket_sendto(
514 nl: *const mnl_socket,
515 req: *const ::core::ffi::c_void,
516 siz: usize,
517 ) -> isize;
518 pub fn mnl_socket_recvfrom(
519 nl: *const mnl_socket,
520 buf: *mut ::core::ffi::c_void,
521 siz: usize,
522 ) -> isize;
523 pub fn mnl_socket_setsockopt(
524 nl: *const mnl_socket,
525 type_: ::core::ffi::c_int,
526 buf: *mut ::core::ffi::c_void,
527 len: socklen_t,
528 ) -> ::core::ffi::c_int;
529 pub fn mnl_socket_getsockopt(
530 nl: *const mnl_socket,
531 type_: ::core::ffi::c_int,
532 buf: *mut ::core::ffi::c_void,
533 len: *mut socklen_t,
534 ) -> ::core::ffi::c_int;
535 pub fn mnl_nlmsg_size(len: usize) -> usize;
536 pub fn mnl_nlmsg_get_payload_len(nlh: *const nlmsghdr) -> usize;
537 pub fn mnl_nlmsg_put_header(buf: *mut ::core::ffi::c_void) -> *mut nlmsghdr;
538 pub fn mnl_nlmsg_put_extra_header(nlh: *mut nlmsghdr, size: usize) -> *mut ::core::ffi::c_void;
539 pub fn mnl_nlmsg_ok(nlh: *const nlmsghdr, len: ::core::ffi::c_int) -> bool;
540 pub fn mnl_nlmsg_next(nlh: *const nlmsghdr, len: *mut ::core::ffi::c_int) -> *mut nlmsghdr;
541 pub fn mnl_nlmsg_seq_ok(nlh: *const nlmsghdr, seq: ::core::ffi::c_uint) -> bool;
542 pub fn mnl_nlmsg_portid_ok(nlh: *const nlmsghdr, portid: ::core::ffi::c_uint) -> bool;
543 pub fn mnl_nlmsg_get_payload(nlh: *const nlmsghdr) -> *mut ::core::ffi::c_void;
544 pub fn mnl_nlmsg_get_payload_offset(
545 nlh: *const nlmsghdr,
546 offset: usize,
547 ) -> *mut ::core::ffi::c_void;
548 pub fn mnl_nlmsg_get_payload_tail(nlh: *const nlmsghdr) -> *mut ::core::ffi::c_void;
549 pub fn mnl_nlmsg_batch_start(
550 buf: *mut ::core::ffi::c_void,
551 bufsiz: usize,
552 ) -> *mut mnl_nlmsg_batch;
553 pub fn mnl_nlmsg_batch_next(b: *mut mnl_nlmsg_batch) -> bool;
554 pub fn mnl_nlmsg_batch_stop(b: *mut mnl_nlmsg_batch);
555 pub fn mnl_nlmsg_batch_size(b: *mut mnl_nlmsg_batch) -> usize;
556 pub fn mnl_nlmsg_batch_reset(b: *mut mnl_nlmsg_batch);
557 pub fn mnl_nlmsg_batch_head(b: *mut mnl_nlmsg_batch) -> *mut ::core::ffi::c_void;
558 pub fn mnl_nlmsg_batch_current(b: *mut mnl_nlmsg_batch) -> *mut ::core::ffi::c_void;
559 pub fn mnl_nlmsg_batch_is_empty(b: *mut mnl_nlmsg_batch) -> bool;
560 pub fn mnl_attr_get_type(attr: *const nlattr) -> u16;
561 pub fn mnl_attr_get_len(attr: *const nlattr) -> u16;
562 pub fn mnl_attr_get_payload_len(attr: *const nlattr) -> u16;
563 pub fn mnl_attr_get_payload(attr: *const nlattr) -> *mut ::core::ffi::c_void;
564 pub fn mnl_attr_get_u8(attr: *const nlattr) -> u8;
565 pub fn mnl_attr_get_u16(attr: *const nlattr) -> u16;
566 pub fn mnl_attr_get_u32(attr: *const nlattr) -> u32;
567 pub fn mnl_attr_get_u64(attr: *const nlattr) -> u64;
568 pub fn mnl_attr_get_str(attr: *const nlattr) -> *const ::core::ffi::c_char;
569 pub fn mnl_attr_put(
570 nlh: *mut nlmsghdr,
571 type_: u16,
572 len: usize,
573 data: *const ::core::ffi::c_void,
574 );
575 pub fn mnl_attr_put_u8(nlh: *mut nlmsghdr, type_: u16, data: u8);
576 pub fn mnl_attr_put_u16(nlh: *mut nlmsghdr, type_: u16, data: u16);
577 pub fn mnl_attr_put_u32(nlh: *mut nlmsghdr, type_: u16, data: u32);
578 pub fn mnl_attr_put_u64(nlh: *mut nlmsghdr, type_: u16, data: u64);
579 pub fn mnl_attr_put_str(nlh: *mut nlmsghdr, type_: u16, data: *const ::core::ffi::c_char);
580 pub fn mnl_attr_put_strz(nlh: *mut nlmsghdr, type_: u16, data: *const ::core::ffi::c_char);
581 pub fn mnl_attr_put_check(
582 nlh: *mut nlmsghdr,
583 buflen: usize,
584 type_: u16,
585 len: usize,
586 data: *const ::core::ffi::c_void,
587 ) -> bool;
588 pub fn mnl_attr_put_u8_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u8) -> bool;
589 pub fn mnl_attr_put_u16_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u16)
590 -> bool;
591 pub fn mnl_attr_put_u32_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u32)
592 -> bool;
593 pub fn mnl_attr_put_u64_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u64)
594 -> bool;
595 pub fn mnl_attr_put_str_check(
596 nlh: *mut nlmsghdr,
597 buflen: usize,
598 type_: u16,
599 data: *const ::core::ffi::c_char,
600 ) -> bool;
601 pub fn mnl_attr_put_strz_check(
602 nlh: *mut nlmsghdr,
603 buflen: usize,
604 type_: u16,
605 data: *const ::core::ffi::c_char,
606 ) -> bool;
607 pub fn mnl_attr_nest_start(nlh: *mut nlmsghdr, type_: u16) -> *mut nlattr;
608 pub fn mnl_attr_nest_start_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16) -> *mut nlattr;
609 pub fn mnl_attr_nest_end(nlh: *mut nlmsghdr, start: *mut nlattr);
610 pub fn mnl_attr_nest_cancel(nlh: *mut nlmsghdr, start: *mut nlattr);
611 pub fn mnl_attr_type_valid(attr: *const nlattr, maxtype: u16) -> ::core::ffi::c_int;
612 pub fn mnl_attr_validate(attr: *const nlattr, type_: mnl_attr_data_type) -> ::core::ffi::c_int;
613 pub fn mnl_attr_validate2(
614 attr: *const nlattr,
615 type_: mnl_attr_data_type,
616 len: usize,
617 ) -> ::core::ffi::c_int;
618 pub fn mnl_attr_ok(attr: *const nlattr, len: ::core::ffi::c_int) -> bool;
619 pub fn mnl_attr_next(attr: *const nlattr) -> *mut nlattr;
620 pub fn mnl_attr_parse(
621 nlh: *const nlmsghdr,
622 offset: ::core::ffi::c_uint,
623 cb: mnl_attr_cb_t,
624 data: *mut ::core::ffi::c_void,
625 ) -> ::core::ffi::c_int;
626 pub fn mnl_attr_parse_nested(
627 attr: *const nlattr,
628 cb: mnl_attr_cb_t,
629 data: *mut ::core::ffi::c_void,
630 ) -> ::core::ffi::c_int;
631 pub fn mnl_attr_parse_payload(
632 payload: *const ::core::ffi::c_void,
633 payload_len: usize,
634 cb: mnl_attr_cb_t,
635 data: *mut ::core::ffi::c_void,
636 ) -> ::core::ffi::c_int;
637 pub fn mnl_cb_run(
638 buf: *const ::core::ffi::c_void,
639 numbytes: usize,
640 seq: ::core::ffi::c_uint,
641 portid: ::core::ffi::c_uint,
642 cb_data: mnl_cb_t,
643 data: *mut ::core::ffi::c_void,
644 ) -> ::core::ffi::c_int;
645 pub fn mnl_cb_run2(
646 buf: *const ::core::ffi::c_void,
647 numbytes: usize,
648 seq: ::core::ffi::c_uint,
649 portid: ::core::ffi::c_uint,
650 cb_data: mnl_cb_t,
651 data: *mut ::core::ffi::c_void,
652 cb_ctl_array: *const mnl_cb_t,
653 cb_ctl_array_len: ::core::ffi::c_uint,
654 ) -> ::core::ffi::c_int;
655}