Skip to content

Commit 69ae346

Browse files
committed
Add genetlink.h constants
1 parent 3932711 commit 69ae346

File tree

4 files changed

+104
-7
lines changed

4 files changed

+104
-7
lines changed

libc-test/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,13 @@ fn main() {
242242
}
243243
cfg.header("sys/reboot.h");
244244
if !emscripten {
245+
cfg.header("linux/netlink.h");
246+
cfg.header("linux/genetlink.h");
245247
cfg.header("linux/netfilter_ipv4.h");
246248
cfg.header("linux/fs.h");
247249
}
248250
if !musl {
249251
cfg.header("asm/mman.h");
250-
cfg.header("linux/netlink.h");
251252
cfg.header("linux/magic.h");
252253
cfg.header("linux/reboot.h");
253254
cfg.header("linux/netfilter/nf_tables.h");

src/unix/notbsd/android/mod.rs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,49 @@ pub const NLMSG_DONE: ::c_int = 0x3;
904904
pub const NLMSG_OVERRUN: ::c_int = 0x4;
905905
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
906906

907+
pub const GENL_NAMSIZ: ::c_int = 16;
908+
909+
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
910+
pub const GENL_MAX_ID: ::c_int = 1023;
911+
912+
pub const GENL_ADMIN_PERM: ::c_int = 0x01;
913+
pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
914+
pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
915+
pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
916+
pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
917+
918+
pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
919+
pub const GENL_ID_VFS_DQUOT: ::c_int = NLMSG_MIN_TYPE + 1;
920+
pub const GENL_ID_PMCRAID: ::c_int = NLMSG_MIN_TYPE + 2;
921+
922+
pub const CTRL_CMD_UNSPEC: ::c_int = 0;
923+
pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
924+
pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
925+
pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
926+
pub const CTRL_CMD_NEWOPS: ::c_int = 4;
927+
pub const CTRL_CMD_DELOPS: ::c_int = 5;
928+
pub const CTRL_CMD_GETOPS: ::c_int = 6;
929+
pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
930+
pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
931+
pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
932+
933+
pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
934+
pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
935+
pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
936+
pub const CTRL_ATTR_VERSION: ::c_int = 3;
937+
pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
938+
pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
939+
pub const CTRL_ATTR_OPS: ::c_int = 6;
940+
pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
941+
942+
pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
943+
pub const CTRL_ATTR_OP_ID: ::c_int = 1;
944+
pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
945+
946+
pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
947+
pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
948+
pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
949+
907950
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
908951
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
909952
pub const NETLINK_PKTINFO: ::c_int = 3;

src/unix/notbsd/linux/mod.rs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,65 @@ pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
12701270
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10;
12711271
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x20;
12721272

1273+
pub const NLMSG_NOOP: ::c_int = 0x1;
1274+
pub const NLMSG_ERROR: ::c_int = 0x2;
1275+
pub const NLMSG_DONE: ::c_int = 0x3;
1276+
pub const NLMSG_OVERRUN: ::c_int = 0x4;
1277+
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
1278+
1279+
pub const GENL_NAMSIZ: ::c_int = 16;
1280+
1281+
pub const GENL_MIN_ID: ::c_int = NLMSG_MIN_TYPE;
1282+
pub const GENL_MAX_ID: ::c_int = 1023;
1283+
1284+
pub const GENL_ADMIN_PERM: ::c_int = 0x01;
1285+
pub const GENL_CMD_CAP_DO: ::c_int = 0x02;
1286+
pub const GENL_CMD_CAP_DUMP: ::c_int = 0x04;
1287+
pub const GENL_CMD_CAP_HASPOL: ::c_int = 0x08;
1288+
cfg_if! {
1289+
if #[cfg(not(target_env = "musl"))] {
1290+
pub const GENL_UNS_ADMIN_PERM: ::c_int = 0x10;
1291+
} else {
1292+
}
1293+
}
1294+
1295+
pub const GENL_ID_CTRL: ::c_int = NLMSG_MIN_TYPE;
1296+
cfg_if! {
1297+
if #[cfg(not(target_env = "musl"))] {
1298+
pub const GENL_ID_VFS_DQUOT: ::c_int = NLMSG_MIN_TYPE + 1;
1299+
pub const GENL_ID_PMCRAID: ::c_int = NLMSG_MIN_TYPE + 2;
1300+
} else {
1301+
}
1302+
}
1303+
1304+
pub const CTRL_CMD_UNSPEC: ::c_int = 0;
1305+
pub const CTRL_CMD_NEWFAMILY: ::c_int = 1;
1306+
pub const CTRL_CMD_DELFAMILY: ::c_int = 2;
1307+
pub const CTRL_CMD_GETFAMILY: ::c_int = 3;
1308+
pub const CTRL_CMD_NEWOPS: ::c_int = 4;
1309+
pub const CTRL_CMD_DELOPS: ::c_int = 5;
1310+
pub const CTRL_CMD_GETOPS: ::c_int = 6;
1311+
pub const CTRL_CMD_NEWMCAST_GRP: ::c_int = 7;
1312+
pub const CTRL_CMD_DELMCAST_GRP: ::c_int = 8;
1313+
pub const CTRL_CMD_GETMCAST_GRP: ::c_int = 9;
1314+
1315+
pub const CTRL_ATTR_UNSPEC: ::c_int = 0;
1316+
pub const CTRL_ATTR_FAMILY_ID: ::c_int = 1;
1317+
pub const CTRL_ATTR_FAMILY_NAME: ::c_int = 2;
1318+
pub const CTRL_ATTR_VERSION: ::c_int = 3;
1319+
pub const CTRL_ATTR_HDRSIZE: ::c_int = 4;
1320+
pub const CTRL_ATTR_MAXATTR: ::c_int = 5;
1321+
pub const CTRL_ATTR_OPS: ::c_int = 6;
1322+
pub const CTRL_ATTR_MCAST_GROUPS: ::c_int = 7;
1323+
1324+
pub const CTRL_ATTR_OP_UNSPEC: ::c_int = 0;
1325+
pub const CTRL_ATTR_OP_ID: ::c_int = 1;
1326+
pub const CTRL_ATTR_OP_FLAGS: ::c_int = 2;
1327+
1328+
pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
1329+
pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
1330+
pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
1331+
12731332
f! {
12741333
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
12751334
for slot in cpuset.bits.iter_mut() {

src/unix/notbsd/linux/other/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,6 @@ pub const NLM_F_EXCL: ::c_int = 0x200;
555555
pub const NLM_F_CREATE: ::c_int = 0x400;
556556
pub const NLM_F_APPEND: ::c_int = 0x800;
557557

558-
pub const NLMSG_NOOP: ::c_int = 0x1;
559-
pub const NLMSG_ERROR: ::c_int = 0x2;
560-
pub const NLMSG_DONE: ::c_int = 0x3;
561-
pub const NLMSG_OVERRUN: ::c_int = 0x4;
562-
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
563-
564558
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
565559
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
566560
pub const NETLINK_PKTINFO: ::c_int = 3;

0 commit comments

Comments
 (0)