History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next

Pull networking updates from David Miller: "Highlights (1721 non-merge commits, this has to be a record of some sort): 1) Add 'random' mode to team driver, from Jiri Pirko and Eric Dumazet. 2) Make it so that any driver that supports configuration of multiple MAC addresses can provide the forwarding database add and del calls by providing a default implementation and hooking that up if the driver doesn't have an explicit set of handlers. From Vlad Yasevich. 3) Support GSO segmentation over tunnels and other encapsulating devices such as VXLAN, from Pravin B Shelar. 4) Support L2 GRE tunnels in the flow dissector, from Michael Dalton. 5) Implement Tail Loss Probe (TLP) detection in TCP, from Nandita Dukkipati. 6) In the PHY layer, allow supporting wake-on-lan in situations where the PHY registers have to be written for it to be configured. Use it to support wake-on-lan in mv643xx_eth. From Michael Stapelberg. 7) Significantly improve firewire IPV6 support, from YOSHIFUJI Hideaki. 8) Allow multiple packets to be sent in a single transmission using network coding in batman-adv, from Martin Hundebøll. 9) Add support for T5 cxgb4 chips, from Santosh Rastapur. 10) Generalize the VXLAN forwarding tables so that there is more flexibility in configurating various aspects of the endpoints. From David Stevens. 11) Support RSS and TSO in hardware over GRE tunnels in bxn2x driver, from Dmitry Kravkov. 12) Zero copy support in nfnelink_queue, from Eric Dumazet and Pablo Neira Ayuso. 13) Start adding networking selftests. 14) In situations of overload on the same AF_PACKET fanout socket, or per-cpu packet receive queue, minimize drop by distributing the load to other cpus/fanouts. From Willem de Bruijn and Eric Dumazet. 15) Add support for new payload offset BPF instruction, from Daniel Borkmann. 16) Convert several drivers over to mdoule_platform_driver(), from Sachin Kamat. 17) Provide a minimal BPF JIT image disassembler userspace tool, from Daniel Borkmann. 18) Rewrite F-RTO implementation in TCP to match the final specification of it in RFC4138 and RFC5682. From Yuchung Cheng. 19) Provide netlink socket diag of netlink sockets ("Yo dawg, I hear you like netlink, so I implemented netlink dumping of netlink sockets.") From Andrey Vagin. 20) Remove ugly passing of rtnetlink attributes into rtnl_doit functions, from Thomas Graf. 21) Allow userspace to be able to see if a configuration change occurs in the middle of an address or device list dump, from Nicolas Dichtel. 22) Support RFC3168 ECN protection for ipv6 fragments, from Hannes Frederic Sowa. 23) Increase accuracy of packet length used by packet scheduler, from Jason Wang. 24) Beginning set of changes to make ipv4/ipv6 fragment handling more scalable and less susceptible to overload and locking contention, from Jesper Dangaard Brouer. 25) Get rid of using non-type-safe NLMSG_* macros and use nlmsg_*() instead. From Hong Zhiguo. 26) Optimize route usage in IPVS by avoiding reference counting where possible, from Julian Anastasov. 27) Convert IPVS schedulers to RCU, also from Julian Anastasov. 28) Support cpu fanouts in xt_NFQUEUE netfilter target, from Holger Eitzenberger. 29) Network namespace support for nf_log, ebt_log, xt_LOG, ipt_ULOG, nfnetlink_log, and nfnetlink_queue. From Gao feng. 30) Implement RFC3168 ECN protection, from Hannes Frederic Sowa. 31) Support several new r8169 chips, from Hayes Wang. 32) Support tokenized interface identifiers in ipv6, from Daniel Borkmann. 33) Use usbnet_link_change() helper in USB net driver, from Ming Lei. 34) Add 802.1ad vlan offload support, from Patrick McHardy. 35) Support mmap() based netlink communication, also from Patrick McHardy. 36) Support HW timestamping in mlx4 driver, from Amir Vadai. 37) Rationalize AF_PACKET packet timestamping when transmitting, from Willem de Bruijn and Daniel Borkmann. 38) Bring parity to what's provided by /proc/net/packet socket dumping and the info provided by netlink socket dumping of AF_PACKET sockets. From Nicolas Dichtel. 39) Fix peeking beyond zero sized SKBs in AF_UNIX, from Benjamin Poirier" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits) filter: fix va_list build error af_unix: fix a fatal race with bit fields bnx2x: Prevent memory leak when cnic is absent bnx2x: correct reading of speed capabilities net: sctp: attribute printl with __printf for gcc fmt checks netlink: kconfig: move mmap i/o into netlink kconfig netpoll: convert mutex into a semaphore netlink: Fix skb ref counting. net_sched: act_ipt forward compat with xtables mlx4_en: fix a build error on 32bit arches Revert "bnx2x: allow nvram test to run when device is down" bridge: avoid OOPS if root port not found drivers: net: cpsw: fix kernel warn on cpsw irq enable sh_eth: use random MAC address if no valid one supplied 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) tg3: fix to append hardware time stamping flags unix/stream: fix peeking with an offset larger than data in queue unix/dgram: fix peeking with an offset larger than data in queue unix/dgram: peek beyond 0-sized skbs openvswitch: Remove unneeded ovs_netdev_get_ifindex() ...

Linus Torvalds committed 13 years ago

Commit 73287a42 parents 251df49 20074f31506 files · +86375 −37075Browse files

Showing the changes to include/uapi (29 of 1506 files). Show all

Unified · Split

