blob: 45df44fd0b085be0edd1699d338d24db5f5dba3e [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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 ***
Ben Cheng654325d2012-03-07 21:13:49 -080010 *** 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 ***
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_NETLINK_H
20#define __LINUX_NETLINK_H
Nick Kralevich45e52fa2013-09-18 17:14:02 -070021#include <linux/kernel.h>
Elliott Hughesc95eb572013-01-29 18:15:55 -080022#include <linux/socket.h>
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070024#include <linux/types.h>
Elliott Hughesc95eb572013-01-29 18:15:55 -080025#define NETLINK_ROUTE 0
26#define NETLINK_UNUSED 1
27#define NETLINK_USERSOCK 2
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070029#define NETLINK_FIREWALL 3
30#define NETLINK_SOCK_DIAG 4
Elliott Hughesc95eb572013-01-29 18:15:55 -080031#define NETLINK_NFLOG 5
32#define NETLINK_XFRM 6
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070034#define NETLINK_SELINUX 7
Elliott Hughesc95eb572013-01-29 18:15:55 -080035#define NETLINK_ISCSI 8
36#define NETLINK_AUDIT 9
37#define NETLINK_FIB_LOOKUP 10
Ben Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070039#define NETLINK_CONNECTOR 11
Elliott Hughesc95eb572013-01-29 18:15:55 -080040#define NETLINK_NETFILTER 12
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041#define NETLINK_IP6_FW 13
Elliott Hughesc95eb572013-01-29 18:15:55 -080042#define NETLINK_DNRTMSG 14
Ben Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070044#define NETLINK_KOBJECT_UEVENT 15
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080045#define NETLINK_GENERIC 16
Elliott Hughesc95eb572013-01-29 18:15:55 -080046#define NETLINK_SCSITRANSPORT 18
San Mehat91638722010-04-06 18:49:49 -070047#define NETLINK_ECRYPTFS 19
Nick Kralevich45e52fa2013-09-18 17:14:02 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ashish Sharma17ed54d2012-04-05 19:50:42 -070049#define NETLINK_RDMA 20
Nick Kralevich45e52fa2013-09-18 17:14:02 -070050#define NETLINK_CRYPTO 21
51#define NETLINK_INET_DIAG NETLINK_SOCK_DIAG
Elliott Hughesc95eb572013-01-29 18:15:55 -080052#define MAX_LINKS 32
Ben Cheng654325d2012-03-07 21:13:49 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070054struct sockaddr_nl {
55 __kernel_sa_family_t nl_family;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080056 unsigned short nl_pad;
57 __u32 nl_pid;
Nick Kralevich45e52fa2013-09-18 17:14:02 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080059 __u32 nl_groups;
60};
Ashish Sharma17ed54d2012-04-05 19:50:42 -070061struct nlmsghdr {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080062 __u32 nlmsg_len;
Nick Kralevich45e52fa2013-09-18 17:14:02 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080064 __u16 nlmsg_type;
65 __u16 nlmsg_flags;
66 __u32 nlmsg_seq;
67 __u32 nlmsg_pid;
Nick Kralevich45e52fa2013-09-18 17:14:02 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080069};
Elliott Hughesc95eb572013-01-29 18:15:55 -080070#define NLM_F_REQUEST 1
Elliott Hughesc95eb572013-01-29 18:15:55 -080071#define NLM_F_MULTI 2
72#define NLM_F_ACK 4
Ashish Sharma17ed54d2012-04-05 19:50:42 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070074#define NLM_F_ECHO 8
75#define NLM_F_DUMP_INTR 16
76#define NLM_F_ROOT 0x100
Elliott Hughesc95eb572013-01-29 18:15:55 -080077#define NLM_F_MATCH 0x200
Nick Kralevich45e52fa2013-09-18 17:14:02 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughesc95eb572013-01-29 18:15:55 -080079#define NLM_F_ATOMIC 0x400
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080080#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
Elliott Hughesc95eb572013-01-29 18:15:55 -080081#define NLM_F_REPLACE 0x100
Elliott Hughesc95eb572013-01-29 18:15:55 -080082#define NLM_F_EXCL 0x200
Nick Kralevich45e52fa2013-09-18 17:14:02 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughesc95eb572013-01-29 18:15:55 -080084#define NLM_F_CREATE 0x400
85#define NLM_F_APPEND 0x800
Ashish Sharma17ed54d2012-04-05 19:50:42 -070086#define NLMSG_ALIGNTO 4U
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080087#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
Ashish Sharma17ed54d2012-04-05 19:50:42 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -070089#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))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080092#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
Nick Kralevich45e52fa2013-09-18 17:14:02 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080094#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)))
Elliott Hughesc95eb572013-01-29 18:15:55 -080097#define NLMSG_NOOP 0x1
Nick Kralevich45e52fa2013-09-18 17:14:02 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughesc95eb572013-01-29 18:15:55 -080099#define NLMSG_ERROR 0x2
100#define NLMSG_DONE 0x3
101#define NLMSG_OVERRUN 0x4
Elliott Hughesc95eb572013-01-29 18:15:55 -0800102#define NLMSG_MIN_TYPE 0x10
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ashish Sharma17ed54d2012-04-05 19:50:42 -0700104struct nlmsgerr {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800105 int error;
106 struct nlmsghdr msg;
107};
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800109#define NETLINK_ADD_MEMBERSHIP 1
110#define NETLINK_DROP_MEMBERSHIP 2
111#define NETLINK_PKTINFO 3
San Mehat91638722010-04-06 18:49:49 -0700112#define NETLINK_BROADCAST_ERROR 4
Ben Cheng654325d2012-03-07 21:13:49 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700114#define NETLINK_NO_ENOBUFS 5
115#define NETLINK_RX_RING 6
116#define NETLINK_TX_RING 7
117struct nl_pktinfo {
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 __u32 group;
Ashish Sharma17ed54d2012-04-05 19:50:42 -0700120};
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700121struct 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 */
129struct 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 */
139enum 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))
Elliott Hughesc95eb572013-01-29 18:15:55 -0800151#define NET_MAJOR 36
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800152enum {
Ben Cheng654325d2012-03-07 21:13:49 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700154 NETLINK_UNCONNECTED = 0,
Ashish Sharma17ed54d2012-04-05 19:50:42 -0700155 NETLINK_CONNECTED,
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800156};
Ashish Sharma17ed54d2012-04-05 19:50:42 -0700157struct nlattr {
Ben Cheng654325d2012-03-07 21:13:49 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700159 __u16 nla_len;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800160 __u16 nla_type;
161};
San Mehat91638722010-04-06 18:49:49 -0700162#define NLA_F_NESTED (1 << 15)
Ben Cheng654325d2012-03-07 21:13:49 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700164#define NLA_F_NET_BYTEORDER (1 << 14)
San Mehat91638722010-04-06 18:49:49 -0700165#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800166#define NLA_ALIGNTO 4
167#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
Ben Cheng654325d2012-03-07 21:13:49 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Kralevich45e52fa2013-09-18 17:14:02 -0700169#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800170#endif