sctp: add basic structures and make chunk function for ifwdtsn

sctp_ifwdtsn_skip, sctp_ifwdtsn_hdr and sctp_ifwdtsn_chunk are used to
define and parse I-FWD TSN chunk format, and sctp_make_ifwdtsn is a
function to build the chunk.

The I-FORWARD-TSN Chunk Format is defined in section 2.3.1 of RFC8260.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo R. Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Xin Long 2017-12-15 00:41:25 +08:00 committed by David S. Miller
parent 024778095a
commit 2d07a49ade
4 changed files with 45 additions and 0 deletions

View file

@ -110,6 +110,7 @@ enum sctp_cid {
/* Use hex, as defined in ADDIP sec. 3.1 */
SCTP_CID_ASCONF = 0xC1,
SCTP_CID_I_FWD_TSN = 0xC2,
SCTP_CID_ASCONF_ACK = 0x80,
SCTP_CID_RECONF = 0x82,
}; /* enum */
@ -616,6 +617,22 @@ struct sctp_fwdtsn_chunk {
struct sctp_fwdtsn_hdr fwdtsn_hdr;
};
struct sctp_ifwdtsn_skip {
__be16 stream;
__u8 reserved;
__u8 flags;
__be32 mid;
};
struct sctp_ifwdtsn_hdr {
__be32 new_cum_tsn;
struct sctp_ifwdtsn_skip skip[0];
};
struct sctp_ifwdtsn_chunk {
struct sctp_chunkhdr chunk_hdr;
struct sctp_ifwdtsn_hdr fwdtsn_hdr;
};
/* ADDIP
* Section 3.1.1 Address Configuration Change Chunk (ASCONF)