Skip to content

Commit 96d6f06

Browse files
committed
linux: add missing netfilter definitions
Fill in missing constants available as of Linux v5.18. The relevant UAPI headers are - nfnetlink.h - nfnetlink_log.h - nfnetlink_queue.h
1 parent d9eb957 commit 96d6f06

File tree

1 file changed

+22
-1
lines changed
  • src/unix/linux_like/linux

1 file changed

+22
-1
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,7 @@ pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5;
20862086
pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6;
20872087
pub const NFNLGRP_NFTABLES: ::c_int = 7;
20882088
pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8;
2089+
pub const NFNLGRP_NFTRACE: ::c_int = 9;
20892090

20902091
pub const NFNETLINK_V0: ::c_int = 0;
20912092

@@ -2102,14 +2103,29 @@ pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9;
21022103
pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10;
21032104
pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11;
21042105
pub const NFNL_SUBSYS_COUNT: ::c_int = 12;
2106+
/*
2107+
FIXME: These are not yet available in musl sanitized kernel headers and
2108+
make the tests fail. Enable them once musl has them.
2109+
2110+
See https://github.com/rust-lang/libc/pull/1628 for more details.
2111+
pub const NFNL_SUBSYS_HOOK: ::c_int = 12;
2112+
pub const NFNL_SUBSYS_COUNT: ::c_int = 13;
2113+
*/
21052114

21062115
pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE;
21072116
pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1;
21082117

2118+
pub const NFNL_BATCH_UNSPEC: ::c_int = 0;
2119+
pub const NFNL_BATCH_GENID: ::c_int = 1;
2120+
21092121
// linux/netfilter/nfnetlink_log.h
21102122
pub const NFULNL_MSG_PACKET: ::c_int = 0;
21112123
pub const NFULNL_MSG_CONFIG: ::c_int = 1;
21122124

2125+
pub const NFULA_VLAN_UNSPEC: ::c_int = 0;
2126+
pub const NFULA_VLAN_PROTO: ::c_int = 1;
2127+
pub const NFULA_VLAN_TCI: ::c_int = 2;
2128+
21132129
pub const NFULA_UNSPEC: ::c_int = 0;
21142130
pub const NFULA_PACKET_HDR: ::c_int = 1;
21152131
pub const NFULA_MARK: ::c_int = 2;
@@ -2130,6 +2146,8 @@ pub const NFULA_HWHEADER: ::c_int = 16;
21302146
pub const NFULA_HWLEN: ::c_int = 17;
21312147
pub const NFULA_CT: ::c_int = 18;
21322148
pub const NFULA_CT_INFO: ::c_int = 19;
2149+
pub const NFULA_VLAN: ::c_int = 20;
2150+
pub const NFULA_L2HDR: ::c_int = 21;
21332151

21342152
pub const NFULNL_CFG_CMD_NONE: ::c_int = 0;
21352153
pub const NFULNL_CFG_CMD_BIND: ::c_int = 1;
@@ -2153,7 +2171,7 @@ pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001;
21532171
pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002;
21542172
pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004;
21552173

2156-
// linux/netfilter/nfnetlink_log.h
2174+
// linux/netfilter/nfnetlink_queue.h
21572175
pub const NFQNL_MSG_PACKET: ::c_int = 0;
21582176
pub const NFQNL_MSG_VERDICT: ::c_int = 1;
21592177
pub const NFQNL_MSG_CONFIG: ::c_int = 2;
@@ -2185,6 +2203,7 @@ pub const NFQA_SECCTX: ::c_int = 18;
21852203
See https://github.com/rust-lang/libc/pull/1628 for more details.
21862204
pub const NFQA_VLAN: ::c_int = 19;
21872205
pub const NFQA_L2HDR: ::c_int = 20;
2206+
pub const NFQA_PRIORITY: ::c_int = 21;
21882207
21892208
pub const NFQA_VLAN_UNSPEC: ::c_int = 0;
21902209
pub const NFQA_VLAN_PROTO: ::c_int = 1;
@@ -2219,6 +2238,8 @@ pub const NFQA_SKB_CSUMNOTREADY: ::c_int = 0x0001;
22192238
pub const NFQA_SKB_GSO: ::c_int = 0x0002;
22202239
pub const NFQA_SKB_CSUM_NOTVERIFIED: ::c_int = 0x0004;
22212240

2241+
// linux/genetlink.h
2242+
22222243
pub const GENL_NAMSIZ: ::c_int = 16;
22232244

22242245
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;

0 commit comments

Comments
 (0)