18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/* SCTP kernel implementation
38c2ecf20Sopenharmony_ci * (C) Copyright IBM Corp. 2001, 2004
48c2ecf20Sopenharmony_ci * Copyright (c) 1999-2000 Cisco, Inc.
58c2ecf20Sopenharmony_ci * Copyright (c) 1999-2001 Motorola, Inc.
68c2ecf20Sopenharmony_ci * Copyright (c) 2001 Intel Corp.
78c2ecf20Sopenharmony_ci * Copyright (c) 2001 Nokia, Inc.
88c2ecf20Sopenharmony_ci * Copyright (c) 2001 La Monte H.P. Yarroll
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * These are the definitions needed for the sctp_ulpq type.  The
118c2ecf20Sopenharmony_ci * sctp_ulpq is the interface between the Upper Layer Protocol, or ULP,
128c2ecf20Sopenharmony_ci * and the core SCTP state machine.  This is the component which handles
138c2ecf20Sopenharmony_ci * reassembly and ordering.
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * Please send any bug reports or fixes you make to the
168c2ecf20Sopenharmony_ci * email addresses:
178c2ecf20Sopenharmony_ci *    lksctp developers <linux-sctp@vger.kernel.org>
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * Written or modified by:
208c2ecf20Sopenharmony_ci *   Jon Grimm             <jgrimm@us.ibm.com>
218c2ecf20Sopenharmony_ci *   La Monte H.P. Yarroll <piggy@acm.org>
228c2ecf20Sopenharmony_ci *   Sridhar Samudrala     <sri@us.ibm.com>
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#ifndef __sctp_ulpqueue_h__
268c2ecf20Sopenharmony_ci#define __sctp_ulpqueue_h__
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/* A structure to carry information to the ULP (e.g. Sockets API) */
298c2ecf20Sopenharmony_cistruct sctp_ulpq {
308c2ecf20Sopenharmony_ci	char pd_mode;
318c2ecf20Sopenharmony_ci	struct sctp_association *asoc;
328c2ecf20Sopenharmony_ci	struct sk_buff_head reasm;
338c2ecf20Sopenharmony_ci	struct sk_buff_head reasm_uo;
348c2ecf20Sopenharmony_ci	struct sk_buff_head lobby;
358c2ecf20Sopenharmony_ci};
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* Prototypes. */
388c2ecf20Sopenharmony_cistruct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
398c2ecf20Sopenharmony_ci				 struct sctp_association *);
408c2ecf20Sopenharmony_civoid sctp_ulpq_flush(struct sctp_ulpq *ulpq);
418c2ecf20Sopenharmony_civoid sctp_ulpq_free(struct sctp_ulpq *);
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci/* Add a new DATA chunk for processing. */
448c2ecf20Sopenharmony_ciint sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* Add a new event for propagation to the ULP. */
478c2ecf20Sopenharmony_ciint sctp_ulpq_tail_event(struct sctp_ulpq *, struct sk_buff_head *skb_list);
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/* Renege previously received chunks.  */
508c2ecf20Sopenharmony_civoid sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci/* Perform partial delivery. */
538c2ecf20Sopenharmony_civoid sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t);
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/* Abort the partial delivery. */
568c2ecf20Sopenharmony_civoid sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t);
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci/* Clear the partial data delivery condition on this socket. */
598c2ecf20Sopenharmony_ciint sctp_clear_pd(struct sock *sk, struct sctp_association *asoc);
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci/* Skip over an SSN. */
628c2ecf20Sopenharmony_civoid sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn);
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_civoid sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *, __u32);
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci__u16 sctp_ulpq_renege_list(struct sctp_ulpq *ulpq,
678c2ecf20Sopenharmony_ci			    struct sk_buff_head *list, __u16 needed);
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#endif /* __sctp_ulpqueue_h__ */
70