nf-queue 0.1.0

A thin wrapper around libmnl for netfilter queue
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
/* automatically generated by rust-bindgen 0.72.1 */

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

type __u8 = u8;
type __u16 = u16;
type __u32 = u32;
type __be16 = u16;
type __be32 = u32;
type __be64 = u64;
type pid_t = ::core::ffi::c_int;
type socklen_t = ::core::ffi::c_uint;

pub const NETLINK_ROUTE: u32 = 0;
pub const NETLINK_UNUSED: u32 = 1;
pub const NETLINK_USERSOCK: u32 = 2;
pub const NETLINK_FIREWALL: u32 = 3;
pub const NETLINK_SOCK_DIAG: u32 = 4;
pub const NETLINK_NFLOG: u32 = 5;
pub const NETLINK_XFRM: u32 = 6;
pub const NETLINK_SELINUX: u32 = 7;
pub const NETLINK_ISCSI: u32 = 8;
pub const NETLINK_AUDIT: u32 = 9;
pub const NETLINK_FIB_LOOKUP: u32 = 10;
pub const NETLINK_CONNECTOR: u32 = 11;
pub const NETLINK_NETFILTER: u32 = 12;
pub const NETLINK_IP6_FW: u32 = 13;
pub const NETLINK_DNRTMSG: u32 = 14;
pub const NETLINK_KOBJECT_UEVENT: u32 = 15;
pub const NETLINK_GENERIC: u32 = 16;
pub const NETLINK_SCSITRANSPORT: u32 = 18;
pub const NETLINK_ECRYPTFS: u32 = 19;
pub const NETLINK_RDMA: u32 = 20;
pub const NETLINK_CRYPTO: u32 = 21;
pub const NETLINK_SMC: u32 = 22;
pub const NETLINK_INET_DIAG: u32 = 4;
pub const NLM_F_REQUEST: u32 = 1;
pub const NLM_F_MULTI: u32 = 2;
pub const NLM_F_ACK: u32 = 4;
pub const NLM_F_ECHO: u32 = 8;
pub const NLM_F_DUMP_INTR: u32 = 16;
pub const NLM_F_DUMP_FILTERED: u32 = 32;
pub const NLM_F_ROOT: u32 = 256;
pub const NLM_F_MATCH: u32 = 512;
pub const NLM_F_ATOMIC: u32 = 1024;
pub const NLM_F_DUMP: u32 = 768;
pub const NLM_F_REPLACE: u32 = 256;
pub const NLM_F_EXCL: u32 = 512;
pub const NLM_F_CREATE: u32 = 1024;
pub const NLM_F_APPEND: u32 = 2048;
pub const NLM_F_NONREC: u32 = 256;
pub const NLM_F_BULK: u32 = 512;
pub const NLM_F_CAPPED: u32 = 256;
pub const NLM_F_ACK_TLVS: u32 = 512;
pub const NLMSG_ALIGNTO: u32 = 4;
pub const NLMSG_HDRLEN: u32 = 16;
pub const NLMSG_NOOP: u32 = 1;
pub const NLMSG_ERROR: u32 = 2;
pub const NLMSG_DONE: u32 = 3;
pub const NLMSG_OVERRUN: u32 = 4;
pub const NLMSG_MIN_TYPE: u32 = 16;
pub const NETLINK_ADD_MEMBERSHIP: u32 = 1;
pub const NETLINK_DROP_MEMBERSHIP: u32 = 2;
pub const NETLINK_PKTINFO: u32 = 3;
pub const NETLINK_BROADCAST_ERROR: u32 = 4;
pub const NETLINK_NO_ENOBUFS: u32 = 5;
pub const NETLINK_RX_RING: u32 = 6;
pub const NETLINK_TX_RING: u32 = 7;
pub const NETLINK_LISTEN_ALL_NSID: u32 = 8;
pub const NETLINK_LIST_MEMBERSHIPS: u32 = 9;
pub const NETLINK_CAP_ACK: u32 = 10;
pub const NETLINK_EXT_ACK: u32 = 11;
pub const NETLINK_GET_STRICT_CHK: u32 = 12;
pub const NF_DROP: u32 = 0;
pub const NF_ACCEPT: u32 = 1;
pub const NF_STOLEN: u32 = 2;
pub const NF_QUEUE: u32 = 3;
pub const NF_REPEAT: u32 = 4;
pub const NF_STOP: u32 = 5;
pub const NF_MAX_VERDICT: u32 = 5;
pub const NF_VERDICT_MASK: u32 = 255;
pub const NF_VERDICT_FLAG_QUEUE_BYPASS: u32 = 32768;
pub const NF_VERDICT_QMASK: u32 = 4294901760;
pub const NF_VERDICT_QBITS: u32 = 16;
pub const NF_VERDICT_BITS: u32 = 16;
pub const NF_NETLINK_CONNTRACK_NEW: u32 = 1;
pub const NF_NETLINK_CONNTRACK_UPDATE: u32 = 2;
pub const NF_NETLINK_CONNTRACK_DESTROY: u32 = 4;
pub const NF_NETLINK_CONNTRACK_EXP_NEW: u32 = 8;
pub const NF_NETLINK_CONNTRACK_EXP_UPDATE: u32 = 16;
pub const NF_NETLINK_CONNTRACK_EXP_DESTROY: u32 = 32;
pub const NFNL_NFA_NEST: u32 = 32768;
pub const NFA_ALIGNTO: u32 = 4;
pub const NFNLGRP_NONE: u32 = 0;
pub const NFNLGRP_CONNTRACK_NEW: u32 = 1;
pub const NFNLGRP_CONNTRACK_UPDATE: u32 = 2;
pub const NFNLGRP_CONNTRACK_DESTROY: u32 = 3;
pub const NFNLGRP_CONNTRACK_EXP_NEW: u32 = 4;
pub const NFNLGRP_CONNTRACK_EXP_UPDATE: u32 = 5;
pub const NFNLGRP_CONNTRACK_EXP_DESTROY: u32 = 6;
pub const NFNLGRP_NFTABLES: u32 = 7;
pub const NFNLGRP_ACCT_QUOTA: u32 = 8;
pub const NFNLGRP_NFTRACE: u32 = 9;
pub const NFNLGRP_MAX: u32 = 9;
pub const NFNETLINK_V0: u32 = 0;
pub const NFNL_SUBSYS_NONE: u32 = 0;
pub const NFNL_SUBSYS_CTNETLINK: u32 = 1;
pub const NFNL_SUBSYS_CTNETLINK_EXP: u32 = 2;
pub const NFNL_SUBSYS_QUEUE: u32 = 3;
pub const NFNL_SUBSYS_ULOG: u32 = 4;
pub const NFNL_SUBSYS_OSF: u32 = 5;
pub const NFNL_SUBSYS_IPSET: u32 = 6;
pub const NFNL_SUBSYS_ACCT: u32 = 7;
pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: u32 = 8;
pub const NFNL_SUBSYS_CTHELPER: u32 = 9;
pub const NFNL_SUBSYS_NFTABLES: u32 = 10;
pub const NFNL_SUBSYS_NFT_COMPAT: u32 = 11;
pub const NFNL_SUBSYS_HOOK: u32 = 12;
pub const NFNL_SUBSYS_COUNT: u32 = 13;
pub const NFNL_MSG_BATCH_BEGIN: u32 = 16;
pub const NFNL_MSG_BATCH_END: u32 = 17;
pub const NFNL_BATCH_MAX: u32 = 1;
pub const CTA_NAT: u32 = 6;
pub const CTA_MAX: u32 = 26;
pub const CTA_TUPLE_MAX: u32 = 3;
pub const CTA_IP_MAX: u32 = 4;
pub const CTA_PROTO_MAX: u32 = 9;
pub const CTA_PROTOINFO_MAX: u32 = 3;
pub const CTA_PROTOINFO_TCP_MAX: u32 = 5;
pub const CTA_PROTOINFO_DCCP_MAX: u32 = 4;
pub const CTA_PROTOINFO_SCTP_MAX: u32 = 3;
pub const CTA_COUNTERS_MAX: u32 = 5;
pub const CTA_TIMESTAMP_MAX: u32 = 3;
pub const CTA_NAT_MINIP: u32 = 1;
pub const CTA_NAT_MAXIP: u32 = 2;
pub const CTA_NAT_MAX: u32 = 5;
pub const CTA_PROTONAT_MAX: u32 = 2;
pub const CTA_SEQADJ_MAX: u32 = 3;
pub const CTA_NAT_SEQ_MAX: u32 = 3;
pub const CTA_SYNPROXY_MAX: u32 = 3;
pub const CTA_EXPECT_MAX: u32 = 11;
pub const CTA_EXPECT_NAT_MAX: u32 = 2;
pub const CTA_HELP_MAX: u32 = 2;
pub const CTA_SECCTX_MAX: u32 = 1;
pub const CTA_STATS_MAX: u32 = 15;
pub const CTA_STATS_GLOBAL_MAX: u32 = 2;
pub const CTA_STATS_EXP_MAX: u32 = 3;
pub const CTA_FILTER_MAX: u32 = 2;
pub const NFQA_VLAN_MAX: u32 = 2;
pub const NFQA_MAX: u32 = 22;
pub const NFQA_CFG_MAX: u32 = 5;
pub const NFQA_CFG_F_FAIL_OPEN: u32 = 1;
pub const NFQA_CFG_F_CONNTRACK: u32 = 2;
pub const NFQA_CFG_F_GSO: u32 = 4;
pub const NFQA_CFG_F_UID_GID: u32 = 8;
pub const NFQA_CFG_F_SECCTX: u32 = 16;
pub const NFQA_CFG_F_MAX: u32 = 32;
pub const NFQA_SKB_CSUMNOTREADY: u32 = 1;
pub const NFQA_SKB_GSO: u32 = 2;
pub const NFQA_SKB_CSUM_NOTVERIFIED: u32 = 4;
pub const NFDBITS: u32 = 64;
pub const MNL_SOCKET_AUTOPID: u32 = 0;
pub const MNL_SOCKET_DUMP_SIZE: u32 = 32768;
pub const MNL_ALIGNTO: u32 = 4;
pub const MNL_NLMSG_HDRLEN: u32 = 16;
pub const MNL_ATTR_HDRLEN: u32 = 4;
pub const MNL_CB_ERROR: i32 = -1;
pub const MNL_CB_STOP: u32 = 0;
pub const MNL_CB_OK: u32 = 1;
#[repr(C)]
pub struct nlmsghdr {
    pub nlmsg_len: __u32,
    pub nlmsg_type: __u16,
    pub nlmsg_flags: __u16,
    pub nlmsg_seq: __u32,
    pub nlmsg_pid: __u32,
}
#[repr(C)]
pub struct nlattr {
    pub nla_len: __u16,
    pub nla_type: __u16,
}
#[repr(C)]
pub struct nfgenmsg {
    pub nfgen_family: __u8,
    pub version: __u8,
    pub res_id: __be16,
}
pub const CTA_UNSPEC: ctattr_type = 0;
pub const CTA_TUPLE_ORIG: ctattr_type = 1;
pub const CTA_TUPLE_REPLY: ctattr_type = 2;
pub const CTA_STATUS: ctattr_type = 3;
pub const CTA_PROTOINFO: ctattr_type = 4;
pub const CTA_HELP: ctattr_type = 5;
pub const CTA_NAT_SRC: ctattr_type = 6;
pub const CTA_TIMEOUT: ctattr_type = 7;
pub const CTA_MARK: ctattr_type = 8;
pub const CTA_COUNTERS_ORIG: ctattr_type = 9;
pub const CTA_COUNTERS_REPLY: ctattr_type = 10;
pub const CTA_USE: ctattr_type = 11;
pub const CTA_ID: ctattr_type = 12;
pub const CTA_NAT_DST: ctattr_type = 13;
pub const CTA_TUPLE_MASTER: ctattr_type = 14;
pub const CTA_SEQ_ADJ_ORIG: ctattr_type = 15;
pub const CTA_NAT_SEQ_ADJ_ORIG: ctattr_type = 15;
pub const CTA_SEQ_ADJ_REPLY: ctattr_type = 16;
pub const CTA_NAT_SEQ_ADJ_REPLY: ctattr_type = 16;
pub const CTA_SECMARK: ctattr_type = 17;
pub const CTA_ZONE: ctattr_type = 18;
pub const CTA_SECCTX: ctattr_type = 19;
pub const CTA_TIMESTAMP: ctattr_type = 20;
pub const CTA_MARK_MASK: ctattr_type = 21;
pub const CTA_LABELS: ctattr_type = 22;
pub const CTA_LABELS_MASK: ctattr_type = 23;
pub const CTA_SYNPROXY: ctattr_type = 24;
pub const CTA_FILTER: ctattr_type = 25;
pub const CTA_STATUS_MASK: ctattr_type = 26;
pub const __CTA_MAX: ctattr_type = 27;
pub type ctattr_type = ::core::ffi::c_uint;
pub const CTA_TUPLE_UNSPEC: ctattr_tuple = 0;
pub const CTA_TUPLE_IP: ctattr_tuple = 1;
pub const CTA_TUPLE_PROTO: ctattr_tuple = 2;
pub const CTA_TUPLE_ZONE: ctattr_tuple = 3;
pub const __CTA_TUPLE_MAX: ctattr_tuple = 4;
pub type ctattr_tuple = ::core::ffi::c_uint;
pub const CTA_IP_UNSPEC: ctattr_ip = 0;
pub const CTA_IP_V4_SRC: ctattr_ip = 1;
pub const CTA_IP_V4_DST: ctattr_ip = 2;
pub const CTA_IP_V6_SRC: ctattr_ip = 3;
pub const CTA_IP_V6_DST: ctattr_ip = 4;
pub const __CTA_IP_MAX: ctattr_ip = 5;
pub type ctattr_ip = ::core::ffi::c_uint;
pub const CTA_PROTO_UNSPEC: ctattr_l4proto = 0;
pub const CTA_PROTO_NUM: ctattr_l4proto = 1;
pub const CTA_PROTO_SRC_PORT: ctattr_l4proto = 2;
pub const CTA_PROTO_DST_PORT: ctattr_l4proto = 3;
pub const CTA_PROTO_ICMP_ID: ctattr_l4proto = 4;
pub const CTA_PROTO_ICMP_TYPE: ctattr_l4proto = 5;
pub const CTA_PROTO_ICMP_CODE: ctattr_l4proto = 6;
pub const CTA_PROTO_ICMPV6_ID: ctattr_l4proto = 7;
pub const CTA_PROTO_ICMPV6_TYPE: ctattr_l4proto = 8;
pub const CTA_PROTO_ICMPV6_CODE: ctattr_l4proto = 9;
pub const __CTA_PROTO_MAX: ctattr_l4proto = 10;
pub type ctattr_l4proto = ::core::ffi::c_uint;
pub const CTA_PROTOINFO_UNSPEC: ctattr_protoinfo = 0;
pub const CTA_PROTOINFO_TCP: ctattr_protoinfo = 1;
pub const CTA_PROTOINFO_DCCP: ctattr_protoinfo = 2;
pub const CTA_PROTOINFO_SCTP: ctattr_protoinfo = 3;
pub const __CTA_PROTOINFO_MAX: ctattr_protoinfo = 4;
pub type ctattr_protoinfo = ::core::ffi::c_uint;
pub const CTA_PROTOINFO_TCP_UNSPEC: ctattr_protoinfo_tcp = 0;
pub const CTA_PROTOINFO_TCP_STATE: ctattr_protoinfo_tcp = 1;
pub const CTA_PROTOINFO_TCP_WSCALE_ORIGINAL: ctattr_protoinfo_tcp = 2;
pub const CTA_PROTOINFO_TCP_WSCALE_REPLY: ctattr_protoinfo_tcp = 3;
pub const CTA_PROTOINFO_TCP_FLAGS_ORIGINAL: ctattr_protoinfo_tcp = 4;
pub const CTA_PROTOINFO_TCP_FLAGS_REPLY: ctattr_protoinfo_tcp = 5;
pub const __CTA_PROTOINFO_TCP_MAX: ctattr_protoinfo_tcp = 6;
pub type ctattr_protoinfo_tcp = ::core::ffi::c_uint;
pub const CTA_PROTOINFO_DCCP_UNSPEC: ctattr_protoinfo_dccp = 0;
pub const CTA_PROTOINFO_DCCP_STATE: ctattr_protoinfo_dccp = 1;
pub const CTA_PROTOINFO_DCCP_ROLE: ctattr_protoinfo_dccp = 2;
pub const CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ: ctattr_protoinfo_dccp = 3;
pub const CTA_PROTOINFO_DCCP_PAD: ctattr_protoinfo_dccp = 4;
pub const __CTA_PROTOINFO_DCCP_MAX: ctattr_protoinfo_dccp = 5;
pub type ctattr_protoinfo_dccp = ::core::ffi::c_uint;
pub const CTA_PROTOINFO_SCTP_UNSPEC: ctattr_protoinfo_sctp = 0;
pub const CTA_PROTOINFO_SCTP_STATE: ctattr_protoinfo_sctp = 1;
pub const CTA_PROTOINFO_SCTP_VTAG_ORIGINAL: ctattr_protoinfo_sctp = 2;
pub const CTA_PROTOINFO_SCTP_VTAG_REPLY: ctattr_protoinfo_sctp = 3;
pub const __CTA_PROTOINFO_SCTP_MAX: ctattr_protoinfo_sctp = 4;
pub type ctattr_protoinfo_sctp = ::core::ffi::c_uint;
pub const CTA_COUNTERS_UNSPEC: ctattr_counters = 0;
pub const CTA_COUNTERS_PACKETS: ctattr_counters = 1;
pub const CTA_COUNTERS_BYTES: ctattr_counters = 2;
pub const CTA_COUNTERS32_PACKETS: ctattr_counters = 3;
pub const CTA_COUNTERS32_BYTES: ctattr_counters = 4;
pub const CTA_COUNTERS_PAD: ctattr_counters = 5;
pub const __CTA_COUNTERS_MAX: ctattr_counters = 6;
pub type ctattr_counters = ::core::ffi::c_uint;
pub const CTA_TIMESTAMP_UNSPEC: ctattr_tstamp = 0;
pub const CTA_TIMESTAMP_START: ctattr_tstamp = 1;
pub const CTA_TIMESTAMP_STOP: ctattr_tstamp = 2;
pub const CTA_TIMESTAMP_PAD: ctattr_tstamp = 3;
pub const __CTA_TIMESTAMP_MAX: ctattr_tstamp = 4;
pub type ctattr_tstamp = ::core::ffi::c_uint;
pub const CTA_NAT_UNSPEC: ctattr_nat = 0;
pub const CTA_NAT_V4_MINIP: ctattr_nat = 1;
pub const CTA_NAT_V4_MAXIP: ctattr_nat = 2;
pub const CTA_NAT_PROTO: ctattr_nat = 3;
pub const CTA_NAT_V6_MINIP: ctattr_nat = 4;
pub const CTA_NAT_V6_MAXIP: ctattr_nat = 5;
pub const __CTA_NAT_MAX: ctattr_nat = 6;
pub type ctattr_nat = ::core::ffi::c_uint;
pub const CTA_PROTONAT_UNSPEC: ctattr_protonat = 0;
pub const CTA_PROTONAT_PORT_MIN: ctattr_protonat = 1;
pub const CTA_PROTONAT_PORT_MAX: ctattr_protonat = 2;
pub const __CTA_PROTONAT_MAX: ctattr_protonat = 3;
pub type ctattr_protonat = ::core::ffi::c_uint;
pub const CTA_SEQADJ_UNSPEC: ctattr_seqadj = 0;
pub const CTA_SEQADJ_CORRECTION_POS: ctattr_seqadj = 1;
pub const CTA_SEQADJ_OFFSET_BEFORE: ctattr_seqadj = 2;
pub const CTA_SEQADJ_OFFSET_AFTER: ctattr_seqadj = 3;
pub const __CTA_SEQADJ_MAX: ctattr_seqadj = 4;
pub type ctattr_seqadj = ::core::ffi::c_uint;
pub const CTA_NAT_SEQ_UNSPEC: ctattr_natseq = 0;
pub const CTA_NAT_SEQ_CORRECTION_POS: ctattr_natseq = 1;
pub const CTA_NAT_SEQ_OFFSET_BEFORE: ctattr_natseq = 2;
pub const CTA_NAT_SEQ_OFFSET_AFTER: ctattr_natseq = 3;
pub const __CTA_NAT_SEQ_MAX: ctattr_natseq = 4;
pub type ctattr_natseq = ::core::ffi::c_uint;
pub const CTA_SYNPROXY_UNSPEC: ctattr_synproxy = 0;
pub const CTA_SYNPROXY_ISN: ctattr_synproxy = 1;
pub const CTA_SYNPROXY_ITS: ctattr_synproxy = 2;
pub const CTA_SYNPROXY_TSOFF: ctattr_synproxy = 3;
pub const __CTA_SYNPROXY_MAX: ctattr_synproxy = 4;
pub type ctattr_synproxy = ::core::ffi::c_uint;
pub const CTA_EXPECT_UNSPEC: ctattr_expect = 0;
pub const CTA_EXPECT_MASTER: ctattr_expect = 1;
pub const CTA_EXPECT_TUPLE: ctattr_expect = 2;
pub const CTA_EXPECT_MASK: ctattr_expect = 3;
pub const CTA_EXPECT_TIMEOUT: ctattr_expect = 4;
pub const CTA_EXPECT_ID: ctattr_expect = 5;
pub const CTA_EXPECT_HELP_NAME: ctattr_expect = 6;
pub const CTA_EXPECT_ZONE: ctattr_expect = 7;
pub const CTA_EXPECT_FLAGS: ctattr_expect = 8;
pub const CTA_EXPECT_CLASS: ctattr_expect = 9;
pub const CTA_EXPECT_NAT: ctattr_expect = 10;
pub const CTA_EXPECT_FN: ctattr_expect = 11;
pub const __CTA_EXPECT_MAX: ctattr_expect = 12;
pub type ctattr_expect = ::core::ffi::c_uint;
pub const CTA_EXPECT_NAT_UNSPEC: ctattr_expect_nat = 0;
pub const CTA_EXPECT_NAT_DIR: ctattr_expect_nat = 1;
pub const CTA_EXPECT_NAT_TUPLE: ctattr_expect_nat = 2;
pub const __CTA_EXPECT_NAT_MAX: ctattr_expect_nat = 3;
pub type ctattr_expect_nat = ::core::ffi::c_uint;
pub const CTA_HELP_UNSPEC: ctattr_help = 0;
pub const CTA_HELP_NAME: ctattr_help = 1;
pub const CTA_HELP_INFO: ctattr_help = 2;
pub const __CTA_HELP_MAX: ctattr_help = 3;
pub type ctattr_help = ::core::ffi::c_uint;
pub const CTA_SECCTX_UNSPEC: ctattr_secctx = 0;
pub const CTA_SECCTX_NAME: ctattr_secctx = 1;
pub const __CTA_SECCTX_MAX: ctattr_secctx = 2;
pub type ctattr_secctx = ::core::ffi::c_uint;
pub const CTA_STATS_UNSPEC: ctattr_stats_cpu = 0;
pub const CTA_STATS_SEARCHED: ctattr_stats_cpu = 1;
pub const CTA_STATS_FOUND: ctattr_stats_cpu = 2;
pub const CTA_STATS_NEW: ctattr_stats_cpu = 3;
pub const CTA_STATS_INVALID: ctattr_stats_cpu = 4;
pub const CTA_STATS_IGNORE: ctattr_stats_cpu = 5;
pub const CTA_STATS_DELETE: ctattr_stats_cpu = 6;
pub const CTA_STATS_DELETE_LIST: ctattr_stats_cpu = 7;
pub const CTA_STATS_INSERT: ctattr_stats_cpu = 8;
pub const CTA_STATS_INSERT_FAILED: ctattr_stats_cpu = 9;
pub const CTA_STATS_DROP: ctattr_stats_cpu = 10;
pub const CTA_STATS_EARLY_DROP: ctattr_stats_cpu = 11;
pub const CTA_STATS_ERROR: ctattr_stats_cpu = 12;
pub const CTA_STATS_SEARCH_RESTART: ctattr_stats_cpu = 13;
pub const CTA_STATS_CLASH_RESOLVE: ctattr_stats_cpu = 14;
pub const CTA_STATS_CHAIN_TOOLONG: ctattr_stats_cpu = 15;
pub const __CTA_STATS_MAX: ctattr_stats_cpu = 16;
pub type ctattr_stats_cpu = ::core::ffi::c_uint;
pub const CTA_STATS_GLOBAL_UNSPEC: ctattr_stats_global = 0;
pub const CTA_STATS_GLOBAL_ENTRIES: ctattr_stats_global = 1;
pub const CTA_STATS_GLOBAL_MAX_ENTRIES: ctattr_stats_global = 2;
pub const __CTA_STATS_GLOBAL_MAX: ctattr_stats_global = 3;
pub type ctattr_stats_global = ::core::ffi::c_uint;
pub const CTA_STATS_EXP_UNSPEC: ctattr_expect_stats = 0;
pub const CTA_STATS_EXP_NEW: ctattr_expect_stats = 1;
pub const CTA_STATS_EXP_CREATE: ctattr_expect_stats = 2;
pub const CTA_STATS_EXP_DELETE: ctattr_expect_stats = 3;
pub const __CTA_STATS_EXP_MAX: ctattr_expect_stats = 4;
pub type ctattr_expect_stats = ::core::ffi::c_uint;
pub const CTA_FILTER_UNSPEC: ctattr_filter = 0;
pub const CTA_FILTER_ORIG_FLAGS: ctattr_filter = 1;
pub const CTA_FILTER_REPLY_FLAGS: ctattr_filter = 2;
pub const __CTA_FILTER_MAX: ctattr_filter = 3;
pub type ctattr_filter = ::core::ffi::c_uint;
pub const NFQNL_MSG_PACKET: nfqnl_msg_types = 0;
pub const NFQNL_MSG_VERDICT: nfqnl_msg_types = 1;
pub const NFQNL_MSG_CONFIG: nfqnl_msg_types = 2;
pub const NFQNL_MSG_VERDICT_BATCH: nfqnl_msg_types = 3;
pub const NFQNL_MSG_MAX: nfqnl_msg_types = 4;
pub type nfqnl_msg_types = ::core::ffi::c_uint;
#[repr(C, packed)]
pub struct nfqnl_msg_packet_hdr {
    pub packet_id: __be32,
    pub hw_protocol: __be16,
    pub hook: __u8,
}
#[repr(C)]
pub struct nfqnl_msg_packet_hw {
    pub hw_addrlen: __be16,
    pub _pad: __u16,
    pub hw_addr: [__u8; 8usize],
}
#[repr(C)]
pub struct nfqnl_msg_packet_timestamp {
    pub sec: __be64,
    pub usec: __be64,
}
pub const NFQA_VLAN_UNSPEC: nfqnl_vlan_attr = 0;
pub const NFQA_VLAN_PROTO: nfqnl_vlan_attr = 1;
pub const NFQA_VLAN_TCI: nfqnl_vlan_attr = 2;
pub const __NFQA_VLAN_MAX: nfqnl_vlan_attr = 3;
pub type nfqnl_vlan_attr = ::core::ffi::c_uint;
pub const NFQA_UNSPEC: nfqnl_attr_type = 0;
pub const NFQA_PACKET_HDR: nfqnl_attr_type = 1;
pub const NFQA_VERDICT_HDR: nfqnl_attr_type = 2;
pub const NFQA_MARK: nfqnl_attr_type = 3;
pub const NFQA_TIMESTAMP: nfqnl_attr_type = 4;
pub const NFQA_IFINDEX_INDEV: nfqnl_attr_type = 5;
pub const NFQA_IFINDEX_OUTDEV: nfqnl_attr_type = 6;
pub const NFQA_IFINDEX_PHYSINDEV: nfqnl_attr_type = 7;
pub const NFQA_IFINDEX_PHYSOUTDEV: nfqnl_attr_type = 8;
pub const NFQA_HWADDR: nfqnl_attr_type = 9;
pub const NFQA_PAYLOAD: nfqnl_attr_type = 10;
pub const NFQA_CT: nfqnl_attr_type = 11;
pub const NFQA_CT_INFO: nfqnl_attr_type = 12;
pub const NFQA_CAP_LEN: nfqnl_attr_type = 13;
pub const NFQA_SKB_INFO: nfqnl_attr_type = 14;
pub const NFQA_EXP: nfqnl_attr_type = 15;
pub const NFQA_UID: nfqnl_attr_type = 16;
pub const NFQA_GID: nfqnl_attr_type = 17;
pub const NFQA_SECCTX: nfqnl_attr_type = 18;
pub const NFQA_VLAN: nfqnl_attr_type = 19;
pub const NFQA_L2HDR: nfqnl_attr_type = 20;
pub const NFQA_PRIORITY: nfqnl_attr_type = 21;
pub const NFQA_CGROUP_CLASSID: nfqnl_attr_type = 22;
pub const __NFQA_MAX: nfqnl_attr_type = 23;
pub type nfqnl_attr_type = ::core::ffi::c_uint;
#[repr(C)]
pub struct nfqnl_msg_verdict_hdr {
    pub verdict: __be32,
    pub id: __be32,
}
pub const NFQNL_CFG_CMD_NONE: nfqnl_msg_config_cmds = 0;
pub const NFQNL_CFG_CMD_BIND: nfqnl_msg_config_cmds = 1;
pub const NFQNL_CFG_CMD_UNBIND: nfqnl_msg_config_cmds = 2;
pub const NFQNL_CFG_CMD_PF_BIND: nfqnl_msg_config_cmds = 3;
pub const NFQNL_CFG_CMD_PF_UNBIND: nfqnl_msg_config_cmds = 4;
pub type nfqnl_msg_config_cmds = ::core::ffi::c_uint;
#[repr(C)]
pub struct nfqnl_msg_config_cmd {
    pub command: __u8,
    pub _pad: __u8,
    pub pf: __be16,
}
pub const NFQNL_COPY_NONE: nfqnl_config_mode = 0;
pub const NFQNL_COPY_META: nfqnl_config_mode = 1;
pub const NFQNL_COPY_PACKET: nfqnl_config_mode = 2;
pub type nfqnl_config_mode = ::core::ffi::c_uint;
#[repr(C, packed)]
pub struct nfqnl_msg_config_params {
    pub copy_range: __be32,
    pub copy_mode: __u8,
}
pub const NFQA_CFG_UNSPEC: nfqnl_attr_config = 0;
pub const NFQA_CFG_CMD: nfqnl_attr_config = 1;
pub const NFQA_CFG_PARAMS: nfqnl_attr_config = 2;
pub const NFQA_CFG_QUEUE_MAXLEN: nfqnl_attr_config = 3;
pub const NFQA_CFG_MASK: nfqnl_attr_config = 4;
pub const NFQA_CFG_FLAGS: nfqnl_attr_config = 5;
pub const __NFQA_CFG_MAX: nfqnl_attr_config = 6;
pub type nfqnl_attr_config = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mnl_socket {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mnl_nlmsg_batch {
    _unused: [u8; 0],
}
pub const MNL_TYPE_UNSPEC: mnl_attr_data_type = 0;
pub const MNL_TYPE_U8: mnl_attr_data_type = 1;
pub const MNL_TYPE_U16: mnl_attr_data_type = 2;
pub const MNL_TYPE_U32: mnl_attr_data_type = 3;
pub const MNL_TYPE_U64: mnl_attr_data_type = 4;
pub const MNL_TYPE_STRING: mnl_attr_data_type = 5;
pub const MNL_TYPE_FLAG: mnl_attr_data_type = 6;
pub const MNL_TYPE_MSECS: mnl_attr_data_type = 7;
pub const MNL_TYPE_NESTED: mnl_attr_data_type = 8;
pub const MNL_TYPE_NESTED_COMPAT: mnl_attr_data_type = 9;
pub const MNL_TYPE_NUL_STRING: mnl_attr_data_type = 10;
pub const MNL_TYPE_BINARY: mnl_attr_data_type = 11;
pub const MNL_TYPE_MAX: mnl_attr_data_type = 12;
pub type mnl_attr_data_type = ::core::ffi::c_uint;
pub type mnl_attr_cb_t = ::core::option::Option<
    unsafe extern "C" fn(attr: *const nlattr, data: *mut ::core::ffi::c_void) -> ::core::ffi::c_int,
>;
pub type mnl_cb_t = ::core::option::Option<
    unsafe extern "C" fn(
        nlh: *const nlmsghdr,
        data: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int,
>;
unsafe extern "C" {
    pub fn mnl_socket_open(bus: ::core::ffi::c_int) -> *mut mnl_socket;
    pub fn mnl_socket_open2(bus: ::core::ffi::c_int, flags: ::core::ffi::c_int) -> *mut mnl_socket;
    pub fn mnl_socket_fdopen(fd: ::core::ffi::c_int) -> *mut mnl_socket;
    pub fn mnl_socket_bind(
        nl: *mut mnl_socket,
        groups: ::core::ffi::c_uint,
        pid: pid_t,
    ) -> ::core::ffi::c_int;
    pub fn mnl_socket_close(nl: *mut mnl_socket) -> ::core::ffi::c_int;
    pub fn mnl_socket_get_fd(nl: *const mnl_socket) -> ::core::ffi::c_int;
    pub fn mnl_socket_get_portid(nl: *const mnl_socket) -> ::core::ffi::c_uint;
    pub fn mnl_socket_sendto(
        nl: *const mnl_socket,
        req: *const ::core::ffi::c_void,
        siz: usize,
    ) -> isize;
    pub fn mnl_socket_recvfrom(
        nl: *const mnl_socket,
        buf: *mut ::core::ffi::c_void,
        siz: usize,
    ) -> isize;
    pub fn mnl_socket_setsockopt(
        nl: *const mnl_socket,
        type_: ::core::ffi::c_int,
        buf: *mut ::core::ffi::c_void,
        len: socklen_t,
    ) -> ::core::ffi::c_int;
    pub fn mnl_socket_getsockopt(
        nl: *const mnl_socket,
        type_: ::core::ffi::c_int,
        buf: *mut ::core::ffi::c_void,
        len: *mut socklen_t,
    ) -> ::core::ffi::c_int;
    pub fn mnl_nlmsg_size(len: usize) -> usize;
    pub fn mnl_nlmsg_get_payload_len(nlh: *const nlmsghdr) -> usize;
    pub fn mnl_nlmsg_put_header(buf: *mut ::core::ffi::c_void) -> *mut nlmsghdr;
    pub fn mnl_nlmsg_put_extra_header(nlh: *mut nlmsghdr, size: usize) -> *mut ::core::ffi::c_void;
    pub fn mnl_nlmsg_ok(nlh: *const nlmsghdr, len: ::core::ffi::c_int) -> bool;
    pub fn mnl_nlmsg_next(nlh: *const nlmsghdr, len: *mut ::core::ffi::c_int) -> *mut nlmsghdr;
    pub fn mnl_nlmsg_seq_ok(nlh: *const nlmsghdr, seq: ::core::ffi::c_uint) -> bool;
    pub fn mnl_nlmsg_portid_ok(nlh: *const nlmsghdr, portid: ::core::ffi::c_uint) -> bool;
    pub fn mnl_nlmsg_get_payload(nlh: *const nlmsghdr) -> *mut ::core::ffi::c_void;
    pub fn mnl_nlmsg_get_payload_offset(
        nlh: *const nlmsghdr,
        offset: usize,
    ) -> *mut ::core::ffi::c_void;
    pub fn mnl_nlmsg_get_payload_tail(nlh: *const nlmsghdr) -> *mut ::core::ffi::c_void;
    pub fn mnl_nlmsg_batch_start(
        buf: *mut ::core::ffi::c_void,
        bufsiz: usize,
    ) -> *mut mnl_nlmsg_batch;
    pub fn mnl_nlmsg_batch_next(b: *mut mnl_nlmsg_batch) -> bool;
    pub fn mnl_nlmsg_batch_stop(b: *mut mnl_nlmsg_batch);
    pub fn mnl_nlmsg_batch_size(b: *mut mnl_nlmsg_batch) -> usize;
    pub fn mnl_nlmsg_batch_reset(b: *mut mnl_nlmsg_batch);
    pub fn mnl_nlmsg_batch_head(b: *mut mnl_nlmsg_batch) -> *mut ::core::ffi::c_void;
    pub fn mnl_nlmsg_batch_current(b: *mut mnl_nlmsg_batch) -> *mut ::core::ffi::c_void;
    pub fn mnl_nlmsg_batch_is_empty(b: *mut mnl_nlmsg_batch) -> bool;
    pub fn mnl_attr_get_type(attr: *const nlattr) -> u16;
    pub fn mnl_attr_get_len(attr: *const nlattr) -> u16;
    pub fn mnl_attr_get_payload_len(attr: *const nlattr) -> u16;
    pub fn mnl_attr_get_payload(attr: *const nlattr) -> *mut ::core::ffi::c_void;
    pub fn mnl_attr_get_u8(attr: *const nlattr) -> u8;
    pub fn mnl_attr_get_u16(attr: *const nlattr) -> u16;
    pub fn mnl_attr_get_u32(attr: *const nlattr) -> u32;
    pub fn mnl_attr_get_u64(attr: *const nlattr) -> u64;
    pub fn mnl_attr_get_str(attr: *const nlattr) -> *const ::core::ffi::c_char;
    pub fn mnl_attr_put(
        nlh: *mut nlmsghdr,
        type_: u16,
        len: usize,
        data: *const ::core::ffi::c_void,
    );
    pub fn mnl_attr_put_u8(nlh: *mut nlmsghdr, type_: u16, data: u8);
    pub fn mnl_attr_put_u16(nlh: *mut nlmsghdr, type_: u16, data: u16);
    pub fn mnl_attr_put_u32(nlh: *mut nlmsghdr, type_: u16, data: u32);
    pub fn mnl_attr_put_u64(nlh: *mut nlmsghdr, type_: u16, data: u64);
    pub fn mnl_attr_put_str(nlh: *mut nlmsghdr, type_: u16, data: *const ::core::ffi::c_char);
    pub fn mnl_attr_put_strz(nlh: *mut nlmsghdr, type_: u16, data: *const ::core::ffi::c_char);
    pub fn mnl_attr_put_check(
        nlh: *mut nlmsghdr,
        buflen: usize,
        type_: u16,
        len: usize,
        data: *const ::core::ffi::c_void,
    ) -> bool;
    pub fn mnl_attr_put_u8_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u8) -> bool;
    pub fn mnl_attr_put_u16_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u16)
    -> bool;
    pub fn mnl_attr_put_u32_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u32)
    -> bool;
    pub fn mnl_attr_put_u64_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16, data: u64)
    -> bool;
    pub fn mnl_attr_put_str_check(
        nlh: *mut nlmsghdr,
        buflen: usize,
        type_: u16,
        data: *const ::core::ffi::c_char,
    ) -> bool;
    pub fn mnl_attr_put_strz_check(
        nlh: *mut nlmsghdr,
        buflen: usize,
        type_: u16,
        data: *const ::core::ffi::c_char,
    ) -> bool;
    pub fn mnl_attr_nest_start(nlh: *mut nlmsghdr, type_: u16) -> *mut nlattr;
    pub fn mnl_attr_nest_start_check(nlh: *mut nlmsghdr, buflen: usize, type_: u16) -> *mut nlattr;
    pub fn mnl_attr_nest_end(nlh: *mut nlmsghdr, start: *mut nlattr);
    pub fn mnl_attr_nest_cancel(nlh: *mut nlmsghdr, start: *mut nlattr);
    pub fn mnl_attr_type_valid(attr: *const nlattr, maxtype: u16) -> ::core::ffi::c_int;
    pub fn mnl_attr_validate(attr: *const nlattr, type_: mnl_attr_data_type) -> ::core::ffi::c_int;
    pub fn mnl_attr_validate2(
        attr: *const nlattr,
        type_: mnl_attr_data_type,
        len: usize,
    ) -> ::core::ffi::c_int;
    pub fn mnl_attr_ok(attr: *const nlattr, len: ::core::ffi::c_int) -> bool;
    pub fn mnl_attr_next(attr: *const nlattr) -> *mut nlattr;
    pub fn mnl_attr_parse(
        nlh: *const nlmsghdr,
        offset: ::core::ffi::c_uint,
        cb: mnl_attr_cb_t,
        data: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
    pub fn mnl_attr_parse_nested(
        attr: *const nlattr,
        cb: mnl_attr_cb_t,
        data: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
    pub fn mnl_attr_parse_payload(
        payload: *const ::core::ffi::c_void,
        payload_len: usize,
        cb: mnl_attr_cb_t,
        data: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
    pub fn mnl_cb_run(
        buf: *const ::core::ffi::c_void,
        numbytes: usize,
        seq: ::core::ffi::c_uint,
        portid: ::core::ffi::c_uint,
        cb_data: mnl_cb_t,
        data: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
    pub fn mnl_cb_run2(
        buf: *const ::core::ffi::c_void,
        numbytes: usize,
        seq: ::core::ffi::c_uint,
        portid: ::core::ffi::c_uint,
        cb_data: mnl_cb_t,
        data: *mut ::core::ffi::c_void,
        cb_ctl_array: *const mnl_cb_t,
        cb_ctl_array_len: ::core::ffi::c_uint,
    ) -> ::core::ffi::c_int;
}