29 files
  1. include/uapi/asm-generic/socket.h +2 −0
  2. include/uapi/linux/Kbuild +2 −0
  3. include/uapi/linux/caif/caif_socket.h +1 −1
  4. include/uapi/linux/caif/if_caif.h +1 −1
  5. include/uapi/linux/cn_proc.h +9 −1
  6. include/uapi/linux/filter.h +2 −1
  7. include/uapi/linux/if_ether.h +3 −0
  8. include/uapi/linux/if_link.h +5 −2
  9. include/uapi/linux/if_packet.h +18 −11
  10. include/uapi/linux/ip_vs.h +2 −2
  11. include/uapi/linux/neighbour.h +3 −0
  12. include/uapi/linux/netfilter/ipset/ip_set.h +32 −4
  13. include/uapi/linux/netfilter/nfnetlink_queue.h +9 −1
  14. include/uapi/linux/netfilter/xt_NFQUEUE.h +9 −0
  15. include/uapi/linux/netfilter/xt_set.h +9 −0
  16. include/uapi/linux/netfilter_ipv6/ip6t_frag.h +2 −2
  17. include/uapi/linux/netlink.h +33 −1
  18. include/uapi/linux/netlink_diag.h +52 −0
  19. include/uapi/linux/nfc.h +19 −0
  20. include/uapi/linux/nl80211.h +145 −11
  21. include/uapi/linux/openvswitch.h +456 −0
  22. include/uapi/linux/packet_diag.h +5 −0
  23. include/uapi/linux/pkt_sched.h +1 −0
  24. include/uapi/linux/rfkill.h +2 −0
  25. include/uapi/linux/sctp.h +846 −0
  26. include/uapi/linux/snmp.h +8 −0
  27. include/uapi/linux/tcp.h +0 −26
  28. include/uapi/linux/vm_sockets.h +8 −15
  29. include/uapi/linux/xfrm.h +3 −0
