blob: e0dce07b87947ca11a1af9b2c8fec10036746633 [file] [log] [blame]
Vlad Yasevich60c778b2008-01-11 09:57:09 -05001/* SCTP kernel implementation
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * (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 *
Vlad Yasevich60c778b2008-01-11 09:57:09 -050014 * This SCTP implementation is free software;
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 * 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 *
Vlad Yasevich60c778b2008-01-11 09:57:09 -050020 * This SCTP implementation is distributed in the hope that it
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 * 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
Jeff Kirsher4b2f13a2013-12-06 06:28:48 -080027 * along with GNU CC; see the file COPYING. If not, see
28 * <http://www.gnu.org/licenses/>.
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 *
30 * Please send any bug reports or fixes you make to the
31 * email addresses:
Daniel Borkmann91705c62013-07-23 14:51:47 +020032 * lksctp developers <linux-sctp@vger.kernel.org>
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 * 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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070038 */
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 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 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 *);
Vlad Yasevich0b58a812007-03-19 17:01:17 -070054void sctp_ulpq_flush(struct sctp_ulpq *ulpq);
Linus Torvalds1da177e2005-04-16 15:20:36 -070055void sctp_ulpq_free(struct sctp_ulpq *);
56
57/* Add a new DATA chunk for processing. */
Al Virodd0fc662005-10-07 07:46:04 +010058int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
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. */
Al Virodd0fc662005-10-07 07:46:04 +010064void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
66/* Perform partial delivery. */
Neil Hormanb26ddd82012-10-29 08:32:13 +000067void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
69/* Abort the partial delivery. */
Al Virodd0fc662005-10-07 07:46:04 +010070void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
72/* Clear the partial data delivery condition on this socket. */
Vlad Yasevichb6e13312007-04-20 12:23:15 -070073int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc);
Linus Torvalds1da177e2005-04-16 15:20:36 -070074
75/* Skip over an SSN. */
76void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn);
77
Vlad Yasevichea2dfb32007-07-13 17:01:19 -040078void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32);
Linus Torvalds1da177e2005-04-16 15:20:36 -070079#endif /* __sctp_ulpqueue_h__ */
80
81
82
83
84
85
86