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