1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */ 2*4882a593Smuzhiyun /* SCTP kernel implementation 3*4882a593Smuzhiyun * (C) Copyright IBM Corp. 2001, 2004 4*4882a593Smuzhiyun * Copyright (c) 1999-2000 Cisco, Inc. 5*4882a593Smuzhiyun * Copyright (c) 1999-2001 Motorola, Inc. 6*4882a593Smuzhiyun * Copyright (c) 2001 Intel Corp. 7*4882a593Smuzhiyun * Copyright (c) 2001 Nokia, Inc. 8*4882a593Smuzhiyun * Copyright (c) 2001 La Monte H.P. Yarroll 9*4882a593Smuzhiyun * 10*4882a593Smuzhiyun * These are the definitions needed for the sctp_ulpq type. The 11*4882a593Smuzhiyun * sctp_ulpq is the interface between the Upper Layer Protocol, or ULP, 12*4882a593Smuzhiyun * and the core SCTP state machine. This is the component which handles 13*4882a593Smuzhiyun * reassembly and ordering. 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * Please send any bug reports or fixes you make to the 16*4882a593Smuzhiyun * email addresses: 17*4882a593Smuzhiyun * lksctp developers <linux-sctp@vger.kernel.org> 18*4882a593Smuzhiyun * 19*4882a593Smuzhiyun * Written or modified by: 20*4882a593Smuzhiyun * Jon Grimm <jgrimm@us.ibm.com> 21*4882a593Smuzhiyun * La Monte H.P. Yarroll <piggy@acm.org> 22*4882a593Smuzhiyun * Sridhar Samudrala <sri@us.ibm.com> 23*4882a593Smuzhiyun */ 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun #ifndef __sctp_ulpqueue_h__ 26*4882a593Smuzhiyun #define __sctp_ulpqueue_h__ 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun /* A structure to carry information to the ULP (e.g. Sockets API) */ 29*4882a593Smuzhiyun struct sctp_ulpq { 30*4882a593Smuzhiyun char pd_mode; 31*4882a593Smuzhiyun struct sctp_association *asoc; 32*4882a593Smuzhiyun struct sk_buff_head reasm; 33*4882a593Smuzhiyun struct sk_buff_head reasm_uo; 34*4882a593Smuzhiyun struct sk_buff_head lobby; 35*4882a593Smuzhiyun }; 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun /* Prototypes. */ 38*4882a593Smuzhiyun struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, 39*4882a593Smuzhiyun struct sctp_association *); 40*4882a593Smuzhiyun void sctp_ulpq_flush(struct sctp_ulpq *ulpq); 41*4882a593Smuzhiyun void sctp_ulpq_free(struct sctp_ulpq *); 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun /* Add a new DATA chunk for processing. */ 44*4882a593Smuzhiyun int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun /* Add a new event for propagation to the ULP. */ 47*4882a593Smuzhiyun int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sk_buff_head *skb_list); 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun /* Renege previously received chunks. */ 50*4882a593Smuzhiyun void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun /* Perform partial delivery. */ 53*4882a593Smuzhiyun void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t); 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun /* Abort the partial delivery. */ 56*4882a593Smuzhiyun void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun /* Clear the partial data delivery condition on this socket. */ 59*4882a593Smuzhiyun int sctp_clear_pd(struct sock *sk, struct sctp_association *asoc); 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun /* Skip over an SSN. */ 62*4882a593Smuzhiyun void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn); 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32); 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun __u16 sctp_ulpq_renege_list(struct sctp_ulpq *ulpq, 67*4882a593Smuzhiyun struct sk_buff_head *list, __u16 needed); 68*4882a593Smuzhiyun 69*4882a593Smuzhiyun #endif /* __sctp_ulpqueue_h__ */ 70