1 /* SCTP kernel implementation
2  * (C) Copyright Red Hat Inc. 2017
3  *
4  * These are definitions used by the stream schedulers, defined in RFC
5  * draft ndata (https://tools.ietf.org/html/draft-ietf-tsvwg-sctp-ndata-11)
6  *
7  * This SCTP implementation is free software;
8  * you can redistribute it and/or modify it under the terms of
9  * the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * This SCTP implementation  is distributed in the hope that it
14  * will be useful, but WITHOUT ANY WARRANTY; without even the implied
15  *                 ************************
16  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17  * See the GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with GNU CC; see the file COPYING.  If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  * Please send any bug reports or fixes you make to the
24  * email addresses:
25  *    lksctp developers <linux-sctp@vger.kernel.org>
26  *
27  * Written or modified by:
28  *   Xin Long <lucien.xin@gmail.com>
29  */
30 
31 #ifndef __sctp_stream_interleave_h__
32 #define __sctp_stream_interleave_h__
33 
34 struct sctp_stream_interleave {
35 	__u16	data_chunk_len;
36 	__u16	ftsn_chunk_len;
37 	/* (I-)DATA process */
38 	struct sctp_chunk *(*make_datafrag)(const struct sctp_association *asoc,
39 					    const struct sctp_sndrcvinfo *sinfo,
40 					    int len, __u8 flags, gfp_t gfp);
41 	void	(*assign_number)(struct sctp_chunk *chunk);
42 	bool	(*validate_data)(struct sctp_chunk *chunk);
43 	int	(*ulpevent_data)(struct sctp_ulpq *ulpq,
44 				 struct sctp_chunk *chunk, gfp_t gfp);
45 	int	(*enqueue_event)(struct sctp_ulpq *ulpq,
46 				 struct sctp_ulpevent *event);
47 	void	(*renege_events)(struct sctp_ulpq *ulpq,
48 				 struct sctp_chunk *chunk, gfp_t gfp);
49 	void	(*start_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
50 	void	(*abort_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
51 	/* (I-)FORWARD-TSN process */
52 	void	(*generate_ftsn)(struct sctp_outq *q, __u32 ctsn);
53 	bool	(*validate_ftsn)(struct sctp_chunk *chunk);
54 	void	(*report_ftsn)(struct sctp_ulpq *ulpq, __u32 ftsn);
55 	void	(*handle_ftsn)(struct sctp_ulpq *ulpq,
56 			       struct sctp_chunk *chunk);
57 };
58 
59 void sctp_stream_interleave_init(struct sctp_stream *stream);
60 
61 #endif /* __sctp_stream_interleave_h__ */
62