webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
sctp_output.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_output.h 295072 2016-01-30 12:58:38Z tuexen $");
36 #endif
37 
38 #ifndef _NETINET_SCTP_OUTPUT_H_
39 #define _NETINET_SCTP_OUTPUT_H_
40 
41 #include <netinet/sctp_header.h>
42 
43 #if defined(_KERNEL) || defined(__Userspace__)
44 
45 
46 struct mbuf *
48  struct sctp_tcb *stcb,
49  struct sctp_scoping *scope,
50  struct mbuf *m_at,
51  int cnt_inits_to,
52  uint16_t *padding_len, uint16_t *chunk_len);
53 
54 
55 int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *);
56 
57 
58 int
60  struct sctp_scoping *scope,
61  int do_update);
62 
63 int
64 sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa);
65 
66 struct sctp_ifa *
68  struct sctp_tcb *stcb,
69  sctp_route_t *ro, struct sctp_nets *net,
70  int non_asoc_addr_ok, uint32_t vrf_id);
71 
72 #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__Userspace__)
73 int
74 sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro);
75 int
76 sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro);
77 #endif
78 
79 void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int
80 #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
82 #endif
83  );
84 
85 void
86 sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *,
87  struct sctp_nets *, struct mbuf *,
88  int, int,
89  struct sockaddr *, struct sockaddr *,
90  struct sctphdr *, struct sctp_init_chunk *,
91 #if defined(__FreeBSD__)
93 #endif
94  uint32_t, uint16_t, int);
95 
96 struct mbuf *
97 sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *,
98  struct sctp_chunkhdr *, int *);
99 void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *);
100 
101 int
102 sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *,
103  struct sctp_nets *);
104 
105 void sctp_send_cookie_ack(struct sctp_tcb *);
106 
107 void
108 sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int,
109  struct sctp_nets *);
110 
111 void
112 sctp_remove_from_wheel(struct sctp_tcb *stcb,
113  struct sctp_association *asoc,
114  struct sctp_stream_out *strq, int holds_lock);
115 
116 
117 void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *);
118 
119 void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *);
120 
121 void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int);
122 
123 void sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *,
124  struct sctphdr *,
125 #if defined(__FreeBSD__)
127 #endif
128  uint32_t, uint16_t);
129 
130 void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked);
131 
132 void sctp_send_asconf_ack(struct sctp_tcb *);
133 
134 int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *);
135 
136 void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *);
137 
138 void sctp_toss_old_asconf(struct sctp_tcb *);
139 
140 void sctp_fix_ecn_echo(struct sctp_association *);
141 
142 void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net);
143 
144 #if defined(__FreeBSD__) && __FreeBSD_version >= 500000
145 int
146 sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
147  struct mbuf *, struct thread *, int);
148 #elif defined(__Windows__)
149 sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
150  struct mbuf *, PKTHREAD, int);
151 #else
152 #if defined(__Userspace__)
153 /* sctp_output is called bu sctp_sendm. Not using sctp_sendm for __Userspace__ */
154 #endif
155 int
156 sctp_output(struct sctp_inpcb *,
157 #if defined(__Panda__)
158  pakhandle_type,
159 #else
160  struct mbuf *,
161 #endif
162  struct sockaddr *,
163 #if defined(__Panda__)
164  pakhandle_type,
165 #else
166  struct mbuf *,
167 #endif
168  struct proc *, int);
169 #endif
170 
171 void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int
172 #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
174 #endif
175  );
176 void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int
177 #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
179 #endif
180  );
181 
182 void send_forward_tsn(struct sctp_tcb *, struct sctp_association *);
183 
184 void sctp_send_sack(struct sctp_tcb *, int);
185 
186 void sctp_send_hb(struct sctp_tcb *, struct sctp_nets *, int);
187 
188 void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t);
189 
190 
191 void
192 sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *,
193  int, int, int);
194 
195 
196 
197 void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t);
198 
199 
200 void
202 
203 void
205  struct sctp_stream_reset_list *,
206  int);
207 
208 void
211 int
213 
214 int
217 
218 void
219 sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *,
220  struct sctphdr *, uint32_t, struct mbuf *,
221 #if defined(__FreeBSD__)
223 #endif
224  uint32_t, uint16_t);
225 
226 void sctp_send_operr_to(struct sockaddr *, struct sockaddr *,
227  struct sctphdr *, uint32_t, struct mbuf *,
228 #if defined(__FreeBSD__)
230 #endif
231  uint32_t, uint16_t);
232 
233 #endif /* _KERNEL || __Userspace__ */
234 
235 #if defined(_KERNEL) || defined(__Userspace__)
236 int
237 sctp_sosend(struct socket *so,
238  struct sockaddr *addr,
239  struct uio *uio,
240 #ifdef __Panda__
241  pakhandle_type top,
242  pakhandle_type control,
243 #else
244  struct mbuf *top,
245  struct mbuf *control,
246 #endif
247 #if defined(__APPLE__) || defined(__Panda__)
248  int flags
249 #else
250  int flags,
251 #if defined(__FreeBSD__) && __FreeBSD_version >= 500000
252  struct thread *p
253 #elif defined(__Windows__)
254  PKTHREAD p
255 #else
256 #if defined(__Userspace__)
257  /* proc is a dummy in __Userspace__ and will not be passed to sctp_lower_sosend */
258 #endif
259  struct proc *p
260 #endif
261 #endif
262 );
263 
264 #endif
265 #endif
266 
void sctp_toss_old_cookies(struct sctp_tcb *stcb, struct sctp_association *asoc)
Definition: sctp_output.c:7376
thread
Definition: __init__.py:35
int sctp_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct proc *p)
Definition: sctp_output.c:13295
void sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked SCTP_UNUSED)
Definition: sctp_output.c:11947
int sctp_is_address_in_scope(struct sctp_ifa *ifa, struct sctp_scoping *scope, int do_update)
Definition: sctp_output.c:1894
Definition: sctp_structs.h:672
DOMString p
Definition: WebCryptoAPI.idl:116
void sctp_send_operr_to(struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vtag, struct mbuf *cause, uint32_t vrf_id, uint16_t port)
Definition: sctp_output.c:12980
void sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net)
Definition: sctp_output.c:9653
Definition: sctp_structs.h:305
void sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err)
Definition: sctp_output.c:9404
Definition: sctp_pcb.h:444
unsigned int uint32_t
Definition: ptypes.h:105
void sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *src_net, struct mbuf *init_pkt, int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *init_chk, uint32_t vrf_id, uint16_t port, int hold_inp_lock)
Definition: sctp_output.c:5881
void sctp_send_sack(struct sctp_tcb *stcb, int so_locked SCTP_UNUSED)
Definition: sctp_output.c:10989
void sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net)
Definition: sctp_output.c:9697
void sctp_send_asconf_ack(struct sctp_tcb *stcb)
Definition: sctp_output.c:9792
Definition: user_socketvar.h:125
Definition: user_route.h:47
Definition: sctp_structs.h:81
void sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked SCTP_UNUSED)
Definition: sctp_output.c:11385
int sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked)
Definition: sctp_output.c:12690
Definition: sctp_structs.h:704
void sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result)
Definition: sctp_output.c:12502
Definition: user_socketvar.h:74
int top
Definition: float-mm.c:109
#define SCTP_UNUSED
Definition: sctp_os_userspace.h:807
void sctp_send_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn)
Definition: sctp_output.c:12090
Definition: sctp.h:58
Definition: quicdatachannel.h:29
uint32_t vrf_id
Definition: sctp_pcb.h:115
endif
Definition: downloads.php:90
unsigned char uint8_t
Definition: ptypes.h:89
int sctp_get_frag_point(struct sctp_tcb *stcb, struct sctp_association *asoc)
Definition: sctp_output.c:6697
void sctp_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_where, int so_locked SCTP_UNUSED)
Definition: sctp_output.c:10437
unsigned short uint16_t
Definition: ptypes.h:97
void sctp_send_shutdown_complete(struct sctp_tcb *stcb, struct sctp_nets *net, int reflect_vtag)
Definition: sctp_output.c:11489
Definition: sctp_structs.h:848
void sctp_send_cookie_ack(struct sctp_tcb *stcb)
Definition: sctp_output.c:9605
void sctp_send_abort(struct mbuf *m, int iphlen, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vtag, struct mbuf *cause, uint32_t vrf_id, uint16_t port)
Definition: sctp_output.c:12958
void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next)
Definition: sctp_output.c:12593
int sctp_output(struct sctp_inpcb *inp, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct proc *p, int flags)
Definition: sctp_output.c:10719
void sctp_send_deferred_reset_response(struct sctp_tcb *stcb, struct sctp_stream_reset_list *ent, int response)
Definition: sctp_output.c:12531
Definition: sctp_pcb.h:614
Definition: user_mbuf.h:231
Definition: user_socketvar.h:85
int sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
Definition: sctp_output.c:2486
void send_forward_tsn(struct sctp_tcb *stcb, struct sctp_association *asoc)
Definition: sctp_output.c:10768
Definition: sctp_pcb.h:103
void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net)
Definition: sctp_output.c:8257
void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, struct mbuf *m, int len, int iphlen, int bad_crc)
Definition: sctp_output.c:12154
int sctp_send_cookie_echo(struct mbuf *m, int offset, struct sctp_tcb *stcb, struct sctp_nets *net)
Definition: sctp_output.c:9467
struct sctp_ifa * sctp_source_address_selection(struct sctp_inpcb *inp, struct sctp_tcb *stcb, sctp_route_t *ro, struct sctp_nets *net, int non_asoc_addr_ok, uint32_t vrf_id)
Definition: sctp_output.c:3393
int sctp_is_addr_restricted(struct sctp_tcb *stcb, struct sctp_ifa *ifa)
Definition: sctp_output.c:2462
void sctp_toss_old_asconf(struct sctp_tcb *stcb)
Definition: sctp_output.c:7394
void sctp_send_heartbeat_ack(struct sctp_tcb *stcb, struct mbuf *m, int offset, int chk_length, struct sctp_nets *net)
Definition: sctp_output.c:9544
void sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked SCTP_UNUSED)
Definition: sctp_output.c:5038
void sctp_send_shutdown_complete2(struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vrf_id, uint16_t port)
Definition: sctp_output.c:11932
void sctp_send_asconf(struct sctp_tcb *stcb, struct sctp_nets *net, int addr_locked)
Definition: sctp_output.c:9742
struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, int param_offset, int *abort_processing, struct sctp_chunkhdr *cp, int *nat_friendly)
Definition: sctp_output.c:5330
struct mbuf * sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to, uint16_t *padding_len, uint16_t *chunk_len)
Definition: sctp_output.c:2065
Definition: bwe_rtp.cc:26
void sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, uint8_t override)
Definition: sctp_output.c:12302
Definition: sctp_header.h:246
void sctp_fix_ecn_echo(struct sctp_association *asoc)
Definition: sctp_output.c:8245
Definition: sctp_structs.h:487
Definition: sctp.h:69
int sctp_send_str_reset_req(struct sctp_tcb *stcb, uint16_t number_entries, uint16_t *list, uint8_t send_in_req, uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, uint16_t adding_i, uint8_t peer_asked)
Definition: sctp_output.c:12762