net: sctp: introduce uapi header for sctp
Subsystems (4)
PATCH 1/1 net: sctp: introduce uapi header for sctp
This patch introduces an UAPI header for the SCTP protocol, so that we can facilitate the maintenance and development of user land applications or libraries, in particular in terms of header synchronization.
To not break compatibility, some fragments from lksctp-tools' netinet/sctp.h have been carefully included, while taking care that neither kernel nor user land breaks, so both compile fine with this change (for lksctp-tools I tested with the old netinet/sctp.h header and with a newly adapted one that includes the uapi sctp header). lksctp-tools smoke test run through successfully as well in both cases.
--- fs/dlm/lowcomms.c | 2 +- include/linux/sctp.h | 6 +- include/net/sctp/constants.h | 1 - include/net/sctp/user.h | 782 --------------------------------------- include/uapi/linux/Kbuild | 1 + include/uapi/linux/sctp.h | 846 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 850 insertions(+), 788 deletions(-) delete mode 100644 include/net/sctp/user.h create mode 100644 include/uapi/linux/sctp.h
fs/dlm/lowcomms.c +1 -1
@@ -52,8 +52,8 @@#include <linux/mutex.h> #include <linux/sctp.h> #include <linux/slab.h> +#include <linux/sctp.h> #include <net/sctp/sctp.h> -#include <net/sctp/user.h> #include <net/ipv6.h> #include "dlm_internal.h"
include/linux/sctp.h +2 -4
@@ -53,7 +53,9 @@#include <linux/in.h> /* We need in_addr. */ #include <linux/in6.h> /* We need in6_addr. */ +#include <linux/skbuff.h> +#include <uapi/linux/sctp.h> /* Section 3.1. SCTP Common Header Format */ typedef struct sctphdr {
@@ -63,14 +65,10 @@ typedef struct sctphdr {__le32 checksum; }__packed sctp_sctphdr_t; -#ifdef __KERNEL__ -#include <linux/skbuff.h> -static inline struct sctphdr *sctp_hdr (const struct sk_buff *skb) {return (struct sctphdr *)skb_transport_header (skb); } -#endif /* Section 3.2. Chunk Field Descriptions. */ typedef struct sctp_chunkhdr {
include/net/sctp/constants.h +0 -1
@@ -49,7 +49,6 @@#include <linux/sctp.h> #include <linux/ipv6.h> /* For ipv6hdr. */ -#include <net/sctp/user.h> #include <net/tcp_states.h> /* For TCP states used in sctp_sock_state_t */ /* Value used for stream negotiation. */
include/net/sctp/user.h deleted +0 -782
782 lines not on this page · raw message
include/uapi/linux/Kbuild +1 -0
@@ -331,6 +331,7 @@ header-y += rtnetlink.h header-y += scc.h header-y += sched.h header-y += screen_info.h +header-y += sctp.h header-y += sdla.h header-y += seccomp.h header-y += securebits.h
include/uapi/linux/sctp.h new file +846 -0
846 lines not on this page · raw message
Signature · 1 line
1.7.11.7
David Miller
maintainerFrom: Daniel Borkmann <[email protected]>
Date: Tue, 9 Apr 2013 17:54:01 +0200
Quoted 13 lines
This patch introduces an UAPI header for the SCTP protocol, so that we can facilitate the maintenance and development of user land applications or libraries, in particular in terms of header synchronization.
To not break compatibility, some fragments from lksctp-tools'
netinet/sctp.hhave been carefully included, while taking care that neither kernel nor user land breaks, so both compile fine with this change (for lksctp-tools I tested with the oldnetinet/sctp.hheader and with a newly adapted one that includes the uapi sctp header). lksctp-tools smoke test run through successfully as well in both cases.
Quoted 4 lines
Suggested-by Neil Horman <[email protected]>Cc Neil Horman <[email protected]>Cc Vlad Yasevich <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>
This looks great, applied, thanks Daniel.
Quoted 13 lines · Daniel Borkmann
This patch introduces an UAPI header for the SCTP protocol, so that we can facilitate the maintenance and development of user land applications or libraries, in particular in terms of header synchronization.
To not break compatibility, some fragments from lksctp-tools'
netinet/sctp.hhave been carefully included, while taking care that neither kernel nor user land breaks, so both compile fine with this change (for lksctp-tools I tested with the oldnetinet/sctp.hheader and with a newly adapted one that includes the uapi sctp header). lksctp-tools smoke test run through successfully as well in both cases.
Quoted 4 lines
Suggested-by Neil Horman <[email protected]>Cc Neil Horman <[email protected]>Cc Vlad Yasevich <[email protected]>Signed-off-by Daniel Borkmann <[email protected]>
Yup, Thanks Daniel. Davids already applied it, but FWIW