summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-01-17 19:44:47 +0300
committerDavid S. Miller <davem@davemloft.net>2017-01-18 22:55:11 +0300
commit7f9d68ac944e24ee5f9ac8d059ca00b1c1d34137 (patch)
tree08007191a5e6a018f08dd26919305175b5a14b23 /include
parent9fb657aec0e20b4ed4401c44a4140f8d7b7a9ca0 (diff)
downloadlinux-7f9d68ac944e24ee5f9ac8d059ca00b1c1d34137.tar.xz
sctp: implement sender-side procedures for SSN Reset Request Parameter
This patch is to implement sender-side procedures for the Outgoing and Incoming SSN Reset Request Parameter described in rfc6525 section 5.1.2 and 5.1.3. It is also add sockopt SCTP_RESET_STREAMS in rfc6525 section 6.3.2 for users. Note that the new asoc member strreset_outstanding is to make sure only one reconf request chunk on the fly as rfc6525 section 5.1.1 demands. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/sctp/sctp.h6
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/uapi/linux/sctp.h11
3 files changed, 18 insertions, 0 deletions
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index bc0e049b1474..3cfd365bcfbc 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -194,6 +194,12 @@ void sctp_remaddr_proc_exit(struct net *net);
int sctp_offload_init(void);
/*
+ * sctp/stream.c
+ */
+int sctp_send_reset_streams(struct sctp_association *asoc,
+ struct sctp_reset_streams *params);
+
+/*
* Module global variables
*/
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index d99b76e33b2e..231fa9ac50bd 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1875,6 +1875,7 @@ struct sctp_association {
reconf_enable:1;
__u8 strreset_enable;
+ __u8 strreset_outstanding; /* request param count on the fly */
__u32 strreset_outseq; /* Update after receiving response */
__u32 strreset_inseq; /* Update after receiving request */
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index 867be0f32fd7..03c27cefffb1 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -116,6 +116,7 @@ typedef __s32 sctp_assoc_t;
#define SCTP_DEFAULT_PRINFO 114
#define SCTP_PR_ASSOC_STATUS 115
#define SCTP_ENABLE_STREAM_RESET 118
+#define SCTP_RESET_STREAMS 119
/* PR-SCTP policies */
#define SCTP_PR_SCTP_NONE 0x0000
@@ -145,6 +146,9 @@ typedef __s32 sctp_assoc_t;
#define SCTP_ENABLE_CHANGE_ASSOC_REQ 0x04
#define SCTP_ENABLE_STRRESET_MASK 0x07
+#define SCTP_STREAM_RESET_INCOMING 0x01
+#define SCTP_STREAM_RESET_OUTGOING 0x02
+
/* These are bit fields for msghdr->msg_flags. See section 5.1. */
/* On user space Linux, these live in <bits/socket.h> as an enum. */
enum sctp_msg_flags {
@@ -1015,4 +1019,11 @@ struct sctp_info {
__u32 __reserved3;
};
+struct sctp_reset_streams {
+ sctp_assoc_t srs_assoc_id;
+ uint16_t srs_flags;
+ uint16_t srs_number_streams; /* 0 == ALL */
+ uint16_t srs_stream_list[]; /* list if srs_num_streams is not 0 */
+};
+
#endif /* _UAPI_SCTP_H */