diff options
Diffstat (limited to 'include/uapi/linux/netlink.h')
| -rw-r--r-- | include/uapi/linux/netlink.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h index 78d5b8a546d6..1a85940f8ab7 100644 --- a/include/uapi/linux/netlink.h +++ b/include/uapi/linux/netlink.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _UAPI__LINUX_NETLINK_H | 1 | #ifndef _UAPI__LINUX_NETLINK_H |
| 2 | #define _UAPI__LINUX_NETLINK_H | 2 | #define _UAPI__LINUX_NETLINK_H |
| 3 | 3 | ||
| 4 | #include <linux/kernel.h> | ||
| 4 | #include <linux/socket.h> /* for __kernel_sa_family_t */ | 5 | #include <linux/socket.h> /* for __kernel_sa_family_t */ |
| 5 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 6 | 7 | ||
| @@ -78,7 +79,7 @@ struct nlmsghdr { | |||
| 78 | #define NLMSG_ALIGNTO 4U | 79 | #define NLMSG_ALIGNTO 4U |
| 79 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) | 80 | #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) |
| 80 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) | 81 | #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) |
| 81 | #define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN)) | 82 | #define NLMSG_LENGTH(len) ((len) + NLMSG_HDRLEN) |
| 82 | #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) | 83 | #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) |
| 83 | #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) | 84 | #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) |
| 84 | #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ | 85 | #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ |
| @@ -105,11 +106,42 @@ struct nlmsgerr { | |||
| 105 | #define NETLINK_PKTINFO 3 | 106 | #define NETLINK_PKTINFO 3 |
| 106 | #define NETLINK_BROADCAST_ERROR 4 | 107 | #define NETLINK_BROADCAST_ERROR 4 |
| 107 | #define NETLINK_NO_ENOBUFS 5 | 108 | #define NETLINK_NO_ENOBUFS 5 |
| 109 | #define NETLINK_RX_RING 6 | ||
| 110 | #define NETLINK_TX_RING 7 | ||
| 108 | 111 | ||
| 109 | struct nl_pktinfo { | 112 | struct nl_pktinfo { |
| 110 | __u32 group; | 113 | __u32 group; |
| 111 | }; | 114 | }; |
| 112 | 115 | ||
| 116 | struct nl_mmap_req { | ||
| 117 | unsigned int nm_block_size; | ||
| 118 | unsigned int nm_block_nr; | ||
| 119 | unsigned int nm_frame_size; | ||
| 120 | unsigned int nm_frame_nr; | ||
| 121 | }; | ||
| 122 | |||
| 123 | struct nl_mmap_hdr { | ||
| 124 | unsigned int nm_status; | ||
| 125 | unsigned int nm_len; | ||
| 126 | __u32 nm_group; | ||
| 127 | /* credentials */ | ||
| 128 | __u32 nm_pid; | ||
| 129 | __u32 nm_uid; | ||
| 130 | __u32 nm_gid; | ||
| 131 | }; | ||
| 132 | |||
| 133 | enum nl_mmap_status { | ||
| 134 | NL_MMAP_STATUS_UNUSED, | ||
| 135 | NL_MMAP_STATUS_RESERVED, | ||
| 136 | NL_MMAP_STATUS_VALID, | ||
| 137 | NL_MMAP_STATUS_COPY, | ||
| 138 | NL_MMAP_STATUS_SKIP, | ||
| 139 | }; | ||
| 140 | |||
| 141 | #define NL_MMAP_MSG_ALIGNMENT NLMSG_ALIGNTO | ||
| 142 | #define NL_MMAP_MSG_ALIGN(sz) __ALIGN_KERNEL(sz, NL_MMAP_MSG_ALIGNMENT) | ||
| 143 | #define NL_MMAP_HDRLEN NL_MMAP_MSG_ALIGN(sizeof(struct nl_mmap_hdr)) | ||
| 144 | |||
| 113 | #define NET_MAJOR 36 /* Major 36 is reserved for networking */ | 145 | #define NET_MAJOR 36 /* Major 36 is reserved for networking */ |
| 114 | 146 | ||
| 115 | enum { | 147 | enum { |
