aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/asm-generic/socket.h2
-rw-r--r--include/uapi/linux/Kbuild2
-rw-r--r--include/uapi/linux/cn_proc.h10
-rw-r--r--include/uapi/linux/filter.h3
-rw-r--r--include/uapi/linux/if_ether.h3
-rw-r--r--include/uapi/linux/if_link.h4
-rw-r--r--include/uapi/linux/if_packet.h2
-rw-r--r--include/uapi/linux/neighbour.h3
-rw-r--r--include/uapi/linux/netfilter/xt_NFQUEUE.h9
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6t_frag.h4
-rw-r--r--include/uapi/linux/netlink.h34
-rw-r--r--include/uapi/linux/netlink_diag.h52
-rw-r--r--include/uapi/linux/nfc.h16
-rw-r--r--include/uapi/linux/nl80211.h117
-rw-r--r--include/uapi/linux/openvswitch.h456
-rw-r--r--include/uapi/linux/pkt_sched.h1
-rw-r--r--include/uapi/linux/sctp.h846
-rw-r--r--include/uapi/linux/snmp.h3
-rw-r--r--include/uapi/linux/tcp.h26
-rw-r--r--include/uapi/linux/vm_sockets.h23
-rw-r--r--include/uapi/linux/xfrm.h3
21 files changed, 1561 insertions, 58 deletions
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index 4ef3acbba5da..c5d2e3a1cf68 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -74,4 +74,6 @@
74 74
75#define SO_LOCK_FILTER 44 75#define SO_LOCK_FILTER 44
76 76
77#define SO_SELECT_ERR_QUEUE 45
78
77#endif /* __ASM_GENERIC_SOCKET_H */ 79#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 5c8a1d25e21c..ab5d4992e568 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -285,6 +285,7 @@ header-y += nvram.h
285header-y += omap3isp.h 285header-y += omap3isp.h
286header-y += omapfb.h 286header-y += omapfb.h
287header-y += oom.h 287header-y += oom.h
288header-y += openvswitch.h
288header-y += packet_diag.h 289header-y += packet_diag.h
289header-y += param.h 290header-y += param.h
290header-y += parport.h 291header-y += parport.h
@@ -331,6 +332,7 @@ header-y += rtnetlink.h
331header-y += scc.h 332header-y += scc.h
332header-y += sched.h 333header-y += sched.h
333header-y += screen_info.h 334header-y += screen_info.h
335header-y += sctp.h
334header-y += sdla.h 336header-y += sdla.h
335header-y += seccomp.h 337header-y += seccomp.h
336header-y += securebits.h 338header-y += securebits.h
diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
index 0d7b49973bb3..f6c271035bbd 100644
--- a/include/uapi/linux/cn_proc.h
+++ b/include/uapi/linux/cn_proc.h
@@ -56,7 +56,9 @@ struct proc_event {
56 PROC_EVENT_PTRACE = 0x00000100, 56 PROC_EVENT_PTRACE = 0x00000100,
57 PROC_EVENT_COMM = 0x00000200, 57 PROC_EVENT_COMM = 0x00000200,
58 /* "next" should be 0x00000400 */ 58 /* "next" should be 0x00000400 */
59 /* "last" is the last process event: exit */ 59 /* "last" is the last process event: exit,
60 * while "next to last" is coredumping event */
61 PROC_EVENT_COREDUMP = 0x40000000,
60 PROC_EVENT_EXIT = 0x80000000 62 PROC_EVENT_EXIT = 0x80000000
61 } what; 63 } what;
62 __u32 cpu; 64 __u32 cpu;
@@ -110,11 +112,17 @@ struct proc_event {
110 char comm[16]; 112 char comm[16];
111 } comm; 113 } comm;
112 114
115 struct coredump_proc_event {
116 __kernel_pid_t process_pid;
117 __kernel_pid_t process_tgid;
118 } coredump;
119
113 struct exit_proc_event { 120 struct exit_proc_event {
114 __kernel_pid_t process_pid; 121 __kernel_pid_t process_pid;
115 __kernel_pid_t process_tgid; 122 __kernel_pid_t process_tgid;
116 __u32 exit_code, exit_signal; 123 __u32 exit_code, exit_signal;
117 } exit; 124 } exit;
125
118 } event_data; 126 } event_data;
119}; 127};
120 128
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h
index 9cfde6941099..8eb9ccaa5b48 100644
--- a/include/uapi/linux/filter.h
+++ b/include/uapi/linux/filter.h
@@ -129,7 +129,8 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
129#define SKF_AD_ALU_XOR_X 40 129#define SKF_AD_ALU_XOR_X 40
130#define SKF_AD_VLAN_TAG 44 130#define SKF_AD_VLAN_TAG 44
131#define SKF_AD_VLAN_TAG_PRESENT 48 131#define SKF_AD_VLAN_TAG_PRESENT 48
132#define SKF_AD_MAX 52 132#define SKF_AD_PAY_OFFSET 52
133#define SKF_AD_MAX 56
133#define SKF_NET_OFF (-0x100000) 134#define SKF_NET_OFF (-0x100000)
134#define SKF_LL_OFF (-0x200000) 135#define SKF_LL_OFF (-0x200000)
135 136
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 798032d01112..ade07f1c491a 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -94,6 +94,9 @@
94#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 94#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
95#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */ 95#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
96 96
97#define ETH_P_802_3_MIN 0x0600 /* If the value in the ethernet type is less than this value
98 * then the frame is Ethernet II. Else it is 802.3 */
99
97/* 100/*
98 * Non DIX types. Won't clash for 1500 types. 101 * Non DIX types. Won't clash for 1500 types.
99 */ 102 */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index c4edfe11f1f7..e3163544f339 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -201,6 +201,7 @@ enum {
201 IFLA_INET6_MCAST, /* MC things. What of them? */ 201 IFLA_INET6_MCAST, /* MC things. What of them? */
202 IFLA_INET6_CACHEINFO, /* time values and max reasm size */ 202 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
203 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */ 203 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
204 IFLA_INET6_TOKEN, /* device token */
204 __IFLA_INET6_MAX 205 __IFLA_INET6_MAX
205}; 206};
206 207
@@ -249,6 +250,7 @@ enum {
249 IFLA_VLAN_FLAGS, 250 IFLA_VLAN_FLAGS,
250 IFLA_VLAN_EGRESS_QOS, 251 IFLA_VLAN_EGRESS_QOS,
251 IFLA_VLAN_INGRESS_QOS, 252 IFLA_VLAN_INGRESS_QOS,
253 IFLA_VLAN_PROTOCOL,
252 __IFLA_VLAN_MAX, 254 __IFLA_VLAN_MAX,
253}; 255};
254 256
@@ -295,7 +297,7 @@ enum macvlan_mode {
295enum { 297enum {
296 IFLA_VXLAN_UNSPEC, 298 IFLA_VXLAN_UNSPEC,
297 IFLA_VXLAN_ID, 299 IFLA_VXLAN_ID,
298 IFLA_VXLAN_GROUP, 300 IFLA_VXLAN_REMOTE,
299 IFLA_VXLAN_LINK, 301 IFLA_VXLAN_LINK,
300 IFLA_VXLAN_LOCAL, 302 IFLA_VXLAN_LOCAL,
301 IFLA_VXLAN_TTL, 303 IFLA_VXLAN_TTL,
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index f9a60375f0d0..8136658ea477 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -55,6 +55,8 @@ struct sockaddr_ll {
55#define PACKET_FANOUT_HASH 0 55#define PACKET_FANOUT_HASH 0
56#define PACKET_FANOUT_LB 1 56#define PACKET_FANOUT_LB 1
57#define PACKET_FANOUT_CPU 2 57#define PACKET_FANOUT_CPU 2
58#define PACKET_FANOUT_ROLLOVER 3
59#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
58#define PACKET_FANOUT_FLAG_DEFRAG 0x8000 60#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
59 61
60struct tpacket_stats { 62struct tpacket_stats {
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index adb068c53c4e..f175212420ab 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -21,6 +21,9 @@ enum {
21 NDA_CACHEINFO, 21 NDA_CACHEINFO,
22 NDA_PROBES, 22 NDA_PROBES,
23 NDA_VLAN, 23 NDA_VLAN,
24 NDA_PORT,
25 NDA_VNI,
26 NDA_IFINDEX,
24 __NDA_MAX 27 __NDA_MAX
25}; 28};
26 29
diff --git a/include/uapi/linux/netfilter/xt_NFQUEUE.h b/include/uapi/linux/netfilter/xt_NFQUEUE.h
index 9eafdbbb401c..8bb5fe657d34 100644
--- a/include/uapi/linux/netfilter/xt_NFQUEUE.h
+++ b/include/uapi/linux/netfilter/xt_NFQUEUE.h
@@ -26,4 +26,13 @@ struct xt_NFQ_info_v2 {
26 __u16 bypass; 26 __u16 bypass;
27}; 27};
28 28
29struct xt_NFQ_info_v3 {
30 __u16 queuenum;
31 __u16 queues_total;
32 __u16 flags;
33#define NFQ_FLAG_BYPASS 0x01 /* for compatibility with v2 */
34#define NFQ_FLAG_CPU_FANOUT 0x02 /* use current CPU (no hashing) */
35#define NFQ_FLAG_MASK 0x03
36};
37
29#endif /* _XT_NFQ_TARGET_H */ 38#endif /* _XT_NFQ_TARGET_H */
diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_frag.h b/include/uapi/linux/netfilter_ipv6/ip6t_frag.h
index b47f61b9e082..dfd8bc2268cf 100644
--- a/include/uapi/linux/netfilter_ipv6/ip6t_frag.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_frag.h
@@ -4,9 +4,9 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct ip6t_frag { 6struct ip6t_frag {
7 __u32 ids[2]; /* Security Parameter Index */ 7 __u32 ids[2]; /* Identification range */
8 __u32 hdrlen; /* Header Length */ 8 __u32 hdrlen; /* Header Length */
9 __u8 flags; /* */ 9 __u8 flags; /* Flags */
10 __u8 invflags; /* Inverse flags */ 10 __u8 invflags; /* Inverse flags */
11}; 11};
12 12
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
109struct nl_pktinfo { 112struct nl_pktinfo {
110 __u32 group; 113 __u32 group;
111}; 114};
112 115
116struct 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
123struct 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
133enum 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
115enum { 147enum {
diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h
new file mode 100644
index 000000000000..4e31db4eea41
--- /dev/null
+++ b/include/uapi/linux/netlink_diag.h
@@ -0,0 +1,52 @@
1#ifndef __NETLINK_DIAG_H__
2#define __NETLINK_DIAG_H__
3
4#include <linux/types.h>
5
6struct netlink_diag_req {
7 __u8 sdiag_family;
8 __u8 sdiag_protocol;
9 __u16 pad;
10 __u32 ndiag_ino;
11 __u32 ndiag_show;
12 __u32 ndiag_cookie[2];
13};
14
15struct netlink_diag_msg {
16 __u8 ndiag_family;
17 __u8 ndiag_type;
18 __u8 ndiag_protocol;
19 __u8 ndiag_state;
20
21 __u32 ndiag_portid;
22 __u32 ndiag_dst_portid;
23 __u32 ndiag_dst_group;
24 __u32 ndiag_ino;
25 __u32 ndiag_cookie[2];
26};
27
28struct netlink_diag_ring {
29 __u32 ndr_block_size;
30 __u32 ndr_block_nr;
31 __u32 ndr_frame_size;
32 __u32 ndr_frame_nr;
33};
34
35enum {
36 NETLINK_DIAG_MEMINFO,
37 NETLINK_DIAG_GROUPS,
38 NETLINK_DIAG_RX_RING,
39 NETLINK_DIAG_TX_RING,
40
41 __NETLINK_DIAG_MAX,
42};
43
44#define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
45
46#define NDIAG_PROTO_ALL ((__u8) ~0)
47
48#define NDIAG_SHOW_MEMINFO 0x00000001 /* show memory info of a socket */
49#define NDIAG_SHOW_GROUPS 0x00000002 /* show groups of a netlink socket */
50#define NDIAG_SHOW_RING_CFG 0x00000004 /* show ring configuration */
51
52#endif
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 7969f46f1bb3..7440bc81a04b 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -90,6 +90,8 @@ enum nfc_commands {
90 NFC_CMD_LLC_SET_PARAMS, 90 NFC_CMD_LLC_SET_PARAMS,
91 NFC_CMD_ENABLE_SE, 91 NFC_CMD_ENABLE_SE,
92 NFC_CMD_DISABLE_SE, 92 NFC_CMD_DISABLE_SE,
93 NFC_CMD_LLC_SDREQ,
94 NFC_EVENT_LLC_SDRES,
93/* private: internal use only */ 95/* private: internal use only */
94 __NFC_CMD_AFTER_LAST 96 __NFC_CMD_AFTER_LAST
95}; 97};
@@ -140,11 +142,21 @@ enum nfc_attrs {
140 NFC_ATTR_LLC_PARAM_RW, 142 NFC_ATTR_LLC_PARAM_RW,
141 NFC_ATTR_LLC_PARAM_MIUX, 143 NFC_ATTR_LLC_PARAM_MIUX,
142 NFC_ATTR_SE, 144 NFC_ATTR_SE,
145 NFC_ATTR_LLC_SDP,
143/* private: internal use only */ 146/* private: internal use only */
144 __NFC_ATTR_AFTER_LAST 147 __NFC_ATTR_AFTER_LAST
145}; 148};
146#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1) 149#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
147 150
151enum nfc_sdp_attr {
152 NFC_SDP_ATTR_UNSPEC,
153 NFC_SDP_ATTR_URI,
154 NFC_SDP_ATTR_SAP,
155/* private: internal use only */
156 __NFC_SDP_ATTR_AFTER_LAST
157};
158#define NFC_SDP_ATTR_MAX (__NFC_SDP_ATTR_AFTER_LAST - 1)
159
148#define NFC_DEVICE_NAME_MAXSIZE 8 160#define NFC_DEVICE_NAME_MAXSIZE 8
149#define NFC_NFCID1_MAXSIZE 10 161#define NFC_NFCID1_MAXSIZE 10
150#define NFC_SENSB_RES_MAXSIZE 12 162#define NFC_SENSB_RES_MAXSIZE 12
@@ -220,4 +232,8 @@ struct sockaddr_nfc_llcp {
220#define NFC_LLCP_DIRECTION_RX 0x00 232#define NFC_LLCP_DIRECTION_RX 0x00
221#define NFC_LLCP_DIRECTION_TX 0x01 233#define NFC_LLCP_DIRECTION_TX 0x01
222 234
235/* socket option names */
236#define NFC_LLCP_RW 0
237#define NFC_LLCP_MIUX 1
238
223#endif /*__LINUX_NFC_H */ 239#endif /*__LINUX_NFC_H */
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c46bb016f4e4..79da8710448e 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -36,7 +36,21 @@
36 * The station is still assumed to belong to the AP interface it was added 36 * The station is still assumed to belong to the AP interface it was added
37 * to. 37 * to.
38 * 38 *
39 * TODO: need more info? 39 * Station handling varies per interface type and depending on the driver's
40 * capabilities.
41 *
42 * For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
43 * and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
44 * - a setup station entry is added, not yet authorized, without any rate
45 * or capability information, this just exists to avoid race conditions
46 * - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
47 * to add rate and capability information to the station and at the same
48 * time mark it authorized.
49 * - %NL80211_TDLS_ENABLE_LINK is then used
50 * - after this, the only valid operation is to remove it by tearing down
51 * the TDLS link (%NL80211_TDLS_DISABLE_LINK)
52 *
53 * TODO: need more info for other interface types
40 */ 54 */
41 55
42/** 56/**
@@ -499,9 +513,11 @@
499 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a 513 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
500 * beacon or probe response from a compatible mesh peer. This is only 514 * beacon or probe response from a compatible mesh peer. This is only
501 * sent while no station information (sta_info) exists for the new peer 515 * sent while no station information (sta_info) exists for the new peer
502 * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set. On 516 * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
503 * reception of this notification, userspace may decide to create a new 517 * @NL80211_MESH_SETUP_USERSPACE_AMPE, or
504 * station (@NL80211_CMD_NEW_STATION). To stop this notification from 518 * @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this
519 * notification, userspace may decide to create a new station
520 * (@NL80211_CMD_NEW_STATION). To stop this notification from
505 * reoccurring, the userspace authentication daemon may want to create the 521 * reoccurring, the userspace authentication daemon may want to create the
506 * new station with the AUTHENTICATED flag unset and maybe change it later 522 * new station with the AUTHENTICATED flag unset and maybe change it later
507 * depending on the authentication result. 523 * depending on the authentication result.
@@ -611,6 +627,18 @@
611 * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the 627 * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
612 * event. 628 * event.
613 * 629 *
630 * @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features,
631 * i.e. features for the nl80211 protocol rather than device features.
632 * Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap.
633 *
634 * @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition
635 * Information Element to the WLAN driver
636 *
637 * @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver
638 * to the supplicant. This will carry the target AP's MAC address along
639 * with the relevant Information Elements. This event is used to report
640 * received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
641 *
614 * @NL80211_CMD_MAX: highest used command number 642 * @NL80211_CMD_MAX: highest used command number
615 * @__NL80211_CMD_AFTER_LAST: internal use 643 * @__NL80211_CMD_AFTER_LAST: internal use
616 */ 644 */
@@ -765,6 +793,11 @@ enum nl80211_commands {
765 793
766 NL80211_CMD_RADAR_DETECT, 794 NL80211_CMD_RADAR_DETECT,
767 795
796 NL80211_CMD_GET_PROTOCOL_FEATURES,
797
798 NL80211_CMD_UPDATE_FT_IES,
799 NL80211_CMD_FT_EVENT,
800
768 /* add new commands above here */ 801 /* add new commands above here */
769 802
770 /* used to define NL80211_CMD_MAX below */ 803 /* used to define NL80211_CMD_MAX below */
@@ -884,7 +917,8 @@ enum nl80211_commands {
884 * consisting of a nested array. 917 * consisting of a nested array.
885 * 918 *
886 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). 919 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
887 * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. 920 * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
921 * (see &enum nl80211_plink_action).
888 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. 922 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
889 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path 923 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
890 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at 924 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
@@ -1167,10 +1201,10 @@ enum nl80211_commands {
1167 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver 1201 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
1168 * allows auth frames in a mesh to be passed to userspace for processing via 1202 * allows auth frames in a mesh to be passed to userspace for processing via
1169 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. 1203 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
1170 * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as 1204 * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
1171 * defined in &enum nl80211_plink_state. Used when userspace is 1205 * &enum nl80211_plink_state. Used when userspace is driving the peer link
1172 * driving the peer link management state machine. 1206 * management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or
1173 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. 1207 * @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
1174 * 1208 *
1175 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy 1209 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
1176 * capabilities, the supported WoWLAN triggers 1210 * capabilities, the supported WoWLAN triggers
@@ -1368,6 +1402,18 @@ enum nl80211_commands {
1368 * advertised to the driver, e.g., to enable TDLS off channel operations 1402 * advertised to the driver, e.g., to enable TDLS off channel operations
1369 * and PU-APSD. 1403 * and PU-APSD.
1370 * 1404 *
1405 * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
1406 * &enum nl80211_protocol_features, the attribute is a u32.
1407 *
1408 * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
1409 * receiving the data for a single wiphy split across multiple
1410 * messages, given with wiphy dump message
1411 *
1412 * @NL80211_ATTR_MDID: Mobility Domain Identifier
1413 *
1414 * @NL80211_ATTR_IE_RIC: Resource Information Container Information
1415 * Element
1416 *
1371 * @NL80211_ATTR_MAX: highest attribute number currently defined 1417 * @NL80211_ATTR_MAX: highest attribute number currently defined
1372 * @__NL80211_ATTR_AFTER_LAST: internal use 1418 * @__NL80211_ATTR_AFTER_LAST: internal use
1373 */ 1419 */
@@ -1654,6 +1700,15 @@ enum nl80211_attrs {
1654 NL80211_ATTR_STA_CAPABILITY, 1700 NL80211_ATTR_STA_CAPABILITY,
1655 NL80211_ATTR_STA_EXT_CAPABILITY, 1701 NL80211_ATTR_STA_EXT_CAPABILITY,
1656 1702
1703 NL80211_ATTR_PROTOCOL_FEATURES,
1704 NL80211_ATTR_SPLIT_WIPHY_DUMP,
1705
1706 NL80211_ATTR_DISABLE_VHT,
1707 NL80211_ATTR_VHT_CAPABILITY_MASK,
1708
1709 NL80211_ATTR_MDID,
1710 NL80211_ATTR_IE_RIC,
1711
1657 /* add attributes here, update the policy in nl80211.c */ 1712 /* add attributes here, update the policy in nl80211.c */
1658 1713
1659 __NL80211_ATTR_AFTER_LAST, 1714 __NL80211_ATTR_AFTER_LAST,
@@ -2412,8 +2467,10 @@ enum nl80211_mesh_power_mode {
2412 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh 2467 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
2413 * point. 2468 * point.
2414 * 2469 *
2415 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically 2470 * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open
2416 * open peer links when we detect compatible mesh peers. 2471 * peer links when we detect compatible mesh peers. Disabled if
2472 * @NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE are
2473 * set.
2417 * 2474 *
2418 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames 2475 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
2419 * containing a PREQ that an MP can send to a particular destination (path 2476 * containing a PREQ that an MP can send to a particular destination (path
@@ -2559,6 +2616,9 @@ enum nl80211_meshconf_params {
2559 * vendor specific synchronization method or disable it to use the default 2616 * vendor specific synchronization method or disable it to use the default
2560 * neighbor offset synchronization 2617 * neighbor offset synchronization
2561 * 2618 *
2619 * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
2620 * implement an MPM which handles peer allocation and state.
2621 *
2562 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number 2622 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2563 * 2623 *
2564 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 2624 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
@@ -2571,6 +2631,7 @@ enum nl80211_mesh_setup_params {
2571 NL80211_MESH_SETUP_USERSPACE_AUTH, 2631 NL80211_MESH_SETUP_USERSPACE_AUTH,
2572 NL80211_MESH_SETUP_USERSPACE_AMPE, 2632 NL80211_MESH_SETUP_USERSPACE_AMPE,
2573 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, 2633 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
2634 NL80211_MESH_SETUP_USERSPACE_MPM,
2574 2635
2575 /* keep last */ 2636 /* keep last */
2576 __NL80211_MESH_SETUP_ATTR_AFTER_LAST, 2637 __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
@@ -3307,6 +3368,23 @@ enum nl80211_plink_state {
3307 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 3368 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
3308}; 3369};
3309 3370
3371/**
3372 * enum nl80211_plink_action - actions to perform in mesh peers
3373 *
3374 * @NL80211_PLINK_ACTION_NO_ACTION: perform no action
3375 * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
3376 * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
3377 * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
3378 */
3379enum plink_actions {
3380 NL80211_PLINK_ACTION_NO_ACTION,
3381 NL80211_PLINK_ACTION_OPEN,
3382 NL80211_PLINK_ACTION_BLOCK,
3383
3384 NUM_NL80211_PLINK_ACTIONS,
3385};
3386
3387
3310#define NL80211_KCK_LEN 16 3388#define NL80211_KCK_LEN 16
3311#define NL80211_KEK_LEN 16 3389#define NL80211_KEK_LEN 16
3312#define NL80211_REPLAY_CTR_LEN 8 3390#define NL80211_REPLAY_CTR_LEN 8
@@ -3456,6 +3534,10 @@ enum nl80211_ap_sme_features {
3456 * stations the authenticated/associated bits have to be set in the mask. 3534 * stations the authenticated/associated bits have to be set in the mask.
3457 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits 3535 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
3458 * (HT40, VHT 80/160 MHz) if this flag is set 3536 * (HT40, VHT 80/160 MHz) if this flag is set
3537 * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
3538 * Peering Management entity which may be implemented by registering for
3539 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
3540 * still generated by the driver.
3459 */ 3541 */
3460enum nl80211_feature_flags { 3542enum nl80211_feature_flags {
3461 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3543 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3474,6 +3556,7 @@ enum nl80211_feature_flags {
3474 /* bit 13 is reserved */ 3556 /* bit 13 is reserved */
3475 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14, 3557 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
3476 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, 3558 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3559 NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
3477}; 3560};
3478 3561
3479/** 3562/**
@@ -3587,4 +3670,16 @@ enum nl80211_dfs_state {
3587 NL80211_DFS_AVAILABLE, 3670 NL80211_DFS_AVAILABLE,
3588}; 3671};
3589 3672
3673/**
3674 * enum enum nl80211_protocol_features - nl80211 protocol features
3675 * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
3676 * wiphy dumps (if requested by the application with the attribute
3677 * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
3678 * wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or
3679 * %NL80211_ATTR_WDEV.
3680 */
3681enum nl80211_protocol_features {
3682 NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0,
3683};
3684
3590#endif /* __LINUX_NL80211_H */ 3685#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
new file mode 100644
index 000000000000..405918dd7b3f
--- /dev/null
+++ b/include/uapi/linux/openvswitch.h
@@ -0,0 +1,456 @@
1
2/*
3 * Copyright (c) 2007-2011 Nicira Networks.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA
18 */
19
20#ifndef _UAPI__LINUX_OPENVSWITCH_H
21#define _UAPI__LINUX_OPENVSWITCH_H 1
22
23#include <linux/types.h>
24#include <linux/if_ether.h>
25
26/**
27 * struct ovs_header - header for OVS Generic Netlink messages.
28 * @dp_ifindex: ifindex of local port for datapath (0 to make a request not
29 * specific to a datapath).
30 *
31 * Attributes following the header are specific to a particular OVS Generic
32 * Netlink family, but all of the OVS families use this header.
33 */
34
35struct ovs_header {
36 int dp_ifindex;
37};
38
39/* Datapaths. */
40
41#define OVS_DATAPATH_FAMILY "ovs_datapath"
42#define OVS_DATAPATH_MCGROUP "ovs_datapath"
43#define OVS_DATAPATH_VERSION 0x1
44
45enum ovs_datapath_cmd {
46 OVS_DP_CMD_UNSPEC,
47 OVS_DP_CMD_NEW,
48 OVS_DP_CMD_DEL,
49 OVS_DP_CMD_GET,
50 OVS_DP_CMD_SET
51};
52
53/**
54 * enum ovs_datapath_attr - attributes for %OVS_DP_* commands.
55 * @OVS_DP_ATTR_NAME: Name of the network device that serves as the "local
56 * port". This is the name of the network device whose dp_ifindex is given in
57 * the &struct ovs_header. Always present in notifications. Required in
58 * %OVS_DP_NEW requests. May be used as an alternative to specifying
59 * dp_ifindex in other requests (with a dp_ifindex of 0).
60 * @OVS_DP_ATTR_UPCALL_PID: The Netlink socket in userspace that is initially
61 * set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on
62 * %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should
63 * not be sent.
64 * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the
65 * datapath. Always present in notifications.
66 *
67 * These attributes follow the &struct ovs_header within the Generic Netlink
68 * payload for %OVS_DP_* commands.
69 */
70enum ovs_datapath_attr {
71 OVS_DP_ATTR_UNSPEC,
72 OVS_DP_ATTR_NAME, /* name of dp_ifindex netdev */
73 OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */
74 OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */
75 __OVS_DP_ATTR_MAX
76};
77
78#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
79
80struct ovs_dp_stats {
81 __u64 n_hit; /* Number of flow table matches. */
82 __u64 n_missed; /* Number of flow table misses. */
83 __u64 n_lost; /* Number of misses not sent to userspace. */
84 __u64 n_flows; /* Number of flows present */
85};
86
87struct ovs_vport_stats {
88 __u64 rx_packets; /* total packets received */
89 __u64 tx_packets; /* total packets transmitted */
90 __u64 rx_bytes; /* total bytes received */
91 __u64 tx_bytes; /* total bytes transmitted */
92 __u64 rx_errors; /* bad packets received */
93 __u64 tx_errors; /* packet transmit problems */
94 __u64 rx_dropped; /* no space in linux buffers */
95 __u64 tx_dropped; /* no space available in linux */
96};
97
98/* Fixed logical ports. */
99#define OVSP_LOCAL ((__u32)0)
100
101/* Packet transfer. */
102
103#define OVS_PACKET_FAMILY "ovs_packet"
104#define OVS_PACKET_VERSION 0x1
105
106enum ovs_packet_cmd {
107 OVS_PACKET_CMD_UNSPEC,
108
109 /* Kernel-to-user notifications. */
110 OVS_PACKET_CMD_MISS, /* Flow table miss. */
111 OVS_PACKET_CMD_ACTION, /* OVS_ACTION_ATTR_USERSPACE action. */
112
113 /* Userspace commands. */
114 OVS_PACKET_CMD_EXECUTE /* Apply actions to a packet. */
115};
116
117/**
118 * enum ovs_packet_attr - attributes for %OVS_PACKET_* commands.
119 * @OVS_PACKET_ATTR_PACKET: Present for all notifications. Contains the entire
120 * packet as received, from the start of the Ethernet header onward. For
121 * %OVS_PACKET_CMD_ACTION, %OVS_PACKET_ATTR_PACKET reflects changes made by
122 * actions preceding %OVS_ACTION_ATTR_USERSPACE, but %OVS_PACKET_ATTR_KEY is
123 * the flow key extracted from the packet as originally received.
124 * @OVS_PACKET_ATTR_KEY: Present for all notifications. Contains the flow key
125 * extracted from the packet as nested %OVS_KEY_ATTR_* attributes. This allows
126 * userspace to adapt its flow setup strategy by comparing its notion of the
127 * flow key against the kernel's.
128 * @OVS_PACKET_ATTR_ACTIONS: Contains actions for the packet. Used
129 * for %OVS_PACKET_CMD_EXECUTE. It has nested %OVS_ACTION_ATTR_* attributes.
130 * @OVS_PACKET_ATTR_USERDATA: Present for an %OVS_PACKET_CMD_ACTION
131 * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an
132 * %OVS_USERSPACE_ATTR_USERDATA attribute, with the same length and content
133 * specified there.
134 *
135 * These attributes follow the &struct ovs_header within the Generic Netlink
136 * payload for %OVS_PACKET_* commands.
137 */
138enum ovs_packet_attr {
139 OVS_PACKET_ATTR_UNSPEC,
140 OVS_PACKET_ATTR_PACKET, /* Packet data. */
141 OVS_PACKET_ATTR_KEY, /* Nested OVS_KEY_ATTR_* attributes. */
142 OVS_PACKET_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */
143 OVS_PACKET_ATTR_USERDATA, /* OVS_ACTION_ATTR_USERSPACE arg. */
144 __OVS_PACKET_ATTR_MAX
145};
146
147#define OVS_PACKET_ATTR_MAX (__OVS_PACKET_ATTR_MAX - 1)
148
149/* Virtual ports. */
150
151#define OVS_VPORT_FAMILY "ovs_vport"
152#define OVS_VPORT_MCGROUP "ovs_vport"
153#define OVS_VPORT_VERSION 0x1
154
155enum ovs_vport_cmd {
156 OVS_VPORT_CMD_UNSPEC,
157 OVS_VPORT_CMD_NEW,
158 OVS_VPORT_CMD_DEL,
159 OVS_VPORT_CMD_GET,
160 OVS_VPORT_CMD_SET
161};
162
163enum ovs_vport_type {
164 OVS_VPORT_TYPE_UNSPEC,
165 OVS_VPORT_TYPE_NETDEV, /* network device */
166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
167 __OVS_VPORT_TYPE_MAX
168};
169
170#define OVS_VPORT_TYPE_MAX (__OVS_VPORT_TYPE_MAX - 1)
171
172/**
173 * enum ovs_vport_attr - attributes for %OVS_VPORT_* commands.
174 * @OVS_VPORT_ATTR_PORT_NO: 32-bit port number within datapath.
175 * @OVS_VPORT_ATTR_TYPE: 32-bit %OVS_VPORT_TYPE_* constant describing the type
176 * of vport.
177 * @OVS_VPORT_ATTR_NAME: Name of vport. For a vport based on a network device
178 * this is the name of the network device. Maximum length %IFNAMSIZ-1 bytes
179 * plus a null terminator.
180 * @OVS_VPORT_ATTR_OPTIONS: Vport-specific configuration information.
181 * @OVS_VPORT_ATTR_UPCALL_PID: The Netlink socket in userspace that
182 * OVS_PACKET_CMD_MISS upcalls will be directed to for packets received on
183 * this port. A value of zero indicates that upcalls should not be sent.
184 * @OVS_VPORT_ATTR_STATS: A &struct ovs_vport_stats giving statistics for
185 * packets sent or received through the vport.
186 *
187 * These attributes follow the &struct ovs_header within the Generic Netlink
188 * payload for %OVS_VPORT_* commands.
189 *
190 * For %OVS_VPORT_CMD_NEW requests, the %OVS_VPORT_ATTR_TYPE and
191 * %OVS_VPORT_ATTR_NAME attributes are required. %OVS_VPORT_ATTR_PORT_NO is
192 * optional; if not specified a free port number is automatically selected.
193 * Whether %OVS_VPORT_ATTR_OPTIONS is required or optional depends on the type
194 * of vport.
195 * and other attributes are ignored.
196 *
197 * For other requests, if %OVS_VPORT_ATTR_NAME is specified then it is used to
198 * look up the vport to operate on; otherwise dp_idx from the &struct
199 * ovs_header plus %OVS_VPORT_ATTR_PORT_NO determine the vport.
200 */
201enum ovs_vport_attr {
202 OVS_VPORT_ATTR_UNSPEC,
203 OVS_VPORT_ATTR_PORT_NO, /* u32 port number within datapath */
204 OVS_VPORT_ATTR_TYPE, /* u32 OVS_VPORT_TYPE_* constant. */
205 OVS_VPORT_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long */
206 OVS_VPORT_ATTR_OPTIONS, /* nested attributes, varies by vport type */
207 OVS_VPORT_ATTR_UPCALL_PID, /* u32 Netlink PID to receive upcalls */
208 OVS_VPORT_ATTR_STATS, /* struct ovs_vport_stats */
209 __OVS_VPORT_ATTR_MAX
210};
211
212#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
213
214/* Flows. */
215
216#define OVS_FLOW_FAMILY "ovs_flow"
217#define OVS_FLOW_MCGROUP "ovs_flow"
218#define OVS_FLOW_VERSION 0x1
219
220enum ovs_flow_cmd {
221 OVS_FLOW_CMD_UNSPEC,
222 OVS_FLOW_CMD_NEW,
223 OVS_FLOW_CMD_DEL,
224 OVS_FLOW_CMD_GET,
225 OVS_FLOW_CMD_SET
226};
227
228struct ovs_flow_stats {
229 __u64 n_packets; /* Number of matched packets. */
230 __u64 n_bytes; /* Number of matched bytes. */
231};
232
233enum ovs_key_attr {
234 OVS_KEY_ATTR_UNSPEC,
235 OVS_KEY_ATTR_ENCAP, /* Nested set of encapsulated attributes. */
236 OVS_KEY_ATTR_PRIORITY, /* u32 skb->priority */
237 OVS_KEY_ATTR_IN_PORT, /* u32 OVS dp port number */
238 OVS_KEY_ATTR_ETHERNET, /* struct ovs_key_ethernet */
239 OVS_KEY_ATTR_VLAN, /* be16 VLAN TCI */
240 OVS_KEY_ATTR_ETHERTYPE, /* be16 Ethernet type */
241 OVS_KEY_ATTR_IPV4, /* struct ovs_key_ipv4 */
242 OVS_KEY_ATTR_IPV6, /* struct ovs_key_ipv6 */
243 OVS_KEY_ATTR_TCP, /* struct ovs_key_tcp */
244 OVS_KEY_ATTR_UDP, /* struct ovs_key_udp */
245 OVS_KEY_ATTR_ICMP, /* struct ovs_key_icmp */
246 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */
247 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */
248 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
249 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
250 __OVS_KEY_ATTR_MAX
251};
252
253#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
254
255/**
256 * enum ovs_frag_type - IPv4 and IPv6 fragment type
257 * @OVS_FRAG_TYPE_NONE: Packet is not a fragment.
258 * @OVS_FRAG_TYPE_FIRST: Packet is a fragment with offset 0.
259 * @OVS_FRAG_TYPE_LATER: Packet is a fragment with nonzero offset.
260 *
261 * Used as the @ipv4_frag in &struct ovs_key_ipv4 and as @ipv6_frag &struct
262 * ovs_key_ipv6.
263 */
264enum ovs_frag_type {
265 OVS_FRAG_TYPE_NONE,
266 OVS_FRAG_TYPE_FIRST,
267 OVS_FRAG_TYPE_LATER,
268 __OVS_FRAG_TYPE_MAX
269};
270
271#define OVS_FRAG_TYPE_MAX (__OVS_FRAG_TYPE_MAX - 1)
272
273struct ovs_key_ethernet {
274 __u8 eth_src[ETH_ALEN];
275 __u8 eth_dst[ETH_ALEN];
276};
277
278struct ovs_key_ipv4 {
279 __be32 ipv4_src;
280 __be32 ipv4_dst;
281 __u8 ipv4_proto;
282 __u8 ipv4_tos;
283 __u8 ipv4_ttl;
284 __u8 ipv4_frag; /* One of OVS_FRAG_TYPE_*. */
285};
286
287struct ovs_key_ipv6 {
288 __be32 ipv6_src[4];
289 __be32 ipv6_dst[4];
290 __be32 ipv6_label; /* 20-bits in least-significant bits. */
291 __u8 ipv6_proto;
292 __u8 ipv6_tclass;
293 __u8 ipv6_hlimit;
294 __u8 ipv6_frag; /* One of OVS_FRAG_TYPE_*. */
295};
296
297struct ovs_key_tcp {
298 __be16 tcp_src;
299 __be16 tcp_dst;
300};
301
302struct ovs_key_udp {
303 __be16 udp_src;
304 __be16 udp_dst;
305};
306
307struct ovs_key_icmp {
308 __u8 icmp_type;
309 __u8 icmp_code;
310};
311
312struct ovs_key_icmpv6 {
313 __u8 icmpv6_type;
314 __u8 icmpv6_code;
315};
316
317struct ovs_key_arp {
318 __be32 arp_sip;
319 __be32 arp_tip;
320 __be16 arp_op;
321 __u8 arp_sha[ETH_ALEN];
322 __u8 arp_tha[ETH_ALEN];
323};
324
325struct ovs_key_nd {
326 __u32 nd_target[4];
327 __u8 nd_sll[ETH_ALEN];
328 __u8 nd_tll[ETH_ALEN];
329};
330
331/**
332 * enum ovs_flow_attr - attributes for %OVS_FLOW_* commands.
333 * @OVS_FLOW_ATTR_KEY: Nested %OVS_KEY_ATTR_* attributes specifying the flow
334 * key. Always present in notifications. Required for all requests (except
335 * dumps).
336 * @OVS_FLOW_ATTR_ACTIONS: Nested %OVS_ACTION_ATTR_* attributes specifying
337 * the actions to take for packets that match the key. Always present in
338 * notifications. Required for %OVS_FLOW_CMD_NEW requests, optional for
339 * %OVS_FLOW_CMD_SET requests.
340 * @OVS_FLOW_ATTR_STATS: &struct ovs_flow_stats giving statistics for this
341 * flow. Present in notifications if the stats would be nonzero. Ignored in
342 * requests.
343 * @OVS_FLOW_ATTR_TCP_FLAGS: An 8-bit value giving the OR'd value of all of the
344 * TCP flags seen on packets in this flow. Only present in notifications for
345 * TCP flows, and only if it would be nonzero. Ignored in requests.
346 * @OVS_FLOW_ATTR_USED: A 64-bit integer giving the time, in milliseconds on
347 * the system monotonic clock, at which a packet was last processed for this
348 * flow. Only present in notifications if a packet has been processed for this
349 * flow. Ignored in requests.
350 * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the
351 * last-used time, accumulated TCP flags, and statistics for this flow.
352 * Otherwise ignored in requests. Never present in notifications.
353 *
354 * These attributes follow the &struct ovs_header within the Generic Netlink
355 * payload for %OVS_FLOW_* commands.
356 */
357enum ovs_flow_attr {
358 OVS_FLOW_ATTR_UNSPEC,
359 OVS_FLOW_ATTR_KEY, /* Sequence of OVS_KEY_ATTR_* attributes. */
360 OVS_FLOW_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */
361 OVS_FLOW_ATTR_STATS, /* struct ovs_flow_stats. */
362 OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */
363 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */
364 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */
365 __OVS_FLOW_ATTR_MAX
366};
367
368#define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
369
370/**
371 * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action.
372 * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with
373 * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of
374 * %UINT32_MAX samples all packets and intermediate values sample intermediate
375 * fractions of packets.
376 * @OVS_SAMPLE_ATTR_ACTIONS: Set of actions to execute in sampling event.
377 * Actions are passed as nested attributes.
378 *
379 * Executes the specified actions with the given probability on a per-packet
380 * basis.
381 */
382enum ovs_sample_attr {
383 OVS_SAMPLE_ATTR_UNSPEC,
384 OVS_SAMPLE_ATTR_PROBABILITY, /* u32 number */
385 OVS_SAMPLE_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */
386 __OVS_SAMPLE_ATTR_MAX,
387};
388
389#define OVS_SAMPLE_ATTR_MAX (__OVS_SAMPLE_ATTR_MAX - 1)
390
391/**
392 * enum ovs_userspace_attr - Attributes for %OVS_ACTION_ATTR_USERSPACE action.
393 * @OVS_USERSPACE_ATTR_PID: u32 Netlink PID to which the %OVS_PACKET_CMD_ACTION
394 * message should be sent. Required.
395 * @OVS_USERSPACE_ATTR_USERDATA: If present, its variable-length argument is
396 * copied to the %OVS_PACKET_CMD_ACTION message as %OVS_PACKET_ATTR_USERDATA.
397 */
398enum ovs_userspace_attr {
399 OVS_USERSPACE_ATTR_UNSPEC,
400 OVS_USERSPACE_ATTR_PID, /* u32 Netlink PID to receive upcalls. */
401 OVS_USERSPACE_ATTR_USERDATA, /* Optional user-specified cookie. */
402 __OVS_USERSPACE_ATTR_MAX
403};
404
405#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
406
407/**
408 * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument.
409 * @vlan_tpid: Tag protocol identifier (TPID) to push.
410 * @vlan_tci: Tag control identifier (TCI) to push. The CFI bit must be set
411 * (but it will not be set in the 802.1Q header that is pushed).
412 *
413 * The @vlan_tpid value is typically %ETH_P_8021Q. The only acceptable TPID
414 * values are those that the kernel module also parses as 802.1Q headers, to
415 * prevent %OVS_ACTION_ATTR_PUSH_VLAN followed by %OVS_ACTION_ATTR_POP_VLAN
416 * from having surprising results.
417 */
418struct ovs_action_push_vlan {
419 __be16 vlan_tpid; /* 802.1Q TPID. */
420 __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */
421};
422
423/**
424 * enum ovs_action_attr - Action types.
425 *
426 * @OVS_ACTION_ATTR_OUTPUT: Output packet to port.
427 * @OVS_ACTION_ATTR_USERSPACE: Send packet to userspace according to nested
428 * %OVS_USERSPACE_ATTR_* attributes.
429 * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The
430 * single nested %OVS_KEY_ATTR_* attribute specifies a header to modify and its
431 * value.
432 * @OVS_ACTION_ATTR_PUSH_VLAN: Push a new outermost 802.1Q header onto the
433 * packet.
434 * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet.
435 * @OVS_ACTION_ATTR_SAMPLE: Probabilitically executes actions, as specified in
436 * the nested %OVS_SAMPLE_ATTR_* attributes.
437 *
438 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all
439 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
440 * type may not be changed.
441 */
442
443enum ovs_action_attr {
444 OVS_ACTION_ATTR_UNSPEC,
445 OVS_ACTION_ATTR_OUTPUT, /* u32 port number. */
446 OVS_ACTION_ATTR_USERSPACE, /* Nested OVS_USERSPACE_ATTR_*. */
447 OVS_ACTION_ATTR_SET, /* One nested OVS_KEY_ATTR_*. */
448 OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */
449 OVS_ACTION_ATTR_POP_VLAN, /* No argument. */
450 OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */
451 __OVS_ACTION_ATTR_MAX
452};
453
454#define OVS_ACTION_ATTR_MAX (__OVS_ACTION_ATTR_MAX - 1)
455
456#endif /* _LINUX_OPENVSWITCH_H */
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 32aef0a439ef..dbd71b0c7d8c 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -348,6 +348,7 @@ enum {
348 TCA_HTB_INIT, 348 TCA_HTB_INIT,
349 TCA_HTB_CTAB, 349 TCA_HTB_CTAB,
350 TCA_HTB_RTAB, 350 TCA_HTB_RTAB,
351 TCA_HTB_DIRECT_QLEN,
351 __TCA_HTB_MAX, 352 __TCA_HTB_MAX,
352}; 353};
353 354
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
new file mode 100644
index 000000000000..66b466e4ca08
--- /dev/null
+++ b/include/uapi/linux/sctp.h
@@ -0,0 +1,846 @@
1/* SCTP kernel implementation
2 * (C) Copyright IBM Corp. 2001, 2004
3 * Copyright (c) 1999-2000 Cisco, Inc.
4 * Copyright (c) 1999-2001 Motorola, Inc.
5 * Copyright (c) 2002 Intel Corp.
6 *
7 * This file is part of the SCTP kernel implementation
8 *
9 * This header represents the structures and constants needed to support
10 * the SCTP Extension to the Sockets API.
11 *
12 * This SCTP implementation is free software;
13 * you can redistribute it and/or modify it under the terms of
14 * the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This SCTP implementation is distributed in the hope that it
19 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
20 * ************************
21 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 * See the GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to
26 * the Free Software Foundation, 59 Temple Place - Suite 330,
27 * Boston, MA 02111-1307, USA.
28 *
29 * Please send any bug reports or fixes you make to the
30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net>
32 *
33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp
35 *
36 * Written or modified by:
37 * La Monte H.P. Yarroll <piggy@acm.org>
38 * R. Stewart <randall@sctp.chicago.il.us>
39 * K. Morneau <kmorneau@cisco.com>
40 * Q. Xie <qxie1@email.mot.com>
41 * Karl Knutson <karl@athena.chicago.il.us>
42 * Jon Grimm <jgrimm@us.ibm.com>
43 * Daisy Chang <daisyc@us.ibm.com>
44 * Ryan Layer <rmlayer@us.ibm.com>
45 * Ardelle Fan <ardelle.fan@intel.com>
46 * Sridhar Samudrala <sri@us.ibm.com>
47 * Inaky Perez-Gonzalez <inaky.gonzalez@intel.com>
48 * Vlad Yasevich <vladislav.yasevich@hp.com>
49 *
50 * Any bugs reported given to us we will try to fix... any fixes shared will
51 * be incorporated into the next SCTP release.
52 */
53
54#ifndef _UAPI_SCTP_H
55#define _UAPI_SCTP_H
56
57#include <linux/types.h>
58#include <linux/socket.h>
59
60typedef __s32 sctp_assoc_t;
61
62/* The following symbols come from the Sockets API Extensions for
63 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
64 */
65#define SCTP_RTOINFO 0
66#define SCTP_ASSOCINFO 1
67#define SCTP_INITMSG 2
68#define SCTP_NODELAY 3 /* Get/set nodelay option. */
69#define SCTP_AUTOCLOSE 4
70#define SCTP_SET_PEER_PRIMARY_ADDR 5
71#define SCTP_PRIMARY_ADDR 6
72#define SCTP_ADAPTATION_LAYER 7
73#define SCTP_DISABLE_FRAGMENTS 8
74#define SCTP_PEER_ADDR_PARAMS 9
75#define SCTP_DEFAULT_SEND_PARAM 10
76#define SCTP_EVENTS 11
77#define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
78#define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
79#define SCTP_STATUS 14
80#define SCTP_GET_PEER_ADDR_INFO 15
81#define SCTP_DELAYED_ACK_TIME 16
82#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
83#define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
84#define SCTP_CONTEXT 17
85#define SCTP_FRAGMENT_INTERLEAVE 18
86#define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
87#define SCTP_MAX_BURST 20 /* Set/Get max burst */
88#define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
89#define SCTP_HMAC_IDENT 22
90#define SCTP_AUTH_KEY 23
91#define SCTP_AUTH_ACTIVE_KEY 24
92#define SCTP_AUTH_DELETE_KEY 25
93#define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
94#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
95#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
96#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
97#define SCTP_AUTO_ASCONF 30
98#define SCTP_PEER_ADDR_THLDS 31
99
100/* Internal Socket Options. Some of the sctp library functions are
101 * implemented using these socket options.
102 */
103#define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
104#define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
105#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
106/* Options 104-106 are deprecated and removed. Do not use this space */
107#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
108#define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */
109#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
110#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
111#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
112#define SCTP_GET_ASSOC_STATS 112 /* Read only */
113
114/*
115 * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
116 *
117 * This cmsghdr structure provides information for initializing new
118 * SCTP associations with sendmsg(). The SCTP_INITMSG socket option
119 * uses this same data structure. This structure is not used for
120 * recvmsg().
121 *
122 * cmsg_level cmsg_type cmsg_data[]
123 * ------------ ------------ ----------------------
124 * IPPROTO_SCTP SCTP_INIT struct sctp_initmsg
125 *
126 */
127struct sctp_initmsg {
128 __u16 sinit_num_ostreams;
129 __u16 sinit_max_instreams;
130 __u16 sinit_max_attempts;
131 __u16 sinit_max_init_timeo;
132};
133
134/*
135 * 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
136 *
137 * This cmsghdr structure specifies SCTP options for sendmsg() and
138 * describes SCTP header information about a received message through
139 * recvmsg().
140 *
141 * cmsg_level cmsg_type cmsg_data[]
142 * ------------ ------------ ----------------------
143 * IPPROTO_SCTP SCTP_SNDRCV struct sctp_sndrcvinfo
144 *
145 */
146struct sctp_sndrcvinfo {
147 __u16 sinfo_stream;
148 __u16 sinfo_ssn;
149 __u16 sinfo_flags;
150 __u32 sinfo_ppid;
151 __u32 sinfo_context;
152 __u32 sinfo_timetolive;
153 __u32 sinfo_tsn;
154 __u32 sinfo_cumtsn;
155 sctp_assoc_t sinfo_assoc_id;
156};
157
158/*
159 * sinfo_flags: 16 bits (unsigned integer)
160 *
161 * This field may contain any of the following flags and is composed of
162 * a bitwise OR of these values.
163 */
164
165enum sctp_sinfo_flags {
166 SCTP_UNORDERED = 1, /* Send/receive message unordered. */
167 SCTP_ADDR_OVER = 2, /* Override the primary destination. */
168 SCTP_ABORT=4, /* Send an ABORT message to the peer. */
169 SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */
170 SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */
171};
172
173typedef union {
174 __u8 raw;
175 struct sctp_initmsg init;
176 struct sctp_sndrcvinfo sndrcv;
177} sctp_cmsg_data_t;
178
179/* These are cmsg_types. */
180typedef enum sctp_cmsg_type {
181 SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */
182#define SCTP_INIT SCTP_INIT
183 SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */
184#define SCTP_SNDRCV SCTP_SNDRCV
185} sctp_cmsg_t;
186
187/*
188 * 5.3.1.1 SCTP_ASSOC_CHANGE
189 *
190 * Communication notifications inform the ULP that an SCTP association
191 * has either begun or ended. The identifier for a new association is
192 * provided by this notificaion. The notification information has the
193 * following format:
194 *
195 */
196struct sctp_assoc_change {
197 __u16 sac_type;
198 __u16 sac_flags;
199 __u32 sac_length;
200 __u16 sac_state;
201 __u16 sac_error;
202 __u16 sac_outbound_streams;
203 __u16 sac_inbound_streams;
204 sctp_assoc_t sac_assoc_id;
205 __u8 sac_info[0];
206};
207
208/*
209 * sac_state: 32 bits (signed integer)
210 *
211 * This field holds one of a number of values that communicate the
212 * event that happened to the association. They include:
213 *
214 * Note: The following state names deviate from the API draft as
215 * the names clash too easily with other kernel symbols.
216 */
217enum sctp_sac_state {
218 SCTP_COMM_UP,
219 SCTP_COMM_LOST,
220 SCTP_RESTART,
221 SCTP_SHUTDOWN_COMP,
222 SCTP_CANT_STR_ASSOC,
223};
224
225/*
226 * 5.3.1.2 SCTP_PEER_ADDR_CHANGE
227 *
228 * When a destination address on a multi-homed peer encounters a change
229 * an interface details event is sent. The information has the
230 * following structure:
231 */
232struct sctp_paddr_change {
233 __u16 spc_type;
234 __u16 spc_flags;
235 __u32 spc_length;
236 struct sockaddr_storage spc_aaddr;
237 int spc_state;
238 int spc_error;
239 sctp_assoc_t spc_assoc_id;
240} __attribute__((packed, aligned(4)));
241
242/*
243 * spc_state: 32 bits (signed integer)
244 *
245 * This field holds one of a number of values that communicate the
246 * event that happened to the address. They include:
247 */
248enum sctp_spc_state {
249 SCTP_ADDR_AVAILABLE,
250 SCTP_ADDR_UNREACHABLE,
251 SCTP_ADDR_REMOVED,
252 SCTP_ADDR_ADDED,
253 SCTP_ADDR_MADE_PRIM,
254 SCTP_ADDR_CONFIRMED,
255};
256
257
258/*
259 * 5.3.1.3 SCTP_REMOTE_ERROR
260 *
261 * A remote peer may send an Operational Error message to its peer.
262 * This message indicates a variety of error conditions on an
263 * association. The entire error TLV as it appears on the wire is
264 * included in a SCTP_REMOTE_ERROR event. Please refer to the SCTP
265 * specification [SCTP] and any extensions for a list of possible
266 * error formats. SCTP error TLVs have the format:
267 */
268struct sctp_remote_error {
269 __u16 sre_type;
270 __u16 sre_flags;
271 __u32 sre_length;
272 __u16 sre_error;
273 sctp_assoc_t sre_assoc_id;
274 __u8 sre_data[0];
275};
276
277
278/*
279 * 5.3.1.4 SCTP_SEND_FAILED
280 *
281 * If SCTP cannot deliver a message it may return the message as a
282 * notification.
283 */
284struct sctp_send_failed {
285 __u16 ssf_type;
286 __u16 ssf_flags;
287 __u32 ssf_length;
288 __u32 ssf_error;
289 struct sctp_sndrcvinfo ssf_info;
290 sctp_assoc_t ssf_assoc_id;
291 __u8 ssf_data[0];
292};
293
294/*
295 * ssf_flags: 16 bits (unsigned integer)
296 *
297 * The flag value will take one of the following values
298 *
299 * SCTP_DATA_UNSENT - Indicates that the data was never put on
300 * the wire.
301 *
302 * SCTP_DATA_SENT - Indicates that the data was put on the wire.
303 * Note that this does not necessarily mean that the
304 * data was (or was not) successfully delivered.
305 */
306enum sctp_ssf_flags {
307 SCTP_DATA_UNSENT,
308 SCTP_DATA_SENT,
309};
310
311/*
312 * 5.3.1.5 SCTP_SHUTDOWN_EVENT
313 *
314 * When a peer sends a SHUTDOWN, SCTP delivers this notification to
315 * inform the application that it should cease sending data.
316 */
317struct sctp_shutdown_event {
318 __u16 sse_type;
319 __u16 sse_flags;
320 __u32 sse_length;
321 sctp_assoc_t sse_assoc_id;
322};
323
324/*
325 * 5.3.1.6 SCTP_ADAPTATION_INDICATION
326 *
327 * When a peer sends a Adaptation Layer Indication parameter , SCTP
328 * delivers this notification to inform the application
329 * that of the peers requested adaptation layer.
330 */
331struct sctp_adaptation_event {
332 __u16 sai_type;
333 __u16 sai_flags;
334 __u32 sai_length;
335 __u32 sai_adaptation_ind;
336 sctp_assoc_t sai_assoc_id;
337};
338
339/*
340 * 5.3.1.7 SCTP_PARTIAL_DELIVERY_EVENT
341 *
342 * When a receiver is engaged in a partial delivery of a
343 * message this notification will be used to indicate
344 * various events.
345 */
346struct sctp_pdapi_event {
347 __u16 pdapi_type;
348 __u16 pdapi_flags;
349 __u32 pdapi_length;
350 __u32 pdapi_indication;
351 sctp_assoc_t pdapi_assoc_id;
352};
353
354enum { SCTP_PARTIAL_DELIVERY_ABORTED=0, };
355
356/*
357 * 5.3.1.8. SCTP_AUTHENTICATION_EVENT
358 *
359 * When a receiver is using authentication this message will provide
360 * notifications regarding new keys being made active as well as errors.
361 */
362struct sctp_authkey_event {
363 __u16 auth_type;
364 __u16 auth_flags;
365 __u32 auth_length;
366 __u16 auth_keynumber;
367 __u16 auth_altkeynumber;
368 __u32 auth_indication;
369 sctp_assoc_t auth_assoc_id;
370};
371
372enum { SCTP_AUTH_NEWKEY = 0, };
373
374/*
375 * 6.1.9. SCTP_SENDER_DRY_EVENT
376 *
377 * When the SCTP stack has no more user data to send or retransmit, this
378 * notification is given to the user. Also, at the time when a user app
379 * subscribes to this event, if there is no data to be sent or
380 * retransmit, the stack will immediately send up this notification.
381 */
382struct sctp_sender_dry_event {
383 __u16 sender_dry_type;
384 __u16 sender_dry_flags;
385 __u32 sender_dry_length;
386 sctp_assoc_t sender_dry_assoc_id;
387};
388
389/*
390 * Described in Section 7.3
391 * Ancillary Data and Notification Interest Options
392 */
393struct sctp_event_subscribe {
394 __u8 sctp_data_io_event;
395 __u8 sctp_association_event;
396 __u8 sctp_address_event;
397 __u8 sctp_send_failure_event;
398 __u8 sctp_peer_error_event;
399 __u8 sctp_shutdown_event;
400 __u8 sctp_partial_delivery_event;
401 __u8 sctp_adaptation_layer_event;
402 __u8 sctp_authentication_event;
403 __u8 sctp_sender_dry_event;
404};
405
406/*
407 * 5.3.1 SCTP Notification Structure
408 *
409 * The notification structure is defined as the union of all
410 * notification types.
411 *
412 */
413union sctp_notification {
414 struct {
415 __u16 sn_type; /* Notification type. */
416 __u16 sn_flags;
417 __u32 sn_length;
418 } sn_header;
419 struct sctp_assoc_change sn_assoc_change;
420 struct sctp_paddr_change sn_paddr_change;
421 struct sctp_remote_error sn_remote_error;
422 struct sctp_send_failed sn_send_failed;
423 struct sctp_shutdown_event sn_shutdown_event;
424 struct sctp_adaptation_event sn_adaptation_event;
425 struct sctp_pdapi_event sn_pdapi_event;
426 struct sctp_authkey_event sn_authkey_event;
427 struct sctp_sender_dry_event sn_sender_dry_event;
428};
429
430/* Section 5.3.1
431 * All standard values for sn_type flags are greater than 2^15.
432 * Values from 2^15 and down are reserved.
433 */
434
435enum sctp_sn_type {
436 SCTP_SN_TYPE_BASE = (1<<15),
437 SCTP_ASSOC_CHANGE,
438#define SCTP_ASSOC_CHANGE SCTP_ASSOC_CHANGE
439 SCTP_PEER_ADDR_CHANGE,
440#define SCTP_PEER_ADDR_CHANGE SCTP_PEER_ADDR_CHANGE
441 SCTP_SEND_FAILED,
442#define SCTP_SEND_FAILED SCTP_SEND_FAILED
443 SCTP_REMOTE_ERROR,
444#define SCTP_REMOTE_ERROR SCTP_REMOTE_ERROR
445 SCTP_SHUTDOWN_EVENT,
446#define SCTP_SHUTDOWN_EVENT SCTP_SHUTDOWN_EVENT
447 SCTP_PARTIAL_DELIVERY_EVENT,
448#define SCTP_PARTIAL_DELIVERY_EVENT SCTP_PARTIAL_DELIVERY_EVENT
449 SCTP_ADAPTATION_INDICATION,
450#define SCTP_ADAPTATION_INDICATION SCTP_ADAPTATION_INDICATION
451 SCTP_AUTHENTICATION_EVENT,
452#define SCTP_AUTHENTICATION_INDICATION SCTP_AUTHENTICATION_EVENT
453 SCTP_SENDER_DRY_EVENT,
454#define SCTP_SENDER_DRY_EVENT SCTP_SENDER_DRY_EVENT
455};
456
457/* Notification error codes used to fill up the error fields in some
458 * notifications.
459 * SCTP_PEER_ADDRESS_CHAGE : spc_error
460 * SCTP_ASSOC_CHANGE : sac_error
461 * These names should be potentially included in the draft 04 of the SCTP
462 * sockets API specification.
463 */
464typedef enum sctp_sn_error {
465 SCTP_FAILED_THRESHOLD,
466 SCTP_RECEIVED_SACK,
467 SCTP_HEARTBEAT_SUCCESS,
468 SCTP_RESPONSE_TO_USER_REQ,
469 SCTP_INTERNAL_ERROR,
470 SCTP_SHUTDOWN_GUARD_EXPIRES,
471 SCTP_PEER_FAULTY,
472} sctp_sn_error_t;
473
474/*
475 * 7.1.1 Retransmission Timeout Parameters (SCTP_RTOINFO)
476 *
477 * The protocol parameters used to initialize and bound retransmission
478 * timeout (RTO) are tunable. See [SCTP] for more information on how
479 * these parameters are used in RTO calculation.
480 */
481struct sctp_rtoinfo {
482 sctp_assoc_t srto_assoc_id;
483 __u32 srto_initial;
484 __u32 srto_max;
485 __u32 srto_min;
486};
487
488/*
489 * 7.1.2 Association Parameters (SCTP_ASSOCINFO)
490 *
491 * This option is used to both examine and set various association and
492 * endpoint parameters.
493 */
494struct sctp_assocparams {
495 sctp_assoc_t sasoc_assoc_id;
496 __u16 sasoc_asocmaxrxt;
497 __u16 sasoc_number_peer_destinations;
498 __u32 sasoc_peer_rwnd;
499 __u32 sasoc_local_rwnd;
500 __u32 sasoc_cookie_life;
501};
502
503/*
504 * 7.1.9 Set Peer Primary Address (SCTP_SET_PEER_PRIMARY_ADDR)
505 *
506 * Requests that the peer mark the enclosed address as the association
507 * primary. The enclosed address must be one of the association's
508 * locally bound addresses. The following structure is used to make a
509 * set primary request:
510 */
511struct sctp_setpeerprim {
512 sctp_assoc_t sspp_assoc_id;
513 struct sockaddr_storage sspp_addr;
514} __attribute__((packed, aligned(4)));
515
516/*
517 * 7.1.10 Set Primary Address (SCTP_PRIMARY_ADDR)
518 *
519 * Requests that the local SCTP stack use the enclosed peer address as
520 * the association primary. The enclosed address must be one of the
521 * association peer's addresses. The following structure is used to
522 * make a set peer primary request:
523 */
524struct sctp_prim {
525 sctp_assoc_t ssp_assoc_id;
526 struct sockaddr_storage ssp_addr;
527} __attribute__((packed, aligned(4)));
528
529/* For backward compatibility use, define the old name too */
530#define sctp_setprim sctp_prim
531
532/*
533 * 7.1.11 Set Adaptation Layer Indicator (SCTP_ADAPTATION_LAYER)
534 *
535 * Requests that the local endpoint set the specified Adaptation Layer
536 * Indication parameter for all future INIT and INIT-ACK exchanges.
537 */
538struct sctp_setadaptation {
539 __u32 ssb_adaptation_ind;
540};
541
542/*
543 * 7.1.13 Peer Address Parameters (SCTP_PEER_ADDR_PARAMS)
544 *
545 * Applications can enable or disable heartbeats for any peer address
546 * of an association, modify an address's heartbeat interval, force a
547 * heartbeat to be sent immediately, and adjust the address's maximum
548 * number of retransmissions sent before an address is considered
549 * unreachable. The following structure is used to access and modify an
550 * address's parameters:
551 */
552enum sctp_spp_flags {
553 SPP_HB_ENABLE = 1<<0, /*Enable heartbeats*/
554 SPP_HB_DISABLE = 1<<1, /*Disable heartbeats*/
555 SPP_HB = SPP_HB_ENABLE | SPP_HB_DISABLE,
556 SPP_HB_DEMAND = 1<<2, /*Send heartbeat immediately*/
557 SPP_PMTUD_ENABLE = 1<<3, /*Enable PMTU discovery*/
558 SPP_PMTUD_DISABLE = 1<<4, /*Disable PMTU discovery*/
559 SPP_PMTUD = SPP_PMTUD_ENABLE | SPP_PMTUD_DISABLE,
560 SPP_SACKDELAY_ENABLE = 1<<5, /*Enable SACK*/
561 SPP_SACKDELAY_DISABLE = 1<<6, /*Disable SACK*/
562 SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
563 SPP_HB_TIME_IS_ZERO = 1<<7, /* Set HB delay to 0 */
564};
565
566struct sctp_paddrparams {
567 sctp_assoc_t spp_assoc_id;
568 struct sockaddr_storage spp_address;
569 __u32 spp_hbinterval;
570 __u16 spp_pathmaxrxt;
571 __u32 spp_pathmtu;
572 __u32 spp_sackdelay;
573 __u32 spp_flags;
574} __attribute__((packed, aligned(4)));
575
576/*
577 * 7.1.18. Add a chunk that must be authenticated (SCTP_AUTH_CHUNK)
578 *
579 * This set option adds a chunk type that the user is requesting to be
580 * received only in an authenticated way. Changes to the list of chunks
581 * will only effect future associations on the socket.
582 */
583struct sctp_authchunk {
584 __u8 sauth_chunk;
585};
586
587/*
588 * 7.1.19. Get or set the list of supported HMAC Identifiers (SCTP_HMAC_IDENT)
589 *
590 * This option gets or sets the list of HMAC algorithms that the local
591 * endpoint requires the peer to use.
592 */
593#ifndef __KERNEL__
594/* This here is only used by user space as is. It might not be a good idea
595 * to export/reveal the whole structure with reserved fields etc.
596 */
597enum {
598 SCTP_AUTH_HMAC_ID_SHA1 = 1,
599 SCTP_AUTH_HMAC_ID_SHA256 = 3,
600};
601#endif
602
603struct sctp_hmacalgo {
604 __u32 shmac_num_idents;
605 __u16 shmac_idents[];
606};
607
608/* Sadly, user and kernel space have different names for
609 * this structure member, so this is to not break anything.
610 */
611#define shmac_number_of_idents shmac_num_idents
612
613/*
614 * 7.1.20. Set a shared key (SCTP_AUTH_KEY)
615 *
616 * This option will set a shared secret key which is used to build an
617 * association shared key.
618 */
619struct sctp_authkey {
620 sctp_assoc_t sca_assoc_id;
621 __u16 sca_keynumber;
622 __u16 sca_keylength;
623 __u8 sca_key[];
624};
625
626/*
627 * 7.1.21. Get or set the active shared key (SCTP_AUTH_ACTIVE_KEY)
628 *
629 * This option will get or set the active shared key to be used to build
630 * the association shared key.
631 */
632
633struct sctp_authkeyid {
634 sctp_assoc_t scact_assoc_id;
635 __u16 scact_keynumber;
636};
637
638
639/*
640 * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK)
641 *
642 * This option will effect the way delayed acks are performed. This
643 * option allows you to get or set the delayed ack time, in
644 * milliseconds. It also allows changing the delayed ack frequency.
645 * Changing the frequency to 1 disables the delayed sack algorithm. If
646 * the assoc_id is 0, then this sets or gets the endpoints default
647 * values. If the assoc_id field is non-zero, then the set or get
648 * effects the specified association for the one to many model (the
649 * assoc_id field is ignored by the one to one model). Note that if
650 * sack_delay or sack_freq are 0 when setting this option, then the
651 * current values will remain unchanged.
652 */
653struct sctp_sack_info {
654 sctp_assoc_t sack_assoc_id;
655 uint32_t sack_delay;
656 uint32_t sack_freq;
657};
658
659struct sctp_assoc_value {
660 sctp_assoc_t assoc_id;
661 uint32_t assoc_value;
662};
663
664/*
665 * 7.2.2 Peer Address Information
666 *
667 * Applications can retrieve information about a specific peer address
668 * of an association, including its reachability state, congestion
669 * window, and retransmission timer values. This information is
670 * read-only. The following structure is used to access this
671 * information:
672 */
673struct sctp_paddrinfo {
674 sctp_assoc_t spinfo_assoc_id;
675 struct sockaddr_storage spinfo_address;
676 __s32 spinfo_state;
677 __u32 spinfo_cwnd;
678 __u32 spinfo_srtt;
679 __u32 spinfo_rto;
680 __u32 spinfo_mtu;
681} __attribute__((packed, aligned(4)));
682
683/* Peer addresses's state. */
684/* UNKNOWN: Peer address passed by the upper layer in sendmsg or connect[x]
685 * calls.
686 * UNCONFIRMED: Peer address received in INIT/INIT-ACK address parameters.
687 * Not yet confirmed by a heartbeat and not available for data
688 * transfers.
689 * ACTIVE : Peer address confirmed, active and available for data transfers.
690 * INACTIVE: Peer address inactive and not available for data transfers.
691 */
692enum sctp_spinfo_state {
693 SCTP_INACTIVE,
694 SCTP_PF,
695 SCTP_ACTIVE,
696 SCTP_UNCONFIRMED,
697 SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
698};
699
700/*
701 * 7.2.1 Association Status (SCTP_STATUS)
702 *
703 * Applications can retrieve current status information about an
704 * association, including association state, peer receiver window size,
705 * number of unacked data chunks, and number of data chunks pending
706 * receipt. This information is read-only. The following structure is
707 * used to access this information:
708 */
709struct sctp_status {
710 sctp_assoc_t sstat_assoc_id;
711 __s32 sstat_state;
712 __u32 sstat_rwnd;
713 __u16 sstat_unackdata;
714 __u16 sstat_penddata;
715 __u16 sstat_instrms;
716 __u16 sstat_outstrms;
717 __u32 sstat_fragmentation_point;
718 struct sctp_paddrinfo sstat_primary;
719};
720
721/*
722 * 7.2.3. Get the list of chunks the peer requires to be authenticated
723 * (SCTP_PEER_AUTH_CHUNKS)
724 *
725 * This option gets a list of chunks for a specified association that
726 * the peer requires to be received authenticated only.
727 */
728struct sctp_authchunks {
729 sctp_assoc_t gauth_assoc_id;
730 __u32 gauth_number_of_chunks;
731 uint8_t gauth_chunks[];
732};
733
734/* The broken spelling has been released already in lksctp-tools header,
735 * so don't break anyone, now that it's fixed.
736 */
737#define guth_number_of_chunks gauth_number_of_chunks
738
739/* Association states. */
740enum sctp_sstat_state {
741 SCTP_EMPTY = 0,
742 SCTP_CLOSED = 1,
743 SCTP_COOKIE_WAIT = 2,
744 SCTP_COOKIE_ECHOED = 3,
745 SCTP_ESTABLISHED = 4,
746 SCTP_SHUTDOWN_PENDING = 5,
747 SCTP_SHUTDOWN_SENT = 6,
748 SCTP_SHUTDOWN_RECEIVED = 7,
749 SCTP_SHUTDOWN_ACK_SENT = 8,
750};
751
752/*
753 * 8.2.6. Get the Current Identifiers of Associations
754 * (SCTP_GET_ASSOC_ID_LIST)
755 *
756 * This option gets the current list of SCTP association identifiers of
757 * the SCTP associations handled by a one-to-many style socket.
758 */
759struct sctp_assoc_ids {
760 __u32 gaids_number_of_ids;
761 sctp_assoc_t gaids_assoc_id[];
762};
763
764/*
765 * 8.3, 8.5 get all peer/local addresses in an association.
766 * This parameter struct is used by SCTP_GET_PEER_ADDRS and
767 * SCTP_GET_LOCAL_ADDRS socket options used internally to implement
768 * sctp_getpaddrs() and sctp_getladdrs() API.
769 */
770struct sctp_getaddrs_old {
771 sctp_assoc_t assoc_id;
772 int addr_num;
773#ifdef __KERNEL__
774 struct sockaddr __user *addrs;
775#else
776 struct sockaddr *addrs;
777#endif
778};
779
780struct sctp_getaddrs {
781 sctp_assoc_t assoc_id; /*input*/
782 __u32 addr_num; /*output*/
783 __u8 addrs[0]; /*output, variable size*/
784};
785
786/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
787 * association stats. All stats are counts except sas_maxrto and
788 * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since
789 * the last call. Will return 0 when RTO was not update since last call
790 */
791struct sctp_assoc_stats {
792 sctp_assoc_t sas_assoc_id; /* Input */
793 /* Transport of observed max RTO */
794 struct sockaddr_storage sas_obs_rto_ipaddr;
795 __u64 sas_maxrto; /* Maximum Observed RTO for period */
796 __u64 sas_isacks; /* SACKs received */
797 __u64 sas_osacks; /* SACKs sent */
798 __u64 sas_opackets; /* Packets sent */
799 __u64 sas_ipackets; /* Packets received */
800 __u64 sas_rtxchunks; /* Retransmitted Chunks */
801 __u64 sas_outofseqtsns;/* TSN received > next expected */
802 __u64 sas_idupchunks; /* Dups received (ordered+unordered) */
803 __u64 sas_gapcnt; /* Gap Acknowledgements Received */
804 __u64 sas_ouodchunks; /* Unordered data chunks sent */
805 __u64 sas_iuodchunks; /* Unordered data chunks received */
806 __u64 sas_oodchunks; /* Ordered data chunks sent */
807 __u64 sas_iodchunks; /* Ordered data chunks received */
808 __u64 sas_octrlchunks; /* Control chunks sent */
809 __u64 sas_ictrlchunks; /* Control chunks received */
810};
811
812/* These are bit fields for msghdr->msg_flags. See section 5.1. */
813/* On user space Linux, these live in <bits/socket.h> as an enum. */
814enum sctp_msg_flags {
815 MSG_NOTIFICATION = 0x8000,
816#define MSG_NOTIFICATION MSG_NOTIFICATION
817};
818
819/*
820 * 8.1 sctp_bindx()
821 *
822 * The flags parameter is formed from the bitwise OR of zero or more of the
823 * following currently defined flags:
824 */
825#define SCTP_BINDX_ADD_ADDR 0x01
826#define SCTP_BINDX_REM_ADDR 0x02
827
828/* This is the structure that is passed as an argument(optval) to
829 * getsockopt(SCTP_SOCKOPT_PEELOFF).
830 */
831typedef struct {
832 sctp_assoc_t associd;
833 int sd;
834} sctp_peeloff_arg_t;
835
836/*
837 * Peer Address Thresholds socket option
838 */
839struct sctp_paddrthlds {
840 sctp_assoc_t spt_assoc_id;
841 struct sockaddr_storage spt_address;
842 __u16 spt_pathmaxrxt;
843 __u16 spt_pathpfthld;
844};
845
846#endif /* _UAPI_SCTP_H */
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index b49eab89c9fd..fefdec91c68b 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -202,6 +202,8 @@ enum
202 LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */ 202 LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
203 LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */ 203 LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
204 LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */ 204 LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
205 LINUX_MIB_TCPLOSSPROBES, /* TCPLossProbes */
206 LINUX_MIB_TCPLOSSPROBERECOVERY, /* TCPLossProbeRecovery */
205 LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */ 207 LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
206 LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */ 208 LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
207 LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */ 209 LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
@@ -245,6 +247,7 @@ enum
245 LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */ 247 LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */
246 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */ 248 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
247 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ 249 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
250 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
248 __LINUX_MIB_MAX 251 __LINUX_MIB_MAX
249}; 252};
250 253
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 6b1ead0b0c9d..8d776ebc4829 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -102,7 +102,6 @@ enum {
102#define TCP_QUICKACK 12 /* Block/reenable quick acks */ 102#define TCP_QUICKACK 12 /* Block/reenable quick acks */
103#define TCP_CONGESTION 13 /* Congestion control algorithm */ 103#define TCP_CONGESTION 13 /* Congestion control algorithm */
104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ 104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ 105#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ 106#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */ 107#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
@@ -199,29 +198,4 @@ struct tcp_md5sig {
199 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */ 198 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
200}; 199};
201 200
202/* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */
203#define TCP_COOKIE_MIN 8 /* 64-bits */
204#define TCP_COOKIE_MAX 16 /* 128-bits */
205#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
206
207/* Flags for both getsockopt and setsockopt */
208#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
209#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
210 * supercedes everything. */
211
212/* Flags for getsockopt */
213#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
214#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
215
216/* TCP_COOKIE_TRANSACTIONS data */
217struct tcp_cookie_transactions {
218 __u16 tcpct_flags; /* see above */
219 __u8 __tcpct_pad1; /* zero */
220 __u8 tcpct_cookie_desired; /* bytes */
221 __u16 tcpct_s_data_desired; /* bytes of variable data */
222 __u16 tcpct_used; /* bytes in value */
223 __u8 tcpct_value[TCP_MSS_DEFAULT];
224};
225
226
227#endif /* _UAPI_LINUX_TCP_H */ 201#endif /* _UAPI_LINUX_TCP_H */
diff --git a/include/uapi/linux/vm_sockets.h b/include/uapi/linux/vm_sockets.h
index df91301847ec..b4ed5d895699 100644
--- a/include/uapi/linux/vm_sockets.h
+++ b/include/uapi/linux/vm_sockets.h
@@ -13,12 +13,10 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#ifndef _VM_SOCKETS_H_ 16#ifndef _UAPI_VM_SOCKETS_H
17#define _VM_SOCKETS_H_ 17#define _UAPI_VM_SOCKETS_H
18 18
19#if !defined(__KERNEL__) 19#include <linux/socket.h>
20#include <sys/socket.h>
21#endif
22 20
23/* Option name for STREAM socket buffer size. Use as the option name in 21/* Option name for STREAM socket buffer size. Use as the option name in
24 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that 22 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
@@ -137,14 +135,13 @@
137#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF)) 135#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
138 136
139/* Address structure for vSockets. The address family should be set to 137/* Address structure for vSockets. The address family should be set to
140 * whatever vmci_sock_get_af_value_fd() returns. The structure members should 138 * AF_VSOCK. The structure members should all align on their natural
141 * all align on their natural boundaries without resorting to compiler packing 139 * boundaries without resorting to compiler packing directives. The total size
142 * directives. The total size of this structure should be exactly the same as 140 * of this structure should be exactly the same as that of struct sockaddr.
143 * that of struct sockaddr.
144 */ 141 */
145 142
146struct sockaddr_vm { 143struct sockaddr_vm {
147 sa_family_t svm_family; 144 __kernel_sa_family_t svm_family;
148 unsigned short svm_reserved1; 145 unsigned short svm_reserved1;
149 unsigned int svm_port; 146 unsigned int svm_port;
150 unsigned int svm_cid; 147 unsigned int svm_cid;
@@ -156,8 +153,4 @@ struct sockaddr_vm {
156 153
157#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) 154#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
158 155
159#if defined(__KERNEL__) 156#endif /* _UAPI_VM_SOCKETS_H */
160int vm_sockets_get_local_cid(void);
161#endif
162
163#endif
diff --git a/include/uapi/linux/xfrm.h b/include/uapi/linux/xfrm.h
index 28e493b5b94c..a8cd6a4a2970 100644
--- a/include/uapi/linux/xfrm.h
+++ b/include/uapi/linux/xfrm.h
@@ -297,6 +297,7 @@ enum xfrm_attr_type_t {
297 XFRMA_MARK, /* struct xfrm_mark */ 297 XFRMA_MARK, /* struct xfrm_mark */
298 XFRMA_TFCPAD, /* __u32 */ 298 XFRMA_TFCPAD, /* __u32 */
299 XFRMA_REPLAY_ESN_VAL, /* struct xfrm_replay_esn */ 299 XFRMA_REPLAY_ESN_VAL, /* struct xfrm_replay_esn */
300 XFRMA_SA_EXTRA_FLAGS, /* __u32 */
300 __XFRMA_MAX 301 __XFRMA_MAX
301 302
302#define XFRMA_MAX (__XFRMA_MAX - 1) 303#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -367,6 +368,8 @@ struct xfrm_usersa_info {
367#define XFRM_STATE_ESN 128 368#define XFRM_STATE_ESN 128
368}; 369};
369 370
371#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1
372
370struct xfrm_usersa_id { 373struct xfrm_usersa_id {
371 xfrm_address_t daddr; 374 xfrm_address_t daddr;
372 __be32 spi; 375 __be32 spi;