1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI__LINUX_NETLINK_H
20 #define _UAPI__LINUX_NETLINK_H
21 #include <linux/socket.h>
22 #include <linux/types.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define NETLINK_ROUTE 0
25 #define NETLINK_UNUSED 1
26 #define NETLINK_USERSOCK 2
27 #define NETLINK_FIREWALL 3
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define NETLINK_SOCK_DIAG 4
30 #define NETLINK_NFLOG 5
31 #define NETLINK_XFRM 6
32 #define NETLINK_SELINUX 7
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #define NETLINK_ISCSI 8
35 #define NETLINK_AUDIT 9
36 #define NETLINK_FIB_LOOKUP 10
37 #define NETLINK_CONNECTOR 11
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #define NETLINK_NETFILTER 12
40 #define NETLINK_IP6_FW 13
41 #define NETLINK_DNRTMSG 14
42 #define NETLINK_KOBJECT_UEVENT 15
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 #define NETLINK_GENERIC 16
45 #define NETLINK_SCSITRANSPORT 18
46 #define NETLINK_ECRYPTFS 19
47 #define NETLINK_RDMA 20
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 #define NETLINK_CRYPTO 21
50 #define NETLINK_SOCKEV 22
51 #define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
52 #define MAX_LINKS 32
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 struct sockaddr_nl {
55  __kernel_sa_family_t nl_family;
56  unsigned short nl_pad;
57  __u32 nl_pid;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  __u32 nl_groups;
60 };
61 struct nlmsghdr {
62  __u32 nlmsg_len;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  __u16 nlmsg_type;
65  __u16 nlmsg_flags;
66  __u32 nlmsg_seq;
67  __u32 nlmsg_pid;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 };
70 #define NLM_F_REQUEST 1
71 #define NLM_F_MULTI 2
72 #define NLM_F_ACK 4
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define NLM_F_ECHO 8
75 #define NLM_F_DUMP_INTR 16
76 #define NLM_F_ROOT 0x100
77 #define NLM_F_MATCH 0x200
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define NLM_F_ATOMIC 0x400
80 #define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
81 #define NLM_F_REPLACE 0x100
82 #define NLM_F_EXCL 0x200
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define NLM_F_CREATE 0x400
85 #define NLM_F_APPEND 0x800
86 #define NLMSG_ALIGNTO 4U
87 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
90 #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN)
91 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
92 #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len),   (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
95 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) &&   (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) &&   (nlh)->nlmsg_len <= (len))
96 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
97 #define NLMSG_NOOP 0x1
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 #define NLMSG_ERROR 0x2
100 #define NLMSG_DONE 0x3
101 #define NLMSG_OVERRUN 0x4
102 #define NLMSG_MIN_TYPE 0x10
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 struct nlmsgerr {
105  int error;
106  struct nlmsghdr msg;
107 };
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 #define NETLINK_ADD_MEMBERSHIP 1
110 #define NETLINK_DROP_MEMBERSHIP 2
111 #define NETLINK_PKTINFO 3
112 #define NETLINK_BROADCAST_ERROR 4
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 #define NETLINK_NO_ENOBUFS 5
115 #define NETLINK_RX_RING 6
116 #define NETLINK_TX_RING 7
117 struct nl_pktinfo {
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  __u32 group;
120 };
121 struct nl_mmap_req {
122  unsigned int nm_block_size;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124  unsigned int nm_block_nr;
125  unsigned int nm_frame_size;
126  unsigned int nm_frame_nr;
127 };
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 struct nl_mmap_hdr {
130  unsigned int nm_status;
131  unsigned int nm_len;
132  __u32 nm_group;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134  __u32 nm_pid;
135  __u32 nm_uid;
136  __u32 nm_gid;
137 };
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 enum nl_mmap_status {
140  NL_MMAP_STATUS_UNUSED,
141  NL_MMAP_STATUS_RESERVED,
142  NL_MMAP_STATUS_VALID,
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  NL_MMAP_STATUS_COPY,
145  NL_MMAP_STATUS_SKIP,
146 };
147 #define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT)
150 #define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr))
151 #define NET_MAJOR 36
152 enum {
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  NETLINK_UNCONNECTED = 0,
155  NETLINK_CONNECTED,
156 };
157 struct nlattr {
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159  __u16 nla_len;
160  __u16 nla_type;
161 };
162 #define NLA_F_NESTED (1 << 15)
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 #define NLA_F_NET_BYTEORDER (1 << 14)
165 #define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
166 #define NLA_ALIGNTO 4
167 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
170 #endif
171 
172