Skip to content

Commit 2216488

Browse files
committed
nfnetlink & nfnetlink_log constants
First batch for #1562
1 parent fcd94cc commit 2216488

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,8 @@ fn test_android(target: &str) {
12531253
"linux/memfd.h",
12541254
"linux/module.h",
12551255
"linux/net_tstamp.h",
1256+
"linux/netfilter/nfnetlink.h",
1257+
"linux/netfilter/nfnetlink_log.h",
12561258
"linux/netfilter/nf_tables.h",
12571259
"linux/netfilter_ipv4.h",
12581260
"linux/netfilter_ipv6.h",
@@ -2196,6 +2198,8 @@ fn test_linux(target: &str) {
21962198
"linux/memfd.h",
21972199
"linux/module.h",
21982200
"linux/net_tstamp.h",
2201+
"linux/netfilter/nfnetlink.h",
2202+
"linux/netfilter/nfnetlink_log.h",
21992203
"linux/netfilter/nf_tables.h",
22002204
"linux/netfilter_ipv4.h",
22012205
"linux/netfilter_ipv6.h",

src/unix/linux_like/android/mod.rs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,87 @@ pub const NLMSG_DONE: ::c_int = 0x3;
13091309
pub const NLMSG_OVERRUN: ::c_int = 0x4;
13101310
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
13111311

1312+
// linux/netfilter/nfnetlink.h
1313+
pub const NFNLGRP_NONE: ::c_int = 0;
1314+
pub const NFNLGRP_CONNTRACK_NEW: ::c_int = 1;
1315+
pub const NFNLGRP_CONNTRACK_UPDATE: ::c_int = 2;
1316+
pub const NFNLGRP_CONNTRACK_DESTROY: ::c_int = 3;
1317+
pub const NFNLGRP_CONNTRACK_EXP_NEW: ::c_int = 4;
1318+
pub const NFNLGRP_CONNTRACK_EXP_UPDATE: ::c_int = 5;
1319+
pub const NFNLGRP_CONNTRACK_EXP_DESTROY: ::c_int = 6;
1320+
pub const NFNLGRP_NFTABLES: ::c_int = 7;
1321+
pub const NFNLGRP_ACCT_QUOTA: ::c_int = 8;
1322+
pub const NFNLGRP_NFTRACE: ::c_int = 9;
1323+
1324+
pub const NFNETLINK_V0: ::c_int = 0;
1325+
1326+
pub const NFNL_SUBSYS_NONE: ::c_int = 0;
1327+
pub const NFNL_SUBSYS_CTNETLINK: ::c_int = 1;
1328+
pub const NFNL_SUBSYS_CTNETLINK_EXP: ::c_int = 2;
1329+
pub const NFNL_SUBSYS_QUEUE: ::c_int = 3;
1330+
pub const NFNL_SUBSYS_ULOG: ::c_int = 4;
1331+
pub const NFNL_SUBSYS_OSF: ::c_int = 5;
1332+
pub const NFNL_SUBSYS_IPSET: ::c_int = 6;
1333+
pub const NFNL_SUBSYS_ACCT: ::c_int = 7;
1334+
pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: ::c_int = 8;
1335+
pub const NFNL_SUBSYS_CTHELPER: ::c_int = 9;
1336+
pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10;
1337+
pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11;
1338+
pub const NFNL_SUBSYS_COUNT: ::c_int = 12;
1339+
1340+
pub const NFNL_BATCH_UNSPEC: ::c_int = 0;
1341+
pub const NFNL_BATCH_GENID: ::c_int = 1;
1342+
1343+
pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE;
1344+
pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1;
1345+
1346+
// linux/netfilter/nfnetlink_log.h
1347+
pub const NFULNL_MSG_PACKET: ::c_int = 0;
1348+
pub const NFULNL_MSG_CONFIG: ::c_int = 1;
1349+
1350+
pub const NFULA_UNSPEC: ::c_int = 0;
1351+
pub const NFULA_PACKET_HDR: ::c_int = 1;
1352+
pub const NFULA_MARK: ::c_int = 2;
1353+
pub const NFULA_TIMESTAMP: ::c_int = 3;
1354+
pub const NFULA_IFINDEX_INDEV: ::c_int = 4;
1355+
pub const NFULA_IFINDEX_OUTDEV: ::c_int = 5;
1356+
pub const NFULA_IFINDEX_PHYSINDEV: ::c_int = 6;
1357+
pub const NFULA_IFINDEX_PHYSOUTDEV: ::c_int = 7;
1358+
pub const NFULA_HWADDR: ::c_int = 8;
1359+
pub const NFULA_PAYLOAD: ::c_int = 9;
1360+
pub const NFULA_PREFIX: ::c_int = 10;
1361+
pub const NFULA_UID: ::c_int = 11;
1362+
pub const NFULA_SEQ: ::c_int = 12;
1363+
pub const NFULA_SEQ_GLOBAL: ::c_int = 13;
1364+
pub const NFULA_GID: ::c_int = 14;
1365+
pub const NFULA_HWTYPE: ::c_int = 15;
1366+
pub const NFULA_HWHEADER: ::c_int = 16;
1367+
pub const NFULA_HWLEN: ::c_int = 17;
1368+
pub const NFULA_CT: ::c_int = 18;
1369+
pub const NFULA_CT_INFO: ::c_int = 19;
1370+
1371+
pub const NFULNL_CFG_CMD_NONE: ::c_int = 0;
1372+
pub const NFULNL_CFG_CMD_BIND: ::c_int = 1;
1373+
pub const NFULNL_CFG_CMD_UNBIND: ::c_int = 2;
1374+
pub const NFULNL_CFG_CMD_PF_BIND: ::c_int = 3;
1375+
pub const NFULNL_CFG_CMD_PF_UNBIND: ::c_int = 4;
1376+
1377+
pub const NFULA_CFG_UNSPEC: ::c_int = 0;
1378+
pub const NFULA_CFG_CMD: ::c_int = 1;
1379+
pub const NFULA_CFG_MODE: ::c_int = 2;
1380+
pub const NFULA_CFG_NLBUFSIZ: ::c_int = 3;
1381+
pub const NFULA_CFG_TIMEOUT: ::c_int = 4;
1382+
pub const NFULA_CFG_QTHRESH: ::c_int = 5;
1383+
pub const NFULA_CFG_FLAGS: ::c_int = 6;
1384+
1385+
pub const NFULNL_COPY_NONE: ::c_int = 0x00;
1386+
pub const NFULNL_COPY_META: ::c_int = 0x01;
1387+
pub const NFULNL_COPY_PACKET: ::c_int = 0x02;
1388+
1389+
pub const NFULNL_CFG_F_SEQ: ::c_int = 0x0001;
1390+
pub const NFULNL_CFG_F_SEQ_GLOBAL: ::c_int = 0x0002;
1391+
pub const NFULNL_CFG_F_CONNTRACK: ::c_int = 0x0004;
1392+
13121393
pub const GENL_NAMSIZ: ::c_int = 16;
13131394

13141395
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;

src/unix/linux_like/linux/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,12 @@ pub const NFNL_SUBSYS_NFTABLES: ::c_int = 10;
16921692
pub const NFNL_SUBSYS_NFT_COMPAT: ::c_int = 11;
16931693
pub const NFNL_SUBSYS_COUNT: ::c_int = 12;
16941694

1695+
pub const NFNL_BATCH_UNSPEC: ::c_int = 0;
1696+
pub const NFNL_BATCH_GENID: ::c_int = 1;
1697+
1698+
pub const NFNL_MSG_BATCH_BEGIN: ::c_int = NLMSG_MIN_TYPE;
1699+
pub const NFNL_MSG_BATCH_END: ::c_int = NLMSG_MIN_TYPE + 1;
1700+
16951701
// linux/netfilter/nfnetlink_log.h
16961702
pub const NFULNL_MSG_PACKET: ::c_int = 0;
16971703
pub const NFULNL_MSG_CONFIG: ::c_int = 1;

0 commit comments

Comments
 (0)