Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 1 | /* SCTP kernel implementation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | * |
Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 14 | * This SCTP implementation is free software; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | * |
Vlad Yasevich | 60c778b | 2008-01-11 09:57:09 -0500 | [diff] [blame] | 20 | * This SCTP implementation is distributed in the hope that it |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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, write to |
| 28 | * the Free Software Foundation, 59 Temple Place - Suite 330, |
| 29 | * Boston, MA 02111-1307, USA. |
| 30 | * |
| 31 | * Please send any bug reports or fixes you make to the |
| 32 | * email addresses: |
Daniel Borkmann | 91705c6 | 2013-07-23 14:51:47 +0200 | [diff] [blame] | 33 | * lksctp developers <linux-sctp@vger.kernel.org> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | * Written or modified by: |
| 36 | * Jon Grimm <jgrimm@us.ibm.com> |
| 37 | * La Monte H.P. Yarroll <piggy@acm.org> |
| 38 | * Sridhar Samudrala <sri@us.ibm.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | */ |
| 40 | |
| 41 | #ifndef __sctp_ulpqueue_h__ |
| 42 | #define __sctp_ulpqueue_h__ |
| 43 | |
| 44 | /* A structure to carry information to the ULP (e.g. Sockets API) */ |
| 45 | struct sctp_ulpq { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | char pd_mode; |
| 47 | struct sctp_association *asoc; |
| 48 | struct sk_buff_head reasm; |
| 49 | struct sk_buff_head lobby; |
| 50 | }; |
| 51 | |
| 52 | /* Prototypes. */ |
| 53 | struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, |
| 54 | struct sctp_association *); |
Vlad Yasevich | 0b58a81 | 2007-03-19 17:01:17 -0700 | [diff] [blame] | 55 | void sctp_ulpq_flush(struct sctp_ulpq *ulpq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | void sctp_ulpq_free(struct sctp_ulpq *); |
| 57 | |
| 58 | /* Add a new DATA chunk for processing. */ |
Al Viro | dd0fc66 | 2005-10-07 07:46:04 +0100 | [diff] [blame] | 59 | int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | |
| 61 | /* Add a new event for propagation to the ULP. */ |
| 62 | int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); |
| 63 | |
| 64 | /* Renege previously received chunks. */ |
Al Viro | dd0fc66 | 2005-10-07 07:46:04 +0100 | [diff] [blame] | 65 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
| 67 | /* Perform partial delivery. */ |
Neil Horman | b26ddd8 | 2012-10-29 08:32:13 +0000 | [diff] [blame] | 68 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
| 70 | /* Abort the partial delivery. */ |
Al Viro | dd0fc66 | 2005-10-07 07:46:04 +0100 | [diff] [blame] | 71 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
| 73 | /* Clear the partial data delivery condition on this socket. */ |
Vlad Yasevich | b6e1331 | 2007-04-20 12:23:15 -0700 | [diff] [blame] | 74 | int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
| 76 | /* Skip over an SSN. */ |
| 77 | void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn); |
| 78 | |
Vlad Yasevich | ea2dfb3 | 2007-07-13 17:01:19 -0400 | [diff] [blame] | 79 | void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | #endif /* __sctp_ulpqueue_h__ */ |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |