1 /****************************************************************************
2 ****************************************************************************
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.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_NETLINK_H
13 #define __LINUX_NETLINK_H
15 #include <linux/socket.h>
16 #include <linux/types.h>
18 #define NETLINK_ROUTE 0
19 #define NETLINK_UNUSED 1
20 #define NETLINK_USERSOCK 2
21 #define NETLINK_FIREWALL 3
22 #define NETLINK_INET_DIAG 4
23 #define NETLINK_NFLOG 5
24 #define NETLINK_XFRM 6
25 #define NETLINK_SELINUX 7
26 #define NETLINK_ISCSI 8
27 #define NETLINK_AUDIT 9
28 #define NETLINK_FIB_LOOKUP 10
29 #define NETLINK_CONNECTOR 11
30 #define NETLINK_NETFILTER 12
31 #define NETLINK_IP6_FW 13
32 #define NETLINK_DNRTMSG 14
33 #define NETLINK_KOBJECT_UEVENT 15
34 #define NETLINK_GENERIC 16
40 sa_family_t nl_family;
41 unsigned short nl_pad;
55 #define NLM_F_REQUEST 1
60 #define NLM_F_ROOT 0x100
61 #define NLM_F_MATCH 0x200
62 #define NLM_F_ATOMIC 0x400
63 #define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
65 #define NLM_F_REPLACE 0x100
66 #define NLM_F_EXCL 0x200
67 #define NLM_F_CREATE 0x400
68 #define NLM_F_APPEND 0x800
70 #define NLMSG_ALIGNTO 4
71 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
72 #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
73 #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
74 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
75 #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
76 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
77 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && (nlh)->nlmsg_len <= (len))
78 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
80 #define NLMSG_NOOP 0x1
81 #define NLMSG_ERROR 0x2
82 #define NLMSG_DONE 0x3
83 #define NLMSG_OVERRUN 0x4
85 #define NLMSG_MIN_TYPE 0x10
93 #define NETLINK_ADD_MEMBERSHIP 1
94 #define NETLINK_DROP_MEMBERSHIP 2
95 #define NETLINK_PKTINFO 3
105 NETLINK_UNCONNECTED = 0,
115 #define NLA_ALIGNTO 4
116 #define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
117 #define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))