16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2607ca46eSDavid Howells #ifndef _UAPI__LINUX_NETLINK_H 3607ca46eSDavid Howells #define _UAPI__LINUX_NETLINK_H 4607ca46eSDavid Howells 5a85cbe61SPetr Vorel #include <linux/const.h> 6607ca46eSDavid Howells #include <linux/socket.h> /* for __kernel_sa_family_t */ 7607ca46eSDavid Howells #include <linux/types.h> 8607ca46eSDavid Howells 9607ca46eSDavid Howells #define NETLINK_ROUTE 0 /* Routing/device hook */ 10607ca46eSDavid Howells #define NETLINK_UNUSED 1 /* Unused number */ 11607ca46eSDavid Howells #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ 12607ca46eSDavid Howells #define NETLINK_FIREWALL 3 /* Unused number, formerly ip_queue */ 13607ca46eSDavid Howells #define NETLINK_SOCK_DIAG 4 /* socket monitoring */ 14607ca46eSDavid Howells #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ 15607ca46eSDavid Howells #define NETLINK_XFRM 6 /* ipsec */ 16607ca46eSDavid Howells #define NETLINK_SELINUX 7 /* SELinux event notifications */ 17607ca46eSDavid Howells #define NETLINK_ISCSI 8 /* Open-iSCSI */ 18607ca46eSDavid Howells #define NETLINK_AUDIT 9 /* auditing */ 19607ca46eSDavid Howells #define NETLINK_FIB_LOOKUP 10 20607ca46eSDavid Howells #define NETLINK_CONNECTOR 11 21607ca46eSDavid Howells #define NETLINK_NETFILTER 12 /* netfilter subsystem */ 22607ca46eSDavid Howells #define NETLINK_IP6_FW 13 231202cdd6SStephen Hemminger #define NETLINK_DNRTMSG 14 /* DECnet routing messages (obsolete) */ 24607ca46eSDavid Howells #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ 25607ca46eSDavid Howells #define NETLINK_GENERIC 16 26607ca46eSDavid Howells /* leave room for NETLINK_DM (DM Events) */ 27607ca46eSDavid Howells #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ 28607ca46eSDavid Howells #define NETLINK_ECRYPTFS 19 29607ca46eSDavid Howells #define NETLINK_RDMA 20 30607ca46eSDavid Howells #define NETLINK_CRYPTO 21 /* Crypto layer */ 31f16a7dd5SUrsula Braun #define NETLINK_SMC 22 /* SMC monitoring */ 32607ca46eSDavid Howells 33607ca46eSDavid Howells #define NETLINK_INET_DIAG NETLINK_SOCK_DIAG 34607ca46eSDavid Howells 35607ca46eSDavid Howells #define MAX_LINKS 32 36607ca46eSDavid Howells 37607ca46eSDavid Howells struct sockaddr_nl { 38607ca46eSDavid Howells __kernel_sa_family_t nl_family; /* AF_NETLINK */ 39607ca46eSDavid Howells unsigned short nl_pad; /* zero */ 40607ca46eSDavid Howells __u32 nl_pid; /* port ID */ 41607ca46eSDavid Howells __u32 nl_groups; /* multicast groups mask */ 42607ca46eSDavid Howells }; 43607ca46eSDavid Howells 4430b60554SJakub Kicinski /** 4530b60554SJakub Kicinski * struct nlmsghdr - fixed format metadata header of Netlink messages 4630b60554SJakub Kicinski * @nlmsg_len: Length of message including header 4730b60554SJakub Kicinski * @nlmsg_type: Message content type 4830b60554SJakub Kicinski * @nlmsg_flags: Additional flags 4930b60554SJakub Kicinski * @nlmsg_seq: Sequence number 5030b60554SJakub Kicinski * @nlmsg_pid: Sending process port ID 5130b60554SJakub Kicinski */ 52607ca46eSDavid Howells struct nlmsghdr { 5330b60554SJakub Kicinski __u32 nlmsg_len; 5430b60554SJakub Kicinski __u16 nlmsg_type; 5530b60554SJakub Kicinski __u16 nlmsg_flags; 5630b60554SJakub Kicinski __u32 nlmsg_seq; 5730b60554SJakub Kicinski __u32 nlmsg_pid; 58607ca46eSDavid Howells }; 59607ca46eSDavid Howells 60607ca46eSDavid Howells /* Flags values */ 61607ca46eSDavid Howells 62261a0a54SJohannes Berg #define NLM_F_REQUEST 0x01 /* It is request message. */ 63261a0a54SJohannes Berg #define NLM_F_MULTI 0x02 /* Multipart message, terminated by NLMSG_DONE */ 64261a0a54SJohannes Berg #define NLM_F_ACK 0x04 /* Reply with ack, with zero or error code */ 655493a2adSJakub Kicinski #define NLM_F_ECHO 0x08 /* Receive resulting notifications */ 66261a0a54SJohannes Berg #define NLM_F_DUMP_INTR 0x10 /* Dump was inconsistent due to sequence change */ 67261a0a54SJohannes Berg #define NLM_F_DUMP_FILTERED 0x20 /* Dump was filtered as requested */ 68607ca46eSDavid Howells 69607ca46eSDavid Howells /* Modifiers to GET request */ 70607ca46eSDavid Howells #define NLM_F_ROOT 0x100 /* specify tree root */ 71607ca46eSDavid Howells #define NLM_F_MATCH 0x200 /* return all matching */ 72607ca46eSDavid Howells #define NLM_F_ATOMIC 0x400 /* atomic GET */ 73607ca46eSDavid Howells #define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH) 74607ca46eSDavid Howells 75607ca46eSDavid Howells /* Modifiers to NEW request */ 76607ca46eSDavid Howells #define NLM_F_REPLACE 0x100 /* Override existing */ 77607ca46eSDavid Howells #define NLM_F_EXCL 0x200 /* Do not touch, if it exists */ 78607ca46eSDavid Howells #define NLM_F_CREATE 0x400 /* Create, if it does not exist */ 79607ca46eSDavid Howells #define NLM_F_APPEND 0x800 /* Add to end of list */ 80607ca46eSDavid Howells 812335ba70SPablo Neira Ayuso /* Modifiers to DELETE request */ 822335ba70SPablo Neira Ayuso #define NLM_F_NONREC 0x100 /* Do not delete recursively */ 83545528d7SNikolay Aleksandrov #define NLM_F_BULK 0x200 /* Delete multiple objects */ 842335ba70SPablo Neira Ayuso 852d4bc933SJohannes Berg /* Flags for ACK message */ 862d4bc933SJohannes Berg #define NLM_F_CAPPED 0x100 /* request was capped */ 872d4bc933SJohannes Berg #define NLM_F_ACK_TLVS 0x200 /* extended ACK TVLs were included */ 882d4bc933SJohannes Berg 89607ca46eSDavid Howells /* 90607ca46eSDavid Howells 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL 91607ca46eSDavid Howells 4.4BSD CHANGE NLM_F_REPLACE 92607ca46eSDavid Howells 93607ca46eSDavid Howells True CHANGE NLM_F_CREATE|NLM_F_REPLACE 94607ca46eSDavid Howells Append NLM_F_CREATE 95607ca46eSDavid Howells Check NLM_F_EXCL 96607ca46eSDavid Howells */ 97607ca46eSDavid Howells 98607ca46eSDavid Howells #define NLMSG_ALIGNTO 4U 99607ca46eSDavid Howells #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) 100607ca46eSDavid Howells #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) 101a88b9ce5SHong zhi guo #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) 102607ca46eSDavid Howells #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) 103d409989bSChen Li #define NLMSG_DATA(nlh) ((void *)(((char *)nlh) + NLMSG_HDRLEN)) 104607ca46eSDavid Howells #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ 105d409989bSChen Li (struct nlmsghdr *)(((char *)(nlh)) + \ 106d409989bSChen Li NLMSG_ALIGN((nlh)->nlmsg_len))) 107607ca46eSDavid Howells #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ 108607ca46eSDavid Howells (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 109607ca46eSDavid Howells (nlh)->nlmsg_len <= (len)) 110607ca46eSDavid Howells #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) 111607ca46eSDavid Howells 112607ca46eSDavid Howells #define NLMSG_NOOP 0x1 /* Nothing. */ 113607ca46eSDavid Howells #define NLMSG_ERROR 0x2 /* Error */ 114607ca46eSDavid Howells #define NLMSG_DONE 0x3 /* End of a dump */ 115607ca46eSDavid Howells #define NLMSG_OVERRUN 0x4 /* Data lost */ 116607ca46eSDavid Howells 117607ca46eSDavid Howells #define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ 118607ca46eSDavid Howells 119607ca46eSDavid Howells struct nlmsgerr { 120607ca46eSDavid Howells int error; 121607ca46eSDavid Howells struct nlmsghdr msg; 1222d4bc933SJohannes Berg /* 1232d4bc933SJohannes Berg * followed by the message contents unless NETLINK_CAP_ACK was set 1242d4bc933SJohannes Berg * or the ACK indicates success (error == 0) 1252d4bc933SJohannes Berg * message length is aligned with NLMSG_ALIGN() 1262d4bc933SJohannes Berg */ 1272d4bc933SJohannes Berg /* 1282d4bc933SJohannes Berg * followed by TLVs defined in enum nlmsgerr_attrs 1292d4bc933SJohannes Berg * if NETLINK_EXT_ACK was set 1302d4bc933SJohannes Berg */ 1312d4bc933SJohannes Berg }; 1322d4bc933SJohannes Berg 1332d4bc933SJohannes Berg /** 1342d4bc933SJohannes Berg * enum nlmsgerr_attrs - nlmsgerr attributes 1352d4bc933SJohannes Berg * @NLMSGERR_ATTR_UNUSED: unused 1362d4bc933SJohannes Berg * @NLMSGERR_ATTR_MSG: error message string (string) 1372d4bc933SJohannes Berg * @NLMSGERR_ATTR_OFFS: offset of the invalid attribute in the original 1382d4bc933SJohannes Berg * message, counting from the beginning of the header (u32) 139ba0dc5f6SJohannes Berg * @NLMSGERR_ATTR_COOKIE: arbitrary subsystem specific cookie to 140ba0dc5f6SJohannes Berg * be used - in the success case - to identify a created 141ba0dc5f6SJohannes Berg * object or operation or similar (binary) 14244f3625bSJohannes Berg * @NLMSGERR_ATTR_POLICY: policy for a rejected attribute 143690252f1SJakub Kicinski * @NLMSGERR_ATTR_MISS_TYPE: type of a missing required attribute, 144690252f1SJakub Kicinski * %NLMSGERR_ATTR_MISS_NEST will not be present if the attribute was 145690252f1SJakub Kicinski * missing at the message level 146690252f1SJakub Kicinski * @NLMSGERR_ATTR_MISS_NEST: offset of the nest where attribute was missing 1472d4bc933SJohannes Berg * @__NLMSGERR_ATTR_MAX: number of attributes 1482d4bc933SJohannes Berg * @NLMSGERR_ATTR_MAX: highest attribute number 1492d4bc933SJohannes Berg */ 1502d4bc933SJohannes Berg enum nlmsgerr_attrs { 1512d4bc933SJohannes Berg NLMSGERR_ATTR_UNUSED, 1522d4bc933SJohannes Berg NLMSGERR_ATTR_MSG, 1532d4bc933SJohannes Berg NLMSGERR_ATTR_OFFS, 154ba0dc5f6SJohannes Berg NLMSGERR_ATTR_COOKIE, 15544f3625bSJohannes Berg NLMSGERR_ATTR_POLICY, 156690252f1SJakub Kicinski NLMSGERR_ATTR_MISS_TYPE, 157690252f1SJakub Kicinski NLMSGERR_ATTR_MISS_NEST, 1582d4bc933SJohannes Berg 1592d4bc933SJohannes Berg __NLMSGERR_ATTR_MAX, 1602d4bc933SJohannes Berg NLMSGERR_ATTR_MAX = __NLMSGERR_ATTR_MAX - 1 161607ca46eSDavid Howells }; 162607ca46eSDavid Howells 163607ca46eSDavid Howells #define NETLINK_ADD_MEMBERSHIP 1 164607ca46eSDavid Howells #define NETLINK_DROP_MEMBERSHIP 2 165607ca46eSDavid Howells #define NETLINK_PKTINFO 3 166607ca46eSDavid Howells #define NETLINK_BROADCAST_ERROR 4 167607ca46eSDavid Howells #define NETLINK_NO_ENOBUFS 5 168d1b4c689SFlorian Westphal #ifndef __KERNEL__ 169ccdfcc39SPatrick McHardy #define NETLINK_RX_RING 6 170ccdfcc39SPatrick McHardy #define NETLINK_TX_RING 7 171d1b4c689SFlorian Westphal #endif 17259324cf3SNicolas Dichtel #define NETLINK_LISTEN_ALL_NSID 8 173b42be38bSDavid Herrmann #define NETLINK_LIST_MEMBERSHIPS 9 1740a6a3a23SChristophe Ricard #define NETLINK_CAP_ACK 10 1752d4bc933SJohannes Berg #define NETLINK_EXT_ACK 11 176d3e8869eSJakub Kicinski #define NETLINK_GET_STRICT_CHK 12 177607ca46eSDavid Howells 178607ca46eSDavid Howells struct nl_pktinfo { 179607ca46eSDavid Howells __u32 group; 180607ca46eSDavid Howells }; 181607ca46eSDavid Howells 182ccdfcc39SPatrick McHardy struct nl_mmap_req { 183ccdfcc39SPatrick McHardy unsigned int nm_block_size; 184ccdfcc39SPatrick McHardy unsigned int nm_block_nr; 185ccdfcc39SPatrick McHardy unsigned int nm_frame_size; 186ccdfcc39SPatrick McHardy unsigned int nm_frame_nr; 187ccdfcc39SPatrick McHardy }; 188ccdfcc39SPatrick McHardy 189ccdfcc39SPatrick McHardy struct nl_mmap_hdr { 190ccdfcc39SPatrick McHardy unsigned int nm_status; 191ccdfcc39SPatrick McHardy unsigned int nm_len; 192ccdfcc39SPatrick McHardy __u32 nm_group; 193ccdfcc39SPatrick McHardy /* credentials */ 194ccdfcc39SPatrick McHardy __u32 nm_pid; 195ccdfcc39SPatrick McHardy __u32 nm_uid; 196ccdfcc39SPatrick McHardy __u32 nm_gid; 197ccdfcc39SPatrick McHardy }; 198ccdfcc39SPatrick McHardy 199d1b4c689SFlorian Westphal #ifndef __KERNEL__ 200ccdfcc39SPatrick McHardy enum nl_mmap_status { 201ccdfcc39SPatrick McHardy NL_MMAP_STATUS_UNUSED, 202ccdfcc39SPatrick McHardy NL_MMAP_STATUS_RESERVED, 203ccdfcc39SPatrick McHardy NL_MMAP_STATUS_VALID, 204ccdfcc39SPatrick McHardy NL_MMAP_STATUS_COPY, 205ccdfcc39SPatrick McHardy NL_MMAP_STATUS_SKIP, 206ccdfcc39SPatrick McHardy }; 207ccdfcc39SPatrick McHardy 208ccdfcc39SPatrick McHardy #define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO 209ccdfcc39SPatrick McHardy #define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT) 210ccdfcc39SPatrick McHardy #define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr)) 211d1b4c689SFlorian Westphal #endif 212ccdfcc39SPatrick McHardy 213607ca46eSDavid Howells #define NET_MAJOR 36 /* Major 36 is reserved for networking */ 214607ca46eSDavid Howells 215607ca46eSDavid Howells enum { 216607ca46eSDavid Howells NETLINK_UNCONNECTED = 0, 217607ca46eSDavid Howells NETLINK_CONNECTED, 218607ca46eSDavid Howells }; 219607ca46eSDavid Howells 220607ca46eSDavid Howells /* 221607ca46eSDavid Howells * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)--> 222607ca46eSDavid Howells * +---------------------+- - -+- - - - - - - - - -+- - -+ 223607ca46eSDavid Howells * | Header | Pad | Payload | Pad | 224607ca46eSDavid Howells * | (struct nlattr) | ing | | ing | 225607ca46eSDavid Howells * +---------------------+- - -+- - - - - - - - - -+- - -+ 226607ca46eSDavid Howells * <-------------- nlattr->nla_len --------------> 227607ca46eSDavid Howells */ 228607ca46eSDavid Howells 229607ca46eSDavid Howells struct nlattr { 230607ca46eSDavid Howells __u16 nla_len; 231607ca46eSDavid Howells __u16 nla_type; 232607ca46eSDavid Howells }; 233607ca46eSDavid Howells 234607ca46eSDavid Howells /* 235607ca46eSDavid Howells * nla_type (16 bits) 236607ca46eSDavid Howells * +---+---+-------------------------------+ 237607ca46eSDavid Howells * | N | O | Attribute Type | 238607ca46eSDavid Howells * +---+---+-------------------------------+ 239607ca46eSDavid Howells * N := Carries nested attributes 240607ca46eSDavid Howells * O := Payload stored in network byte order 241607ca46eSDavid Howells * 242607ca46eSDavid Howells * Note: The N and O flag are mutually exclusive. 243607ca46eSDavid Howells */ 244607ca46eSDavid Howells #define NLA_F_NESTED (1 << 15) 245607ca46eSDavid Howells #define NLA_F_NET_BYTEORDER (1 << 14) 246607ca46eSDavid Howells #define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) 247607ca46eSDavid Howells 248607ca46eSDavid Howells #define NLA_ALIGNTO 4 249607ca46eSDavid Howells #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1)) 250607ca46eSDavid Howells #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr))) 251607ca46eSDavid Howells 25264c83d83SJamal Hadi Salim /* Generic 32 bitflags attribute content sent to the kernel. 25364c83d83SJamal Hadi Salim * 25464c83d83SJamal Hadi Salim * The value is a bitmap that defines the values being set 25564c83d83SJamal Hadi Salim * The selector is a bitmask that defines which value is legit 25664c83d83SJamal Hadi Salim * 25764c83d83SJamal Hadi Salim * Examples: 25864c83d83SJamal Hadi Salim * value = 0x0, and selector = 0x1 25964c83d83SJamal Hadi Salim * implies we are selecting bit 1 and we want to set its value to 0. 26064c83d83SJamal Hadi Salim * 26164c83d83SJamal Hadi Salim * value = 0x2, and selector = 0x2 26264c83d83SJamal Hadi Salim * implies we are selecting bit 2 and we want to set its value to 1. 26364c83d83SJamal Hadi Salim * 26464c83d83SJamal Hadi Salim */ 26564c83d83SJamal Hadi Salim struct nla_bitfield32 { 26664c83d83SJamal Hadi Salim __u32 value; 26764c83d83SJamal Hadi Salim __u32 selector; 26864c83d83SJamal Hadi Salim }; 269607ca46eSDavid Howells 270d07dcf9aSJohannes Berg /* 271d07dcf9aSJohannes Berg * policy descriptions - it's specific to each family how this is used 272d07dcf9aSJohannes Berg * Normally, it should be retrieved via a dump inside another attribute 273d07dcf9aSJohannes Berg * specifying where it applies. 274d07dcf9aSJohannes Berg */ 275d07dcf9aSJohannes Berg 276d07dcf9aSJohannes Berg /** 277d07dcf9aSJohannes Berg * enum netlink_attribute_type - type of an attribute 278d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_INVALID: unused 279d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_FLAG: flag attribute (present/not present) 280d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_U8: 8-bit unsigned attribute 281d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_U16: 16-bit unsigned attribute 282d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_U32: 32-bit unsigned attribute 283d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_U64: 64-bit unsigned attribute 284d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_S8: 8-bit signed attribute 285d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_S16: 16-bit signed attribute 286d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_S32: 32-bit signed attribute 287d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_S64: 64-bit signed attribute 288d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_BINARY: binary data, min/max length may be specified 289d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_STRING: string, min/max length may be specified 290d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_NUL_STRING: NUL-terminated string, 291d07dcf9aSJohannes Berg * min/max length may be specified 292d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_NESTED: nested, i.e. the content of this attribute 293d07dcf9aSJohannes Berg * consists of sub-attributes. The nested policy and maxtype 294d07dcf9aSJohannes Berg * inside may be specified. 295d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_NESTED_ARRAY: nested array, i.e. the content of this 296d07dcf9aSJohannes Berg * attribute contains sub-attributes whose type is irrelevant 297d07dcf9aSJohannes Berg * (just used to separate the array entries) and each such array 298d07dcf9aSJohannes Berg * entry has attributes again, the policy for those inner ones 299d07dcf9aSJohannes Berg * and the corresponding maxtype may be specified. 300d07dcf9aSJohannes Berg * @NL_ATTR_TYPE_BITFIELD32: &struct nla_bitfield32 attribute 301*374d345dSJakub Kicinski * @NL_ATTR_TYPE_SINT: 32-bit or 64-bit signed attribute, aligned to 4B 302*374d345dSJakub Kicinski * @NL_ATTR_TYPE_UINT: 32-bit or 64-bit unsigned attribute, aligned to 4B 303d07dcf9aSJohannes Berg */ 304d07dcf9aSJohannes Berg enum netlink_attribute_type { 305d07dcf9aSJohannes Berg NL_ATTR_TYPE_INVALID, 306d07dcf9aSJohannes Berg 307d07dcf9aSJohannes Berg NL_ATTR_TYPE_FLAG, 308d07dcf9aSJohannes Berg 309d07dcf9aSJohannes Berg NL_ATTR_TYPE_U8, 310d07dcf9aSJohannes Berg NL_ATTR_TYPE_U16, 311d07dcf9aSJohannes Berg NL_ATTR_TYPE_U32, 312d07dcf9aSJohannes Berg NL_ATTR_TYPE_U64, 313d07dcf9aSJohannes Berg 314d07dcf9aSJohannes Berg NL_ATTR_TYPE_S8, 315d07dcf9aSJohannes Berg NL_ATTR_TYPE_S16, 316d07dcf9aSJohannes Berg NL_ATTR_TYPE_S32, 317d07dcf9aSJohannes Berg NL_ATTR_TYPE_S64, 318d07dcf9aSJohannes Berg 319d07dcf9aSJohannes Berg NL_ATTR_TYPE_BINARY, 320d07dcf9aSJohannes Berg NL_ATTR_TYPE_STRING, 321d07dcf9aSJohannes Berg NL_ATTR_TYPE_NUL_STRING, 322d07dcf9aSJohannes Berg 323d07dcf9aSJohannes Berg NL_ATTR_TYPE_NESTED, 324d07dcf9aSJohannes Berg NL_ATTR_TYPE_NESTED_ARRAY, 325d07dcf9aSJohannes Berg 326d07dcf9aSJohannes Berg NL_ATTR_TYPE_BITFIELD32, 327*374d345dSJakub Kicinski 328*374d345dSJakub Kicinski NL_ATTR_TYPE_SINT, 329*374d345dSJakub Kicinski NL_ATTR_TYPE_UINT, 330d07dcf9aSJohannes Berg }; 331d07dcf9aSJohannes Berg 332d07dcf9aSJohannes Berg /** 333d07dcf9aSJohannes Berg * enum netlink_policy_type_attr - policy type attributes 334d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_UNSPEC: unused 335d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_TYPE: type of the attribute, 336d07dcf9aSJohannes Berg * &enum netlink_attribute_type (U32) 337d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_MIN_VALUE_S: minimum value for signed 338d07dcf9aSJohannes Berg * integers (S64) 339d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_MAX_VALUE_S: maximum value for signed 340d07dcf9aSJohannes Berg * integers (S64) 341d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_MIN_VALUE_U: minimum value for unsigned 342d07dcf9aSJohannes Berg * integers (U64) 343d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_MAX_VALUE_U: maximum value for unsigned 344d07dcf9aSJohannes Berg * integers (U64) 345d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_MIN_LENGTH: minimum length for binary 346d07dcf9aSJohannes Berg * attributes, no minimum if not given (U32) 347d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_MAX_LENGTH: maximum length for binary 348d07dcf9aSJohannes Berg * attributes, no maximum if not given (U32) 349d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_POLICY_IDX: sub policy for nested and 350d07dcf9aSJohannes Berg * nested array types (U32) 351d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE: maximum sub policy 352d07dcf9aSJohannes Berg * attribute for nested and nested array types, this can 353d07dcf9aSJohannes Berg * in theory be < the size of the policy pointed to by 354d07dcf9aSJohannes Berg * the index, if limited inside the nesting (U32) 355d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_BITFIELD32_MASK: valid mask for the 356d07dcf9aSJohannes Berg * bitfield32 type (U32) 357bdbb4e29SJakub Kicinski * @NL_POLICY_TYPE_ATTR_MASK: mask of valid bits for unsigned integers (U64) 358d07dcf9aSJohannes Berg * @NL_POLICY_TYPE_ATTR_PAD: pad attribute for 64-bit alignment 35930b60554SJakub Kicinski * 36030b60554SJakub Kicinski * @__NL_POLICY_TYPE_ATTR_MAX: number of attributes 36130b60554SJakub Kicinski * @NL_POLICY_TYPE_ATTR_MAX: highest attribute number 362d07dcf9aSJohannes Berg */ 363d07dcf9aSJohannes Berg enum netlink_policy_type_attr { 364d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_UNSPEC, 365d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_TYPE, 366d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MIN_VALUE_S, 367d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MAX_VALUE_S, 368d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MIN_VALUE_U, 369d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MAX_VALUE_U, 370d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MIN_LENGTH, 371d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MAX_LENGTH, 372d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_POLICY_IDX, 373d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_POLICY_MAXTYPE, 374d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_BITFIELD32_MASK, 375d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_PAD, 376bdbb4e29SJakub Kicinski NL_POLICY_TYPE_ATTR_MASK, 377d07dcf9aSJohannes Berg 378d07dcf9aSJohannes Berg /* keep last */ 379d07dcf9aSJohannes Berg __NL_POLICY_TYPE_ATTR_MAX, 380d07dcf9aSJohannes Berg NL_POLICY_TYPE_ATTR_MAX = __NL_POLICY_TYPE_ATTR_MAX - 1 381d07dcf9aSJohannes Berg }; 382d07dcf9aSJohannes Berg 383607ca46eSDavid Howells #endif /* _UAPI__LINUX_NETLINK_H */ 384