Skip to content

Commit e3d05ca

Browse files
authored
Auto merge of rust-lang#400 - mrjana:netlink, r=alexcrichton
Add netlink constants Add netlink constants from linux/netlink.h Signed-off-by: Jana Radhakrishnan <[email protected]>
2 parents e183f93 + 85be843 commit e3d05ca

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,65 @@ pub const ICANON: ::tcflag_t = 0x00000002;
580580
pub const PENDIN: ::tcflag_t = 0x00004000;
581581
pub const NOFLSH: ::tcflag_t = 0x00000080;
582582

583+
pub const NETLINK_ROUTE: ::c_int = 0;
584+
pub const NETLINK_UNUSED: ::c_int = 1;
585+
pub const NETLINK_USERSOCK: ::c_int = 2;
586+
pub const NETLINK_FIREWALL: ::c_int = 3;
587+
pub const NETLINK_SOCK_DIAG: ::c_int = 4;
588+
pub const NETLINK_NFLOG: ::c_int = 5;
589+
pub const NETLINK_XFRM: ::c_int = 6;
590+
pub const NETLINK_SELINUX: ::c_int = 7;
591+
pub const NETLINK_ISCSI: ::c_int = 8;
592+
pub const NETLINK_AUDIT: ::c_int = 9;
593+
pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
594+
pub const NETLINK_CONNECTOR: ::c_int = 11;
595+
pub const NETLINK_NETFILTER: ::c_int = 12;
596+
pub const NETLINK_IP6_FW: ::c_int = 13;
597+
pub const NETLINK_DNRTMSG: ::c_int = 14;
598+
pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
599+
pub const NETLINK_GENERIC: ::c_int = 16;
600+
pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
601+
pub const NETLINK_ECRYPTFS: ::c_int = 19;
602+
pub const NETLINK_RDMA: ::c_int = 20;
603+
pub const NETLINK_CRYPTO: ::c_int = 21;
604+
pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
605+
606+
pub const MAX_LINKS: ::c_int = 32;
607+
608+
pub const NLM_F_REQUEST: ::c_int = 1;
609+
pub const NLM_F_MULTI: ::c_int = 2;
610+
pub const NLM_F_ACK: ::c_int = 4;
611+
pub const NLM_F_ECHO: ::c_int = 8;
612+
pub const NLM_F_DUMP_INTR: ::c_int = 16;
613+
614+
pub const NLM_F_ROOT: ::c_int = 0x100;
615+
pub const NLM_F_MATCH: ::c_int = 0x200;
616+
pub const NLM_F_ATOMIC: ::c_int = 0x400;
617+
pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
618+
619+
pub const NLM_F_REPLACE: ::c_int = 0x100;
620+
pub const NLM_F_EXCL: ::c_int = 0x200;
621+
pub const NLM_F_CREATE: ::c_int = 0x400;
622+
pub const NLM_F_APPEND: ::c_int = 0x800;
623+
624+
pub const NLMSG_NOOP: ::c_int = 0x1;
625+
pub const NLMSG_ERROR: ::c_int = 0x2;
626+
pub const NLMSG_DONE: ::c_int = 0x3;
627+
pub const NLMSG_OVERRUN: ::c_int = 0x4;
628+
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
629+
630+
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
631+
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
632+
pub const NETLINK_PKTINFO: ::c_int = 3;
633+
pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
634+
pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
635+
pub const NETLINK_RX_RING: ::c_int = 6;
636+
pub const NETLINK_TX_RING: ::c_int = 7;
637+
638+
pub const NLA_F_NESTED: ::c_int = 1 << 15;
639+
pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
640+
pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
641+
583642
f! {
584643
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
585644
*set = 0;

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,69 @@ pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
485485
pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
486486
pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
487487

488+
pub const NETLINK_ROUTE: ::c_int = 0;
489+
pub const NETLINK_UNUSED: ::c_int = 1;
490+
pub const NETLINK_USERSOCK: ::c_int = 2;
491+
pub const NETLINK_FIREWALL: ::c_int = 3;
492+
pub const NETLINK_SOCK_DIAG: ::c_int = 4;
493+
pub const NETLINK_NFLOG: ::c_int = 5;
494+
pub const NETLINK_XFRM: ::c_int = 6;
495+
pub const NETLINK_SELINUX: ::c_int = 7;
496+
pub const NETLINK_ISCSI: ::c_int = 8;
497+
pub const NETLINK_AUDIT: ::c_int = 9;
498+
pub const NETLINK_FIB_LOOKUP: ::c_int = 10;
499+
pub const NETLINK_CONNECTOR: ::c_int = 11;
500+
pub const NETLINK_NETFILTER: ::c_int = 12;
501+
pub const NETLINK_IP6_FW: ::c_int = 13;
502+
pub const NETLINK_DNRTMSG: ::c_int = 14;
503+
pub const NETLINK_KOBJECT_UEVENT: ::c_int = 15;
504+
pub const NETLINK_GENERIC: ::c_int = 16;
505+
pub const NETLINK_SCSITRANSPORT: ::c_int = 18;
506+
pub const NETLINK_ECRYPTFS: ::c_int = 19;
507+
pub const NETLINK_RDMA: ::c_int = 20;
508+
pub const NETLINK_CRYPTO: ::c_int = 21;
509+
pub const NETLINK_INET_DIAG: ::c_int = NETLINK_SOCK_DIAG;
510+
511+
pub const MAX_LINKS: ::c_int = 32;
512+
513+
pub const NLM_F_REQUEST: ::c_int = 1;
514+
pub const NLM_F_MULTI: ::c_int = 2;
515+
pub const NLM_F_ACK: ::c_int = 4;
516+
pub const NLM_F_ECHO: ::c_int = 8;
517+
pub const NLM_F_DUMP_INTR: ::c_int = 16;
518+
pub const NLM_F_DUMP_FILTERED: ::c_int = 32;
519+
520+
pub const NLM_F_ROOT: ::c_int = 0x100;
521+
pub const NLM_F_MATCH: ::c_int = 0x200;
522+
pub const NLM_F_ATOMIC: ::c_int = 0x400;
523+
pub const NLM_F_DUMP: ::c_int = NLM_F_ROOT | NLM_F_MATCH;
524+
525+
pub const NLM_F_REPLACE: ::c_int = 0x100;
526+
pub const NLM_F_EXCL: ::c_int = 0x200;
527+
pub const NLM_F_CREATE: ::c_int = 0x400;
528+
pub const NLM_F_APPEND: ::c_int = 0x800;
529+
530+
pub const NLMSG_NOOP: ::c_int = 0x1;
531+
pub const NLMSG_ERROR: ::c_int = 0x2;
532+
pub const NLMSG_DONE: ::c_int = 0x3;
533+
pub const NLMSG_OVERRUN: ::c_int = 0x4;
534+
pub const NLMSG_MIN_TYPE: ::c_int = 0x10;
535+
536+
pub const NETLINK_ADD_MEMBERSHIP: ::c_int = 1;
537+
pub const NETLINK_DROP_MEMBERSHIP: ::c_int = 2;
538+
pub const NETLINK_PKTINFO: ::c_int = 3;
539+
pub const NETLINK_BROADCAST_ERROR: ::c_int = 4;
540+
pub const NETLINK_NO_ENOBUFS: ::c_int = 5;
541+
pub const NETLINK_RX_RING: ::c_int = 6;
542+
pub const NETLINK_TX_RING: ::c_int = 7;
543+
pub const NETLINK_LISTEN_ALL_NSID: ::c_int = 8;
544+
pub const NETLINK_LIST_MEMBERSHIPS: ::c_int = 9;
545+
pub const NETLINK_CAP_ACK: ::c_int = 10;
546+
547+
pub const NLA_F_NESTED: ::c_int = 1 << 15;
548+
pub const NLA_F_NET_BYTEORDER: ::c_int = 1 << 14;
549+
pub const NLA_TYPE_MASK: ::c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER);
550+
488551
cfg_if! {
489552
if #[cfg(any(target_arch = "arm", target_arch = "x86",
490553
target_arch = "x86_64"))] {

0 commit comments

Comments
 (0)