include/uapi/asm-generic/socket.h+2−0
@@ -74,4 +74,6 @@ · 73 unmodified lines
7474
7575 #define SO_LOCK_FILTER 44
7676
77+#define SO_SELECT_ERR_QUEUE 45
78+
7779 #endif /* __ASM_GENERIC_SOCKET_H */
include/uapi/linux/Kbuild+2−0
@@ -285,6 +285,7 @@ header-y += nvram.h · 284 unmodified lines
285285 header-y += omap3isp.h
286286 header-y += omapfb.h
287287 header-y += oom.h
288+header-y += openvswitch.h
288289 header-y += packet_diag.h
289290 header-y += param.h
290291 header-y += parport.h
@@ -331,6 +332,7 @@ header-y += rtnetlink.h · 40 unmodified lines
331332 header-y += scc.h
332333 header-y += sched.h
333334 header-y += screen_info.h
335+header-y += sctp.h
334336 header-y += sdla.h
335337 header-y += seccomp.h
336338 header-y += securebits.h
include/uapi/linux/caif/caif_socket.h+1−1
@@ -1,7 +1,7 @@
11 /* linux/caif_socket.h
22 * CAIF Definitions for CAIF socket and network layer
33 * Copyright (C) ST-Ericsson AB 2010
4− * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com
4+ * Author: Sjur Brendeland
55 * License terms: GNU General Public License (GPL) version 2
66 */
77
include/uapi/linux/caif/if_caif.h+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) ST-Ericsson AB 2010
3− * Author: Sjur Brendeland/ sjur.brandeland@stericsson.com
3+ * Author: Sjur Brendeland
44 * License terms: GNU General Public License (GPL) version 2
55 */
66
include/uapi/linux/cn_proc.h+9−1
@@ -56,7 +56,9 @@ struct proc_event { · 55 unmodified lines
5656 PROC_EVENT_PTRACE = 0x00000100,
5757 PROC_EVENT_COMM = 0x00000200,
5858 /* "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,
6062 PROC_EVENT_EXIT = 0x80000000
6163 } what;
6264 __u32 cpu;
@@ -110,11 +112,17 @@ struct proc_event { · 47 unmodified lines
110112 char comm[16];
111113 } comm;
112114
115+ struct coredump_proc_event {
116+ __kernel_pid_t process_pid;
117+ __kernel_pid_t process_tgid;
118+ } coredump;
119+
113120 struct exit_proc_event {
114121 __kernel_pid_t process_pid;
115122 __kernel_pid_t process_tgid;
116123 __u32 exit_code, exit_signal;
117124 } exit;
125+
118126 } event_data;
119127 };
120128
include/uapi/linux/filter.h+2−1
@@ -129,7 +129,8 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ · 128 unmodified lines
129129 #define SKF_AD_ALU_XOR_X 40
130130 #define SKF_AD_VLAN_TAG 44
131131 #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
133134 #define SKF_NET_OFF (-0x100000)
134135 #define SKF_LL_OFF (-0x200000)
135136
include/uapi/linux/if_ether.h+3−0
@@ -94,6 +94,9 @@ · 93 unmodified lines
9494 #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
9595 #define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
9696
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+
97100 /*
98101 * Non DIX types. Won't clash for 1500 types.
99102 */
include/uapi/linux/if_link.h+5−2
@@ -201,6 +201,7 @@ enum { · 200 unmodified lines
201201 IFLA_INET6_MCAST, /* MC things. What of them? */
202202 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
203203 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
204+ IFLA_INET6_TOKEN, /* device token */
204205 __IFLA_INET6_MAX
205206 };
206207
@@ -249,6 +250,7 @@ enum { · 42 unmodified lines
249250 IFLA_VLAN_FLAGS,
250251 IFLA_VLAN_EGRESS_QOS,
251252 IFLA_VLAN_INGRESS_QOS,
253+ IFLA_VLAN_PROTOCOL,
252254 __IFLA_VLAN_MAX,
253255 };
254256
@@ -295,7 +297,7 @@ enum macvlan_mode { · 40 unmodified lines
295297 enum {
296298 IFLA_VXLAN_UNSPEC,
297299 IFLA_VXLAN_ID,
298− IFLA_VXLAN_GROUP,
300+ IFLA_VXLAN_GROUP, /* group or remote address */
299301 IFLA_VXLAN_LINK,
300302 IFLA_VXLAN_LOCAL,
301303 IFLA_VXLAN_TTL,
@@ -303,11 +305,12 @@ enum { · 1 unmodified line
303305 IFLA_VXLAN_LEARNING,
304306 IFLA_VXLAN_AGEING,
305307 IFLA_VXLAN_LIMIT,
306− IFLA_VXLAN_PORT_RANGE,
308+ IFLA_VXLAN_PORT_RANGE, /* source port */
307309 IFLA_VXLAN_PROXY,
308310 IFLA_VXLAN_RSC,
309311 IFLA_VXLAN_L2MISS,
310312 IFLA_VXLAN_L3MISS,
313+ IFLA_VXLAN_PORT, /* destination port */
311314 __IFLA_VXLAN_MAX
312315 };
313316 #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
include/uapi/linux/if_packet.h+18−11
@@ -55,6 +55,8 @@ struct sockaddr_ll { · 54 unmodified lines
5555 #define PACKET_FANOUT_HASH 0
5656 #define PACKET_FANOUT_LB 1
5757 #define PACKET_FANOUT_CPU 2
58+#define PACKET_FANOUT_ROLLOVER 3
59+#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
5860 #define PACKET_FANOUT_FLAG_DEFRAG 0x8000
5961
6062 struct tpacket_stats {
@@ -84,19 +86,24 @@ struct tpacket_auxdata { · 23 unmodified lines
8486 };
8587
8688 /* Rx ring - header status */
87−#define TP_STATUS_KERNEL 0x0
88−#define TP_STATUS_USER 0x1
89−#define TP_STATUS_COPY 0x2
90−#define TP_STATUS_LOSING 0x4
91−#define TP_STATUS_CSUMNOTREADY 0x8
92−#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */
93−#define TP_STATUS_BLK_TMO 0x20
89+#define TP_STATUS_KERNEL 0
90+#define TP_STATUS_USER (1 << 0)
91+#define TP_STATUS_COPY (1 << 1)
92+#define TP_STATUS_LOSING (1 << 2)
93+#define TP_STATUS_CSUMNOTREADY (1 << 3)
94+#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
95+#define TP_STATUS_BLK_TMO (1 << 5)
9496
9597 /* Tx ring - header status */
96−#define TP_STATUS_AVAILABLE 0x0
97−#define TP_STATUS_SEND_REQUEST 0x1
98−#define TP_STATUS_SENDING 0x2
99−#define TP_STATUS_WRONG_FORMAT 0x4
98+#define TP_STATUS_AVAILABLE 0
99+#define TP_STATUS_SEND_REQUEST (1 << 0)
100+#define TP_STATUS_SENDING (1 << 1)
101+#define TP_STATUS_WRONG_FORMAT (1 << 2)
102+
103+/* Rx and Tx ring - header status */
104+#define TP_STATUS_TS_SOFTWARE (1 << 29)
105+#define TP_STATUS_TS_SYS_HARDWARE (1 << 30)
106+#define TP_STATUS_TS_RAW_HARDWARE (1 << 31)
100107
101108 /* Rx ring - feature request bits */
102109 #define TP_FT_REQ_FILL_RXHASH 0x1
include/uapi/linux/ip_vs.h+2−2
@@ -280,8 +280,8 @@ struct ip_vs_daemon_user { · 279 unmodified lines
280280 #define IPVS_GENL_VERSION 0x1
281281
282282 struct ip_vs_flags {
283− __be32 flags;
284− __be32 mask;
283+ __u32 flags;
284+ __u32 mask;
285285 };
286286
287287 /* Generic Netlink command attributes */
include/uapi/linux/neighbour.h+3−0
@@ -21,6 +21,9 @@ enum { · 20 unmodified lines
2121 NDA_CACHEINFO,
2222 NDA_PROBES,
2323 NDA_VLAN,
24+ NDA_PORT,
25+ NDA_VNI,
26+ NDA_IFINDEX,
2427 __NDA_MAX
2528 };
2629
include/uapi/linux/netfilter/ipset/ip_set.h+32−4
@@ -108,6 +108,8 @@ enum { · 107 unmodified lines
108108 IPSET_ATTR_CIDR2,
109109 IPSET_ATTR_IP2_TO,
110110 IPSET_ATTR_IFACE,
111+ IPSET_ATTR_BYTES,
112+ IPSET_ATTR_PACKETS,
111113 __IPSET_ATTR_ADT_MAX,
112114 };
113115 #define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
@@ -137,12 +139,13 @@ enum ipset_errno { · 23 unmodified lines
137139 IPSET_ERR_REFERENCED,
138140 IPSET_ERR_IPADDR_IPV4,
139141 IPSET_ERR_IPADDR_IPV6,
142+ IPSET_ERR_COUNTER,
140143
141144 /* Type specific error codes */
142145 IPSET_ERR_TYPE_SPECIFIC = 4352,
143146 };
144147
145−/* Flags at command level */
148+/* Flags at command level or match/target flags, lower half of cmdattrs*/
146149 enum ipset_cmd_flags {
147150 IPSET_FLAG_BIT_EXIST = 0,
148151 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
@@ -150,10 +153,20 @@ enum ipset_cmd_flags { · 1 unmodified line
150153 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
151154 IPSET_FLAG_BIT_LIST_HEADER = 2,
152155 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
153− IPSET_FLAG_CMD_MAX = 15, /* Lower half */
156+ IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE = 3,
157+ IPSET_FLAG_SKIP_COUNTER_UPDATE =
158+ (1 << IPSET_FLAG_BIT_SKIP_COUNTER_UPDATE),
159+ IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE = 4,
160+ IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE =
161+ (1 << IPSET_FLAG_BIT_SKIP_SUBCOUNTER_UPDATE),
162+ IPSET_FLAG_BIT_MATCH_COUNTERS = 5,
163+ IPSET_FLAG_MATCH_COUNTERS = (1 << IPSET_FLAG_BIT_MATCH_COUNTERS),
164+ IPSET_FLAG_BIT_RETURN_NOMATCH = 7,
165+ IPSET_FLAG_RETURN_NOMATCH = (1 << IPSET_FLAG_BIT_RETURN_NOMATCH),
166+ IPSET_FLAG_CMD_MAX = 15,
154167 };
155168
156−/* Flags at CADT attribute level */
169+/* Flags at CADT attribute level, upper half of cmdattrs */
157170 enum ipset_cadt_flags {
158171 IPSET_FLAG_BIT_BEFORE = 0,
159172 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
@@ -161,7 +174,9 @@ enum ipset_cadt_flags { · 1 unmodified line
161174 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
162175 IPSET_FLAG_BIT_NOMATCH = 2,
163176 IPSET_FLAG_NOMATCH = (1 << IPSET_FLAG_BIT_NOMATCH),
164− IPSET_FLAG_CADT_MAX = 15, /* Upper half */
177+ IPSET_FLAG_BIT_WITH_COUNTERS = 3,
178+ IPSET_FLAG_WITH_COUNTERS = (1 << IPSET_FLAG_BIT_WITH_COUNTERS),
179+ IPSET_FLAG_CADT_MAX = 15,
165180 };
166181
167182 /* Commands with settype-specific attributes */
@@ -190,6 +205,7 @@ enum ip_set_dim { · 22 unmodified lines
190205 * If changed, new revision of iptables match/target is required.
191206 */
192207 IPSET_DIM_MAX = 6,
208+ /* Backward compatibility: set match revision 2 */
193209 IPSET_BIT_RETURN_NOMATCH = 7,
194210 };
195211
@@ -202,6 +218,18 @@ enum ip_set_kopt { · 6 unmodified lines
202218 IPSET_RETURN_NOMATCH = (1 << IPSET_BIT_RETURN_NOMATCH),
203219 };
204220
221+enum {
222+ IPSET_COUNTER_NONE = 0,
223+ IPSET_COUNTER_EQ,
224+ IPSET_COUNTER_NE,
225+ IPSET_COUNTER_LT,
226+ IPSET_COUNTER_GT,
227+};
228+
229+struct ip_set_counter_match {
230+ __u8 op;
231+ __u64 value;
232+};
205233
206234 /* Interface to iptables/ip6tables */
207235
include/uapi/linux/netfilter/nfnetlink_queue.h+9−1
@@ -45,6 +45,7 @@ enum nfqnl_attr_type { · 44 unmodified lines
4545 NFQA_CT, /* nf_conntrack_netlink.h */
4646 NFQA_CT_INFO, /* enum ip_conntrack_info */
4747 NFQA_CAP_LEN, /* __u32 length of captured packet */
48+ NFQA_SKB_INFO, /* __u32 skb meta information */
4849
4950 __NFQA_MAX
5051 };
@@ -96,6 +97,13 @@ enum nfqnl_attr_config { · 45 unmodified lines
9697 /* Flags for NFQA_CFG_FLAGS */
9798 #define NFQA_CFG_F_FAIL_OPEN (1 << 0)
9899 #define NFQA_CFG_F_CONNTRACK (1 << 1)
99−#define NFQA_CFG_F_MAX (1 << 2)
100+#define NFQA_CFG_F_GSO (1 << 2)
101+#define NFQA_CFG_F_MAX (1 << 3)
102+
103+/* flags for NFQA_SKB_INFO */
104+/* packet appears to have wrong checksums, but they are ok */
105+#define NFQA_SKB_CSUMNOTREADY (1 << 0)
106+/* packet is GSO (i.e., exceeds device mtu) */
107+#define NFQA_SKB_GSO (1 << 1)
100108
101109 #endif /* _NFNETLINK_QUEUE_H */
include/uapi/linux/netfilter/xt_NFQUEUE.h+9−0
@@ -26,4 +26,13 @@ struct xt_NFQ_info_v2 { · 25 unmodified lines
2626 __u16 bypass;
2727 };
2828
29+struct 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+
2938 #endif /* _XT_NFQ_TARGET_H */
include/uapi/linux/netfilter/xt_set.h+9−0
@@ -62,4 +62,13 @@ struct xt_set_info_target_v2 { · 61 unmodified lines
6262 __u32 timeout;
6363 };
6464
65+/* Revision 3 match */
66+
67+struct xt_set_info_match_v3 {
68+ struct xt_set_info match_set;
69+ struct ip_set_counter_match packets;
70+ struct ip_set_counter_match bytes;
71+ __u32 flags;
72+};
73+
6574 #endif /*_XT_SET_H*/
include/uapi/linux/netfilter_ipv6/ip6t_frag.h+2−2
@@ -4,9 +4,9 @@ · 3 unmodified lines
44 #include <linux/types.h>
55
66 struct ip6t_frag {
7− __u32 ids[2]; /* Security Parameter Index */
7+ __u32 ids[2]; /* Identification range */
88 __u32 hdrlen; /* Header Length */
9− __u8 flags; /* */
9+ __u8 flags; /* Flags */
1010 __u8 invflags; /* Inverse flags */
1111 };
1212
include/uapi/linux/netlink.h+33−1
@@ -1,6 +1,7 @@
11 #ifndef _UAPI__LINUX_NETLINK_H
22 #define _UAPI__LINUX_NETLINK_H
33
4+#include <linux/kernel.h>
45 #include <linux/socket.h> /* for __kernel_sa_family_t */
56 #include <linux/types.h>
67
@@ -78,7 +79,7 @@ struct nlmsghdr { · 71 unmodified lines
7879 #define NLMSG_ALIGNTO 4U
7980 #define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
8081 #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)
8283 #define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
8384 #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
8485 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
@@ -105,11 +106,42 @@ struct nlmsgerr { · 20 unmodified lines
105106 #define NETLINK_PKTINFO 3
106107 #define NETLINK_BROADCAST_ERROR 4
107108 #define NETLINK_NO_ENOBUFS 5
109+#define NETLINK_RX_RING 6
110+#define NETLINK_TX_RING 7
108111
109112 struct nl_pktinfo {
110113 __u32 group;
111114 };
112115
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+
113145 #define NET_MAJOR 36 /* Major 36 is reserved for networking */
114146
115147 enum {
include/uapi/linux/netlink_diag.h+52−0
@@ -0,0 +1,52 @@
1+#ifndef __NETLINK_DIAG_H__
2+#define __NETLINK_DIAG_H__
3+
4+#include <linux/types.h>
5+
6+struct 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+
15+struct 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+
28+struct 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+
35+enum {
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
include/uapi/linux/nfc.h+19−0
@@ -90,6 +90,8 @@ enum nfc_commands { · 89 unmodified lines
9090 NFC_CMD_LLC_SET_PARAMS,
9191 NFC_CMD_ENABLE_SE,
9292 NFC_CMD_DISABLE_SE,
93+ NFC_CMD_LLC_SDREQ,
94+ NFC_EVENT_LLC_SDRES,
9395 /* private: internal use only */
9496 __NFC_CMD_AFTER_LAST
9597 };
@@ -140,11 +142,21 @@ enum nfc_attrs { · 44 unmodified lines
140142 NFC_ATTR_LLC_PARAM_RW,
141143 NFC_ATTR_LLC_PARAM_MIUX,
142144 NFC_ATTR_SE,
145+ NFC_ATTR_LLC_SDP,
143146 /* private: internal use only */
144147 __NFC_ATTR_AFTER_LAST
145148 };
146149 #define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
147150
151+enum 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+
148160 #define NFC_DEVICE_NAME_MAXSIZE 8
149161 #define NFC_NFCID1_MAXSIZE 10
150162 #define NFC_SENSB_RES_MAXSIZE 12
@@ -220,4 +232,11 @@ struct sockaddr_nfc_llcp { · 69 unmodified lines
220232 #define NFC_LLCP_DIRECTION_RX 0x00
221233 #define NFC_LLCP_DIRECTION_TX 0x01
222234
235+/* socket option names */
236+#define NFC_LLCP_RW 0
237+#define NFC_LLCP_MIUX 1
238+#define NFC_LLCP_REMOTE_MIU 2
239+#define NFC_LLCP_REMOTE_LTO 3
240+#define NFC_LLCP_REMOTE_RW 4
241+
223242 #endif /*__LINUX_NFC_H */
include/uapi/linux/nl80211.h+145−11
@@ -36,7 +36,21 @@ · 35 unmodified lines
3636 * The station is still assumed to belong to the AP interface it was added
3737 * to.
3838 *
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
4054 */
4155
4256 /**
@@ -499,9 +513,11 @@ · 456 unmodified lines
499513 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
500514 * beacon or probe response from a compatible mesh peer. This is only
501515 * sent while no station information (sta_info) exists for the new peer
502− * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set. On
503− * reception of this notification, userspace may decide to create a new
504− * station (@NL80211_CMD_NEW_STATION). To stop this notification from
516+ * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
517+ * @NL80211_MESH_SETUP_USERSPACE_AMPE, or
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
505521 * reoccurring, the userspace authentication daemon may want to create the
506522 * new station with the AUTHENTICATED flag unset and maybe change it later
507523 * depending on the authentication result.
@@ -611,6 +627,25 @@ · 103 unmodified lines
611627 * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
612628 * event.
613629 *
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+ *
642+ * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running
643+ * a critical protocol that needs more reliability in the connection to
644+ * complete.
645+ *
646+ * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
647+ * return back to normal.
648+ *
614649 * @NL80211_CMD_MAX: highest used command number
615650 * @__NL80211_CMD_AFTER_LAST: internal use
616651 */
@@ -765,6 +800,14 @@ enum nl80211_commands { · 148 unmodified lines
765800
766801 NL80211_CMD_RADAR_DETECT,
767802
803+ NL80211_CMD_GET_PROTOCOL_FEATURES,
804+
805+ NL80211_CMD_UPDATE_FT_IES,
806+ NL80211_CMD_FT_EVENT,
807+
808+ NL80211_CMD_CRIT_PROTOCOL_START,
809+ NL80211_CMD_CRIT_PROTOCOL_STOP,
810+
768811 /* add new commands above here */
769812
770813 /* used to define NL80211_CMD_MAX below */
@@ -884,7 +927,8 @@ enum nl80211_commands { · 113 unmodified lines
884927 * consisting of a nested array.
885928 *
886929 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
887− * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link.
930+ * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
931+ * (see &enum nl80211_plink_action).
888932 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
889933 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
890934 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
@@ -1167,10 +1211,10 @@ enum nl80211_commands { · 276 unmodified lines
11671211 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
11681212 * allows auth frames in a mesh to be passed to userspace for processing via
11691213 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
1170− * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as
1171− * defined in &enum nl80211_plink_state. Used when userspace is
1172− * driving the peer link management state machine.
1173− * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled.
1214+ * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
1215+ * &enum nl80211_plink_state. Used when userspace is driving the peer link
1216+ * management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or
1217+ * @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
11741218 *
11751219 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
11761220 * capabilities, the supported WoWLAN triggers
@@ -1368,6 +1412,23 @@ enum nl80211_commands { · 191 unmodified lines
13681412 * advertised to the driver, e.g., to enable TDLS off channel operations
13691413 * and PU-APSD.
13701414 *
1415+ * @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
1416+ * &enum nl80211_protocol_features, the attribute is a u32.
1417+ *
1418+ * @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
1419+ * receiving the data for a single wiphy split across multiple
1420+ * messages, given with wiphy dump message
1421+ *
1422+ * @NL80211_ATTR_MDID: Mobility Domain Identifier
1423+ *
1424+ * @NL80211_ATTR_IE_RIC: Resource Information Container Information
1425+ * Element
1426+ *
1427+ * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased
1428+ * reliability, see &enum nl80211_crit_proto_id (u16).
1429+ * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
1430+ * the connection should have increased reliability (u16).
1431+ *
13711432 * @NL80211_ATTR_MAX: highest attribute number currently defined
13721433 * @__NL80211_ATTR_AFTER_LAST: internal use
13731434 */
@@ -1654,6 +1715,18 @@ enum nl80211_attrs { · 280 unmodified lines
16541715 NL80211_ATTR_STA_CAPABILITY,
16551716 NL80211_ATTR_STA_EXT_CAPABILITY,
16561717
1718+ NL80211_ATTR_PROTOCOL_FEATURES,
1719+ NL80211_ATTR_SPLIT_WIPHY_DUMP,
1720+
1721+ NL80211_ATTR_DISABLE_VHT,
1722+ NL80211_ATTR_VHT_CAPABILITY_MASK,
1723+
1724+ NL80211_ATTR_MDID,
1725+ NL80211_ATTR_IE_RIC,
1726+
1727+ NL80211_ATTR_CRIT_PROT_ID,
1728+ NL80211_ATTR_MAX_CRIT_PROT_DURATION,
1729+
16571730 /* add attributes here, update the policy in nl80211.c */
16581731
16591732 __NL80211_ATTR_AFTER_LAST,
@@ -2412,8 +2485,10 @@ enum nl80211_mesh_power_mode { · 752 unmodified lines
24122485 * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
24132486 * point.
24142487 *
2415− * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically
2416− * open peer links when we detect compatible mesh peers.
2488+ * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open
2489+ * peer links when we detect compatible mesh peers. Disabled if
2490+ * @NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE are
2491+ * set.
24172492 *
24182493 * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
24192494 * containing a PREQ that an MP can send to a particular destination (path
@@ -2559,6 +2634,9 @@ enum nl80211_meshconf_params { · 139 unmodified lines
25592634 * vendor specific synchronization method or disable it to use the default
25602635 * neighbor offset synchronization
25612636 *
2637+ * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
2638+ * implement an MPM which handles peer allocation and state.
2639+ *
25622640 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
25632641 *
25642642 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
@@ -2571,6 +2649,7 @@ enum nl80211_mesh_setup_params { · 6 unmodified lines
25712649 NL80211_MESH_SETUP_USERSPACE_AUTH,
25722650 NL80211_MESH_SETUP_USERSPACE_AMPE,
25732651 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
2652+ NL80211_MESH_SETUP_USERSPACE_MPM,
25742653
25752654 /* keep last */
25762655 __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
@@ -3307,6 +3386,23 @@ enum nl80211_plink_state { · 730 unmodified lines
33073386 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
33083387 };
33093388
3389+/**
3390+ * enum nl80211_plink_action - actions to perform in mesh peers
3391+ *
3392+ * @NL80211_PLINK_ACTION_NO_ACTION: perform no action
3393+ * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
3394+ * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
3395+ * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
3396+ */
3397+enum plink_actions {
3398+ NL80211_PLINK_ACTION_NO_ACTION,
3399+ NL80211_PLINK_ACTION_OPEN,
3400+ NL80211_PLINK_ACTION_BLOCK,
3401+
3402+ NUM_NL80211_PLINK_ACTIONS,
3403+};
3404+
3405+
33103406 #define NL80211_KCK_LEN 16
33113407 #define NL80211_KEK_LEN 16
33123408 #define NL80211_REPLAY_CTR_LEN 8
@@ -3456,6 +3552,10 @@ enum nl80211_ap_sme_features { · 143 unmodified lines
34563552 * stations the authenticated/associated bits have to be set in the mask.
34573553 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
34583554 * (HT40, VHT 80/160 MHz) if this flag is set
3555+ * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
3556+ * Peering Management entity which may be implemented by registering for
3557+ * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
3558+ * still generated by the driver.
34593559 */
34603560 enum nl80211_feature_flags {
34613561 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3474,6 +3574,7 @@ enum nl80211_feature_flags { · 12 unmodified lines
34743574 /* bit 13 is reserved */
34753575 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
34763576 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3577+ NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
34773578 };
34783579
34793580 /**
@@ -3587,4 +3688,37 @@ enum nl80211_dfs_state { · 107 unmodified lines
35873688 NL80211_DFS_AVAILABLE,
35883689 };
35893690
3691+/**
3692+ * enum enum nl80211_protocol_features - nl80211 protocol features
3693+ * @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
3694+ * wiphy dumps (if requested by the application with the attribute
3695+ * %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
3696+ * wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or
3697+ * %NL80211_ATTR_WDEV.
3698+ */
3699+enum nl80211_protocol_features {
3700+ NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0,
3701+};
3702+
3703+/**
3704+ * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers
3705+ *
3706+ * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified.
3707+ * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol.
3708+ * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol.
3709+ * @NL80211_CRIT_PROTO_APIPA: APIPA protocol.
3710+ * @NUM_NL80211_CRIT_PROTO: must be kept last.
3711+ */
3712+enum nl80211_crit_proto_id {
3713+ NL80211_CRIT_PROTO_UNSPEC,
3714+ NL80211_CRIT_PROTO_DHCP,
3715+ NL80211_CRIT_PROTO_EAPOL,
3716+ NL80211_CRIT_PROTO_APIPA,
3717+ /* add other protocols before this one */
3718+ NUM_NL80211_CRIT_PROTO
3719+};
3720+
3721+/* maximum duration for critical protocol measures */
3722+#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
3723+
35903724 #endif /* __LINUX_NL80211_H */
include/uapi/linux/openvswitch.h+456−0
@@ -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+
35+struct 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+
45+enum 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+ */
70+enum 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+
80+struct 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+
87+struct 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+
106+enum 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+ */
138+enum 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+
155+enum 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+
163+enum 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+ */
201+enum 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+
220+enum 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+
228+struct ovs_flow_stats {
229+ __u64 n_packets; /* Number of matched packets. */
230+ __u64 n_bytes; /* Number of matched bytes. */
231+};
232+
233+enum 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+ */
264+enum 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+
273+struct ovs_key_ethernet {
274+ __u8 eth_src[ETH_ALEN];
275+ __u8 eth_dst[ETH_ALEN];
276+};
277+
278+struct 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+
287+struct 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+
297+struct ovs_key_tcp {
298+ __be16 tcp_src;
299+ __be16 tcp_dst;
300+};
301+
302+struct ovs_key_udp {
303+ __be16 udp_src;
304+ __be16 udp_dst;
305+};
306+
307+struct ovs_key_icmp {
308+ __u8 icmp_type;
309+ __u8 icmp_code;
310+};
311+
312+struct ovs_key_icmpv6 {
313+ __u8 icmpv6_type;
314+ __u8 icmpv6_code;
315+};
316+
317+struct 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+
325+struct 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+ */
357+enum 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+ */
382+enum 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+ */
398+enum 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+ */
418+struct 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+
443+enum 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 */
include/uapi/linux/packet_diag.h+5−0
@@ -16,6 +16,8 @@ struct packet_diag_req { · 15 unmodified lines
1616 #define PACKET_SHOW_MCLIST 0x00000002 /* A set of packet_diag_mclist-s */
1717 #define PACKET_SHOW_RING_CFG 0x00000004 /* Rings configuration parameters */
1818 #define PACKET_SHOW_FANOUT 0x00000008
19+#define PACKET_SHOW_MEMINFO 0x00000010
20+#define PACKET_SHOW_FILTER 0x00000020
1921
2022 struct packet_diag_msg {
2123 __u8 pdiag_family;
@@ -32,6 +34,9 @@ enum { · 10 unmodified lines
3234 PACKET_DIAG_RX_RING,
3335 PACKET_DIAG_TX_RING,
3436 PACKET_DIAG_FANOUT,
37+ PACKET_DIAG_UID,
38+ PACKET_DIAG_MEMINFO,
39+ PACKET_DIAG_FILTER,
3540
3641 __PACKET_DIAG_MAX,
3742 };
include/uapi/linux/pkt_sched.h+1−0
@@ -348,6 +348,7 @@ enum { · 347 unmodified lines
348348 TCA_HTB_INIT,
349349 TCA_HTB_CTAB,
350350 TCA_HTB_RTAB,
351+ TCA_HTB_DIRECT_QLEN,
351352 __TCA_HTB_MAX,
352353 };
353354
include/uapi/linux/rfkill.h+2−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
3838 * @RFKILL_TYPE_GPS: switch is on a GPS device.
3939 * @RFKILL_TYPE_FM: switch is on a FM radio device.
40+ * @RFKILL_TYPE_NFC: switch is on an NFC device.
4041 * @NUM_RFKILL_TYPES: number of defined rfkill types
4142 */
4243 enum rfkill_type {
@@ -48,6 +49,7 @@ enum rfkill_type { · 5 unmodified lines
4849 RFKILL_TYPE_WWAN,
4950 RFKILL_TYPE_GPS,
5051 RFKILL_TYPE_FM,
52+ RFKILL_TYPE_NFC,
5153 NUM_RFKILL_TYPES,
5254 };
5355
include/uapi/linux/sctp.h+846−0
@@ -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+
60+typedef __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+ */
127+struct 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+ */
146+struct 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+
165+enum 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+
173+typedef 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. */
180+typedef 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+ */
196+struct 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+ */
217+enum 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+ */
232+struct 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+ */
248+enum 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+ */
268+struct 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+ */
284+struct 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+ */
306+enum 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+ */
317+struct 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+ */
331+struct 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+ */
346+struct 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+
354+enum { 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+ */
362+struct 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+
372+enum { 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+ */
382+struct 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+ */
393+struct 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+ */
413+union 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+
435+enum 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+ */
464+typedef 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+ */
481+struct 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+ */
494+struct 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+ */
511+struct 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+ */
524+struct 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+ */
538+struct 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+ */
552+enum 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+
566+struct 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+ */
583+struct 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+ */
597+enum {
598+ SCTP_AUTH_HMAC_ID_SHA1 = 1,
599+ SCTP_AUTH_HMAC_ID_SHA256 = 3,
600+};
601+#endif
602+
603+struct 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+ */
619+struct 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+
633+struct 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+ */
653+struct sctp_sack_info {
654+ sctp_assoc_t sack_assoc_id;
655+ uint32_t sack_delay;
656+ uint32_t sack_freq;
657+};
658+
659+struct 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+ */
673+struct 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+ */
692+enum 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+ */
709+struct 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+ */
728+struct 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. */
740+enum 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+ */
759+struct 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+ */
770+struct 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+
780+struct 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+ */
791+struct 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. */
814+enum 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+ */
831+typedef struct {
832+ sctp_assoc_t associd;
833+ int sd;
834+} sctp_peeloff_arg_t;
835+
836+/*
837+ * Peer Address Thresholds socket option
838+ */
839+struct 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 */
include/uapi/linux/snmp.h+8−0
@@ -50,6 +50,7 @@ enum · 49 unmodified lines
5050 IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */
5151 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */
5252 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */
53+ IPSTATS_MIB_CSUMERRORS, /* InCsumErrors */
5354 __IPSTATS_MIB_MAX
5455 };
5556
@@ -87,6 +88,7 @@ enum · 31 unmodified lines
8788 ICMP_MIB_OUTTIMESTAMPREPS, /* OutTimestampReps */
8889 ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
8990 ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
91+ ICMP_MIB_CSUMERRORS, /* InCsumErrors */
9092 __ICMP_MIB_MAX
9193 };
9294
@@ -103,6 +105,7 @@ enum · 10 unmodified lines
103105 ICMP6_MIB_INERRORS, /* InErrors */
104106 ICMP6_MIB_OUTMSGS, /* OutMsgs */
105107 ICMP6_MIB_OUTERRORS, /* OutErrors */
108+ ICMP6_MIB_CSUMERRORS, /* InCsumErrors */
106109 __ICMP6_MIB_MAX
107110 };
108111
@@ -130,6 +133,7 @@ enum · 21 unmodified lines
130133 TCP_MIB_RETRANSSEGS, /* RetransSegs */
131134 TCP_MIB_INERRS, /* InErrs */
132135 TCP_MIB_OUTRSTS, /* OutRsts */
136+ TCP_MIB_CSUMERRORS, /* InCsumErrors */
133137 __TCP_MIB_MAX
134138 };
135139
@@ -147,6 +151,7 @@ enum · 11 unmodified lines
147151 UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
148152 UDP_MIB_RCVBUFERRORS, /* RcvbufErrors */
149153 UDP_MIB_SNDBUFERRORS, /* SndbufErrors */
154+ UDP_MIB_CSUMERRORS, /* InCsumErrors */
150155 __UDP_MIB_MAX
151156 };
152157
@@ -202,6 +207,8 @@ enum · 49 unmodified lines
202207 LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
203208 LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
204209 LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
210+ LINUX_MIB_TCPLOSSPROBES, /* TCPLossProbes */
211+ LINUX_MIB_TCPLOSSPROBERECOVERY, /* TCPLossProbeRecovery */
205212 LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
206213 LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
207214 LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
@@ -245,6 +252,7 @@ enum · 37 unmodified lines
245252 LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */
246253 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
247254 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
255+ LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
248256 __LINUX_MIB_MAX
249257 };
250258
include/uapi/linux/tcp.h+0−26
@@ -102,7 +102,6 @@ enum { · 101 unmodified lines
102102 #define TCP_QUICKACK 12 /* Block/reenable quick acks */
103103 #define TCP_CONGESTION 13 /* Congestion control algorithm */
104104 #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105−#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106105 #define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107106 #define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108107 #define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
@@ -199,29 +198,4 @@ struct tcp_md5sig { · 90 unmodified lines
199198 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
200199 };
201200
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 */
217−struct 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−
227201 #endif /* _UAPI_LINUX_TCP_H */
include/uapi/linux/vm_sockets.h+8−15
@@ -13,12 +13,10 @@ · 12 unmodified lines
1313 * more details.
1414 */
1515
16−#ifndef _VM_SOCKETS_H_
17−#define _VM_SOCKETS_H_
16+#ifndef _UAPI_VM_SOCKETS_H
17+#define _UAPI_VM_SOCKETS_H
1818
19−#if !defined(__KERNEL__)
20−#include <sys/socket.h>
21−#endif
19+#include <linux/socket.h>
2220
2321 /* Option name for STREAM socket buffer size. Use as the option name in
2422 * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that
@@ -137,14 +135,13 @@ · 112 unmodified lines
137135 #define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
138136
139137 /* Address structure for vSockets. The address family should be set to
140− * whatever vmci_sock_get_af_value_fd() returns. The structure members should
141− * all align on their natural boundaries without resorting to compiler packing
142− * directives. The total size of this structure should be exactly the same as
143− * that of struct sockaddr.
138+ * AF_VSOCK. The structure members should all align on their natural
139+ * boundaries without resorting to compiler packing directives. The total size
140+ * of this structure should be exactly the same as that of struct sockaddr.
144141 */
145142
146143 struct sockaddr_vm {
147− sa_family_t svm_family;
144+ __kernel_sa_family_t svm_family;
148145 unsigned short svm_reserved1;
149146 unsigned int svm_port;
150147 unsigned int svm_cid;
@@ -156,8 +153,4 @@ struct sockaddr_vm { · 5 unmodified lines
156153
157154 #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
158155
159−#if defined(__KERNEL__)
160−int vm_sockets_get_local_cid(void);
161−#endif
162−
163−#endif
156+#endif /* _UAPI_VM_SOCKETS_H */
include/uapi/linux/xfrm.h+3−0
@@ -297,6 +297,7 @@ enum xfrm_attr_type_t { · 296 unmodified lines
297297 XFRMA_MARK, /* struct xfrm_mark */
298298 XFRMA_TFCPAD, /* __u32 */
299299 XFRMA_REPLAY_ESN_VAL, /* struct xfrm_replay_esn */
300+ XFRMA_SA_EXTRA_FLAGS, /* __u32 */
300301 __XFRMA_MAX
301302
302303 #define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -367,6 +368,8 @@ struct xfrm_usersa_info { · 64 unmodified lines
367368 #define XFRM_STATE_ESN 128
368369 };
369370
371+#define XFRM_SA_XFLAG_DONT_ENCAP_DSCP 1
372+
370373 struct xfrm_usersa_id {
371374 xfrm_address_t daddr;
372375 __be32 spi;