]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sctp: add support for generating stream reconf ssn/tsn reset request chunk
authorXin Long <lucien.xin@gmail.com>
Wed, 8 Feb 2017 17:18:17 +0000 (01:18 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Feb 2017 21:57:38 +0000 (16:57 -0500)
This patch is to define SSN/TSN Reset Request Parameter described
in rfc6525 section 4.3.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/sctp.h
include/net/sctp/sm.h
net/sctp/sm_make_chunk.c

index d74fca3f3141299d2481d2d756ab862ff5cad36b..71c0d41d9a596702302953718ef441dcc228eafd 100644 (file)
@@ -737,4 +737,9 @@ struct sctp_strreset_inreq {
        __u16 list_of_streams[0];
 };
 
+struct sctp_strreset_tsnreq {
+       sctp_paramhdr_t param_hdr;
+       __u32 request_seq;
+};
+
 #endif /* __LINUX_SCTP_H__ */
index 430ed139fbbb4d96503f3c608851f125f871b770..ac37c1782e237f8888b4da88f920cb7a9a069ab3 100644 (file)
@@ -265,6 +265,8 @@ struct sctp_chunk *sctp_make_strreset_req(
                                const struct sctp_association *asoc,
                                __u16 stream_num, __u16 *stream_list,
                                bool out, bool in);
+struct sctp_chunk *sctp_make_strreset_tsnreq(
+                               const struct sctp_association *asoc);
 void sctp_chunk_assign_tsn(struct sctp_chunk *);
 void sctp_chunk_assign_ssn(struct sctp_chunk *);
 
index c7d3249f88ec1c6d451663d09b81bac2ae1acca9..749842aead3366a5a5fea1f4782a5abf3533e3b7 100644 (file)
@@ -3658,3 +3658,32 @@ struct sctp_chunk *sctp_make_strreset_req(
 
        return retval;
 }
+
+/* RE-CONFIG 4.3 (SSN/TSN RESET ALL)
+ *   0                   1                   2                   3
+ *   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *  |     Parameter Type = 15       |      Parameter Length = 8     |
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *  |         Re-configuration Request Sequence Number              |
+ *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+struct sctp_chunk *sctp_make_strreset_tsnreq(
+                               const struct sctp_association *asoc)
+{
+       struct sctp_strreset_tsnreq tsnreq;
+       __u16 length = sizeof(tsnreq);
+       struct sctp_chunk *retval;
+
+       retval = sctp_make_reconf(asoc, length);
+       if (!retval)
+               return NULL;
+
+       tsnreq.param_hdr.type = SCTP_PARAM_RESET_TSN_REQUEST;
+       tsnreq.param_hdr.length = htons(length);
+       tsnreq.request_seq = htonl(asoc->strreset_outseq);
+
+       sctp_addto_chunk(retval, sizeof(tsnreq), &tsnreq);
+
+       return retval;
+}