webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
sctp_indata.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3  * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4  * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * a) Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  *
12  * b) Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the distribution.
15  *
16  * c) Neither the name of Cisco Systems, Inc. nor the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30  * THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifdef __FreeBSD__
34 #include <sys/cdefs.h>
35 __FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.h 297663 2016-04-07 09:34:41Z rrs $");
36 #endif
37 
38 #ifndef _NETINET_SCTP_INDATA_H_
39 #define _NETINET_SCTP_INDATA_H_
40 
41 #if defined(_KERNEL) || defined(__Userspace__)
42 
43 struct sctp_queued_to_read *
45  struct sctp_nets *net,
46  uint32_t tsn, uint32_t ppid,
47  uint32_t context, uint16_t stream_no,
48  uint32_t stream_seq, uint8_t flags,
49  struct mbuf *dm);
50 
51 
52 #define sctp_build_readq_entry_mac(_ctl, in_it, context, net, tsn, ppid, stream_no, stream_seq, flags, dm, tfsn, msgid) do { \
53  if (_ctl) { \
54  atomic_add_int(&((net)->ref_count), 1); \
55  memset(_ctl, 0, sizeof(struct sctp_queued_to_read)); \
56  (_ctl)->sinfo_stream = stream_no; \
57  (_ctl)->sinfo_ssn = stream_seq; \
58  TAILQ_INIT(&_ctl->reasm); \
59  (_ctl)->top_fsn = tfsn; \
60  (_ctl)->msg_id = msgid; \
61  (_ctl)->sinfo_flags = (flags << 8); \
62  (_ctl)->sinfo_ppid = ppid; \
63  (_ctl)->sinfo_context = context; \
64  (_ctl)->fsn_included = 0xffffffff; \
65  (_ctl)->top_fsn = 0xffffffff; \
66  (_ctl)->sinfo_tsn = tsn; \
67  (_ctl)->sinfo_cumtsn = tsn; \
68  (_ctl)->sinfo_assoc_id = sctp_get_associd((in_it)); \
69  (_ctl)->whoFrom = net; \
70  (_ctl)->data = dm; \
71  (_ctl)->stcb = (in_it); \
72  (_ctl)->port_from = (in_it)->rport; \
73  } \
74 } while (0)
75 
76 
77 
78 struct mbuf *
80  struct sctp_sndrcvinfo *sinfo);
81 
82 void sctp_set_rwnd(struct sctp_tcb *, struct sctp_association *);
83 
85 sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc);
86 
87 void
88 sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
89  uint32_t rwnd, int *abort_now, int ecne_seen);
90 
91 void
92 sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
93  struct sctp_tcb *stcb,
94  uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup,
95  int *abort_now, uint8_t flags,
96  uint32_t cum_ack, uint32_t rwnd, int ecne_seen);
97 
98 /* draft-ietf-tsvwg-usctp */
99 void
101  struct sctp_forward_tsn_chunk *, int *, struct mbuf *, int);
102 
103 struct sctp_tmit_chunk *
105 
106 void sctp_service_queues(struct sctp_tcb *, struct sctp_association *);
107 
108 void
109 sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *);
110 
111 int
112 sctp_process_data(struct mbuf **, int, int *, int,
113  struct sctp_inpcb *, struct sctp_tcb *,
114  struct sctp_nets *, uint32_t *);
115 
116 void sctp_slide_mapping_arrays(struct sctp_tcb *stcb);
117 
118 void sctp_sack_check(struct sctp_tcb *, int);
119 
120 #endif
121 #endif
Definition: sctp_structs.h:305
Definition: sctp_pcb.h:444
unsigned int uint32_t
Definition: ptypes.h:105
struct sctp_tmit_chunk * sctp_try_advance_peer_ack_point(struct sctp_tcb *stcb, struct sctp_association *asoc)
Definition: sctp_indata.c:3589
const GLfloat * m
Definition: gl2ext.h:850
Definition: sctp_structs.h:514
Definition: sctp_header.h:405
void sctp_slide_mapping_arrays(struct sctp_tcb *stcb)
Definition: sctp_indata.c:2267
Definition: sctp_header.h:327
Definition: quicdatachannel.h:29
unsigned char uint8_t
Definition: ptypes.h:89
Definition: sctp_uio.h:140
unsigned short uint16_t
Definition: ptypes.h:97
int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t *high_tsn)
Definition: sctp_indata.c:2528
Definition: sctp_structs.h:848
void sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap)
Definition: sctp_indata.c:2436
Definition: sctp_pcb.h:614
Definition: user_mbuf.h:231
void sctp_update_acked(struct sctp_tcb *stcb, struct sctp_shutdown_chunk *cp, int *abort_flag)
Definition: sctp_indata.c:5164
struct mbuf * sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
Definition: sctp_indata.c:171
struct sctp_queued_to_read * sctp_build_readq_entry(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t tsn, uint32_t ppid, uint32_t context, uint16_t stream_no, uint32_t stream_seq, uint8_t flags, struct mbuf *dm)
Definition: sctp_indata.c:137
void sctp_set_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
Definition: sctp_indata.c:77
void sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, struct sctp_tcb *stcb, uint16_t num_seg, uint16_t num_nr_seg, uint16_t num_dup, int *abort_now, uint8_t flags, uint32_t cum_ack, uint32_t rwnd, int ecne_seen)
Definition: sctp_indata.c:4299
uint32_t sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
Definition: sctp_indata.c:84
void sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, uint32_t rwnd, int *abort_now, int ecne_seen)
Definition: sctp_indata.c:3769
void sctp_handle_forward_tsn(struct sctp_tcb *stcb, struct sctp_forward_tsn_chunk *fwd, int *abort_flag, struct mbuf *m, int offset)
Definition: sctp_indata.c:5389
Definition: bwe_rtp.cc:26
struct sctp_tcb * stcb
Definition: sctp_structs.h:536
U_CDECL_BEGIN typedef void * context
Definition: ustring.h:1023
Definition: sctp_structs.h:487