aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / libc / src / new / linux_uapi / linux / netlink.rs
| 1 | //! Header: `uapi/linux/netlink.h` |
| 2 | |
| 3 | use crate::prelude::*; |
| 4 | |
| 5 | pub const NETLINK_ROUTE: c_int = 0; |
| 6 | pub const NETLINK_UNUSED: c_int = 1; |
| 7 | pub const NETLINK_USERSOCK: c_int = 2; |
| 8 | pub const NETLINK_FIREWALL: c_int = 3; |
| 9 | pub const NETLINK_SOCK_DIAG: c_int = 4; |
| 10 | pub const NETLINK_NFLOG: c_int = 5; |
| 11 | pub const NETLINK_XFRM: c_int = 6; |
| 12 | pub const NETLINK_SELINUX: c_int = 7; |
| 13 | pub const NETLINK_ISCSI: c_int = 8; |
| 14 | pub const NETLINK_AUDIT: c_int = 9; |
| 15 | pub const NETLINK_FIB_LOOKUP: c_int = 10; |
| 16 | pub const NETLINK_CONNECTOR: c_int = 11; |
| 17 | pub const NETLINK_NETFILTER: c_int = 12; |
| 18 | pub const NETLINK_IP6_FW: c_int = 13; |
| 19 | pub const NETLINK_DNRTMSG: c_int = 14; |
| 20 | pub const NETLINK_KOBJECT_UEVENT: c_int = 15; |
| 21 | pub const NETLINK_GENERIC: c_int = 16; |
| 22 | pub const NETLINK_SCSITRANSPORT: c_int = 18; |
| 23 | pub const NETLINK_ECRYPTFS: c_int = 19; |
| 24 | pub const NETLINK_RDMA: c_int = 20; |
| 25 | pub const NETLINK_CRYPTO: c_int = 21; |
| 26 | |
| 27 | pub const NETLINK_INET_DIAG: c_int = NETLINK_SOCK_DIAG; |
| 28 | |
| 29 | pub const MAX_LINKS: c_int = 32; |
| 30 | |
| 31 | s! { |
| 32 | pub struct sockaddr_nl { |
| 33 | pub nl_family: crate::sa_family_t, |
| 34 | nl_pad: Padding<c_ushort>, |
| 35 | pub nl_pid: u32, |
| 36 | pub nl_groups: u32, |
| 37 | } |
| 38 | |
| 39 | pub struct nlmsghdr { |
| 40 | pub nlmsg_len: u32, |
| 41 | pub nlmsg_type: u16, |
| 42 | pub nlmsg_flags: u16, |
| 43 | pub nlmsg_seq: u32, |
| 44 | pub nlmsg_pid: u32, |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | pub const NLM_F_REQUEST: c_int = 1; |
| 49 | pub const NLM_F_MULTI: c_int = 2; |
| 50 | pub const NLM_F_ACK: c_int = 4; |
| 51 | pub const NLM_F_ECHO: c_int = 8; |
| 52 | pub const NLM_F_DUMP_INTR: c_int = 16; |
| 53 | pub const NLM_F_DUMP_FILTERED: c_int = 32; |
| 54 | |
| 55 | pub const NLM_F_ROOT: c_int = 0x100; |
| 56 | pub const NLM_F_MATCH: c_int = 0x200; |
| 57 | pub const NLM_F_ATOMIC: c_int = 0x400; |
| 58 | pub const NLM_F_DUMP: c_int = NLM_F_ROOT | NLM_F_MATCH; |
| 59 | |
| 60 | pub const NLM_F_REPLACE: c_int = 0x100; |
| 61 | pub const NLM_F_EXCL: c_int = 0x200; |
| 62 | pub const NLM_F_CREATE: c_int = 0x400; |
| 63 | pub const NLM_F_APPEND: c_int = 0x800; |
| 64 | |
| 65 | pub const NLM_F_NONREC: c_int = 0x100; |
| 66 | |
| 67 | pub const NLM_F_CAPPED: c_int = 0x100; |
| 68 | pub const NLM_F_ACK_TLVS: c_int = 0x200; |
| 69 | |
| 70 | pub const NLMSG_NOOP: c_int = 0x1; |
| 71 | pub const NLMSG_ERROR: c_int = 0x2; |
| 72 | pub const NLMSG_DONE: c_int = 0x3; |
| 73 | pub const NLMSG_OVERRUN: c_int = 0x4; |
| 74 | |
| 75 | pub const NLMSG_MIN_TYPE: c_int = 0x10; |
| 76 | |
| 77 | s! { |
| 78 | pub struct nlmsgerr { |
| 79 | pub error: c_int, |
| 80 | pub msg: nlmsghdr, |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | pub const NETLINK_ADD_MEMBERSHIP: c_int = 1; |
| 85 | pub const NETLINK_DROP_MEMBERSHIP: c_int = 2; |
| 86 | pub const NETLINK_PKTINFO: c_int = 3; |
| 87 | pub const NETLINK_BROADCAST_ERROR: c_int = 4; |
| 88 | pub const NETLINK_NO_ENOBUFS: c_int = 5; |
| 89 | pub const NETLINK_RX_RING: c_int = 6; |
| 90 | pub const NETLINK_TX_RING: c_int = 7; |
| 91 | pub const NETLINK_LISTEN_ALL_NSID: c_int = 8; |
| 92 | pub const NETLINK_LIST_MEMBERSHIPS: c_int = 9; |
| 93 | pub const NETLINK_CAP_ACK: c_int = 10; |
| 94 | pub const NETLINK_EXT_ACK: c_int = 11; |
| 95 | pub const NETLINK_GET_STRICT_CHK: c_int = 12; |
| 96 | |
| 97 | s! { |
| 98 | pub struct nl_pktinfo { |
| 99 | pub group: u32, |
| 100 | } |
| 101 | |
| 102 | pub struct nl_mmap_req { |
| 103 | pub nm_block_size: c_uint, |
| 104 | pub nm_block_nr: c_uint, |
| 105 | pub nm_frame_size: c_uint, |
| 106 | pub nm_frame_nr: c_uint, |
| 107 | } |
| 108 | |
| 109 | pub struct nl_mmap_hdr { |
| 110 | pub nm_status: c_uint, |
| 111 | pub nm_len: c_uint, |
| 112 | pub nm_group: u32, |
| 113 | pub nm_pid: u32, |
| 114 | pub nm_uid: u32, |
| 115 | pub nm_gid: u32, |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | s! { |
| 120 | pub struct nlattr { |
| 121 | pub nla_len: u16, |
| 122 | pub nla_type: u16, |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | pub const NLA_F_NESTED: c_int = 1 << 15; |
| 127 | pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14; |
| 128 | pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); |
| 129 | |
| 130 | pub const NLA_ALIGNTO: c_int = 4; |
| 131 | |
| 132 | f! { |
| 133 | pub unsafe fn NLA_ALIGN(len: c_int) -> c_int { |
| 134 | return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1); |
| 135 | } |
| 136 | } |