History

net: sctp: implement rfc6458, 5.3.4. SCTP_SNDINFO cmsg support

This patch implements section 5.3.4. of RFC6458, that is, support for 'SCTP Send Information Structure' (SCTP_SNDINFO) which can be placed into ancillary data cmsghdr structure for sendmsg() calls. The sctp_sndinfo structure is defined as per RFC as below ... struct sctp_sndinfo { uint16_t snd_sid; uint16_t snd_flags; uint32_t snd_ppid; uint32_t snd_context; sctp_assoc_t snd_assoc_id; }; ... and supplied under cmsg_level IPPROTO_SCTP, cmsg_type SCTP_SNDINFO, while cmsg_data[] contains struct sctp_sndinfo. An sctp_sndinfo item always corresponds to the data in msg_iov. Joint work with Daniel Borkmann.

Geir Ola Vaagland committed 12 years ago

Commit 63b94931 parent 1a98c693 files · +79 −23Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/sctp.h+20−2
@@ -154,6 +154,22 @@ struct sctp_sndrcvinfo { · 153 unmodified lines
154154 sctp_assoc_t sinfo_assoc_id;
155155 };
156156
157+/* 5.3.4 SCTP Send Information Structure (SCTP_SNDINFO)
158+ *
159+ * This cmsghdr structure specifies SCTP options for sendmsg().
160+ *
161+ * cmsg_level cmsg_type cmsg_data[]
162+ * ------------ ------------ -------------------
163+ * IPPROTO_SCTP SCTP_SNDINFO struct sctp_sndinfo
164+ */
165+struct sctp_sndinfo {
166+ __u16 snd_sid;
167+ __u16 snd_flags;
168+ __u32 snd_ppid;
169+ __u32 snd_context;
170+ sctp_assoc_t snd_assoc_id;
171+};
172+
157173 /*
158174 * sinfo_flags: 16 bits (unsigned integer)
159175 *
@@ -177,10 +193,12 @@ typedef union { · 17 unmodified lines
177193
178194 /* These are cmsg_types. */
179195 typedef enum sctp_cmsg_type {
180− SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */
196+ SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */
181197 #define SCTP_INIT SCTP_INIT
182− SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */
198+ SCTP_SNDRCV, /* 5.2.2 SCTP Header Information Structure */
183199 #define SCTP_SNDRCV SCTP_SNDRCV
200+ SCTP_SNDINFO, /* 5.3.4 SCTP Send Information Structure */
201+#define SCTP_SNDINFO SCTP_SNDINFO
184202 } sctp_cmsg_t;
185203
186204 /*