Loading...
1/* SCTP kernel implementation
2 * (C) Copyright IBM Corp. 2001, 2004
3 * Copyright (c) 1999-2000 Cisco, Inc.
4 * Copyright (c) 1999-2001 Motorola, Inc.
5 * Copyright (c) 2001 Intel Corp.
6 * Copyright (c) 2001 Nokia, Inc.
7 * Copyright (c) 2001 La Monte H.P. Yarroll
8 *
9 * These are the definitions needed for the sctp_ulpq type. The
10 * sctp_ulpq is the interface between the Upper Layer Protocol, or ULP,
11 * and the core SCTP state machine. This is the component which handles
12 * reassembly and ordering.
13 *
14 * This SCTP implementation is free software;
15 * you can redistribute it and/or modify it under the terms of
16 * the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This SCTP implementation is distributed in the hope that it
21 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
22 * ************************
23 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * See the GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with GNU CC; see the file COPYING. If not, see
28 * <http://www.gnu.org/licenses/>.
29 *
30 * Please send any bug reports or fixes you make to the
31 * email addresses:
32 * lksctp developers <linux-sctp@vger.kernel.org>
33 *
34 * Written or modified by:
35 * Jon Grimm <jgrimm@us.ibm.com>
36 * La Monte H.P. Yarroll <piggy@acm.org>
37 * Sridhar Samudrala <sri@us.ibm.com>
38 */
39
40#ifndef __sctp_ulpqueue_h__
41#define __sctp_ulpqueue_h__
42
43/* A structure to carry information to the ULP (e.g. Sockets API) */
44struct sctp_ulpq {
45 char pd_mode;
46 struct sctp_association *asoc;
47 struct sk_buff_head reasm;
48 struct sk_buff_head lobby;
49};
50
51/* Prototypes. */
52struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
53 struct sctp_association *);
54void sctp_ulpq_flush(struct sctp_ulpq *ulpq);
55void sctp_ulpq_free(struct sctp_ulpq *);
56
57/* Add a new DATA chunk for processing. */
58int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
59
60/* Add a new event for propagation to the ULP. */
61int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev);
62
63/* Renege previously received chunks. */
64void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
65
66/* Perform partial delivery. */
67void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t);
68
69/* Abort the partial delivery. */
70void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t);
71
72/* Clear the partial data delivery condition on this socket. */
73int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc);
74
75/* Skip over an SSN. */
76void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn);
77
78void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32);
79#endif /* __sctp_ulpqueue_h__ */
80
81
82
83
84
85
86
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/* SCTP kernel implementation
3 * (C) Copyright IBM Corp. 2001, 2004
4 * Copyright (c) 1999-2000 Cisco, Inc.
5 * Copyright (c) 1999-2001 Motorola, Inc.
6 * Copyright (c) 2001 Intel Corp.
7 * Copyright (c) 2001 Nokia, Inc.
8 * Copyright (c) 2001 La Monte H.P. Yarroll
9 *
10 * These are the definitions needed for the sctp_ulpq type. The
11 * sctp_ulpq is the interface between the Upper Layer Protocol, or ULP,
12 * and the core SCTP state machine. This is the component which handles
13 * reassembly and ordering.
14 *
15 * Please send any bug reports or fixes you make to the
16 * email addresses:
17 * lksctp developers <linux-sctp@vger.kernel.org>
18 *
19 * Written or modified by:
20 * Jon Grimm <jgrimm@us.ibm.com>
21 * La Monte H.P. Yarroll <piggy@acm.org>
22 * Sridhar Samudrala <sri@us.ibm.com>
23 */
24
25#ifndef __sctp_ulpqueue_h__
26#define __sctp_ulpqueue_h__
27
28/* A structure to carry information to the ULP (e.g. Sockets API) */
29struct sctp_ulpq {
30 char pd_mode;
31 struct sctp_association *asoc;
32 struct sk_buff_head reasm;
33 struct sk_buff_head reasm_uo;
34 struct sk_buff_head lobby;
35};
36
37/* Prototypes. */
38struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
39 struct sctp_association *);
40void sctp_ulpq_flush(struct sctp_ulpq *ulpq);
41void sctp_ulpq_free(struct sctp_ulpq *);
42
43/* Add a new DATA chunk for processing. */
44int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
45
46/* Add a new event for propagation to the ULP. */
47int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sk_buff_head *skb_list);
48
49/* Renege previously received chunks. */
50void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
51
52/* Perform partial delivery. */
53void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t);
54
55/* Abort the partial delivery. */
56void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t);
57
58/* Clear the partial data delivery condition on this socket. */
59int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc);
60
61/* Skip over an SSN. */
62void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn);
63
64void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32);
65
66__u16 sctp_ulpq_renege_list(struct sctp_ulpq *ulpq,
67 struct sk_buff_head *list, __u16 needed);
68
69#endif /* __sctp_ulpqueue_h__ */