aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sctp.h17
-rw-r--r--include/net/sctp/sm.h3
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--net/sctp/sm_make_chunk.c24
4 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 38e2cf66195f..b36c76635f18 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -110,6 +110,7 @@ enum sctp_cid {
110 110
111 /* Use hex, as defined in ADDIP sec. 3.1 */ 111 /* Use hex, as defined in ADDIP sec. 3.1 */
112 SCTP_CID_ASCONF = 0xC1, 112 SCTP_CID_ASCONF = 0xC1,
113 SCTP_CID_I_FWD_TSN = 0xC2,
113 SCTP_CID_ASCONF_ACK = 0x80, 114 SCTP_CID_ASCONF_ACK = 0x80,
114 SCTP_CID_RECONF = 0x82, 115 SCTP_CID_RECONF = 0x82,
115}; /* enum */ 116}; /* enum */
@@ -616,6 +617,22 @@ struct sctp_fwdtsn_chunk {
616 struct sctp_fwdtsn_hdr fwdtsn_hdr; 617 struct sctp_fwdtsn_hdr fwdtsn_hdr;
617}; 618};
618 619
620struct sctp_ifwdtsn_skip {
621 __be16 stream;
622 __u8 reserved;
623 __u8 flags;
624 __be32 mid;
625};
626
627struct sctp_ifwdtsn_hdr {
628 __be32 new_cum_tsn;
629 struct sctp_ifwdtsn_skip skip[0];
630};
631
632struct sctp_ifwdtsn_chunk {
633 struct sctp_chunkhdr chunk_hdr;
634 struct sctp_ifwdtsn_hdr fwdtsn_hdr;
635};
619 636
620/* ADDIP 637/* ADDIP
621 * Section 3.1.1 Address Configuration Change Chunk (ASCONF) 638 * Section 3.1.1 Address Configuration Change Chunk (ASCONF)
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 0993b4953b3a..2883c43c5258 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -199,6 +199,9 @@ struct sctp_chunk *sctp_make_cwr(const struct sctp_association *asoc,
199 const struct sctp_chunk *chunk); 199 const struct sctp_chunk *chunk);
200struct sctp_chunk *sctp_make_idata(const struct sctp_association *asoc, 200struct sctp_chunk *sctp_make_idata(const struct sctp_association *asoc,
201 __u8 flags, int paylen, gfp_t gfp); 201 __u8 flags, int paylen, gfp_t gfp);
202struct sctp_chunk *sctp_make_ifwdtsn(const struct sctp_association *asoc,
203 __u32 new_cum_tsn, size_t nstreams,
204 struct sctp_ifwdtsn_skip *skiplist);
202struct sctp_chunk *sctp_make_datafrag_empty(const struct sctp_association *asoc, 205struct sctp_chunk *sctp_make_datafrag_empty(const struct sctp_association *asoc,
203 const struct sctp_sndrcvinfo *sinfo, 206 const struct sctp_sndrcvinfo *sinfo,
204 int len, __u8 flags, gfp_t gfp); 207 int len, __u8 flags, gfp_t gfp);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 8ef638d966f1..a5c3cf41e693 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -599,6 +599,7 @@ struct sctp_chunk {
599 struct sctp_fwdtsn_hdr *fwdtsn_hdr; 599 struct sctp_fwdtsn_hdr *fwdtsn_hdr;
600 struct sctp_authhdr *auth_hdr; 600 struct sctp_authhdr *auth_hdr;
601 struct sctp_idatahdr *idata_hdr; 601 struct sctp_idatahdr *idata_hdr;
602 struct sctp_ifwdtsn_hdr *ifwdtsn_hdr;
602 } subh; 603 } subh;
603 604
604 __u8 *chunk_end; 605 __u8 *chunk_end;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 23a7313d7972..b9b269cf615e 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3536,6 +3536,30 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
3536 return retval; 3536 return retval;
3537} 3537}
3538 3538
3539struct sctp_chunk *sctp_make_ifwdtsn(const struct sctp_association *asoc,
3540 __u32 new_cum_tsn, size_t nstreams,
3541 struct sctp_ifwdtsn_skip *skiplist)
3542{
3543 struct sctp_chunk *retval = NULL;
3544 struct sctp_ifwdtsn_hdr ftsn_hdr;
3545 size_t hint;
3546
3547 hint = (nstreams + 1) * sizeof(__u32);
3548
3549 retval = sctp_make_control(asoc, SCTP_CID_I_FWD_TSN, 0, hint,
3550 GFP_ATOMIC);
3551 if (!retval)
3552 return NULL;
3553
3554 ftsn_hdr.new_cum_tsn = htonl(new_cum_tsn);
3555 retval->subh.ifwdtsn_hdr =
3556 sctp_addto_chunk(retval, sizeof(ftsn_hdr), &ftsn_hdr);
3557
3558 sctp_addto_chunk(retval, nstreams * sizeof(skiplist[0]), skiplist);
3559
3560 return retval;
3561}
3562
3539/* RE-CONFIG 3.1 (RE-CONFIG chunk) 3563/* RE-CONFIG 3.1 (RE-CONFIG chunk)
3540 * 0 1 2 3 3564 * 0 1 2 3
3541 * 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 3565 * 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