FreeBSD kernel IPv4 code
sctp_output.h
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
5 * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
6 * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * a) Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
13 *
14 * b) Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the distribution.
17 *
18 * c) Neither the name of Cisco Systems, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD$");
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
45struct mbuf *
47 struct sctp_tcb *stcb,
48 struct sctp_scoping *scope,
49 struct mbuf *m_at,
50 int cnt_inits_to,
51 uint16_t *padding_len, uint16_t *chunk_len);
52
53int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *);
54
55int
57 struct sctp_scoping *scope,
58 int do_update);
59
60int
61 sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa);
62
63struct sctp_ifa *
65 struct sctp_tcb *stcb,
66 sctp_route_t *ro, struct sctp_nets *net,
67 int non_asoc_addr_ok, uint32_t vrf_id);
68
69int sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro);
70
72
73void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int);
74
75void
77 struct sctp_nets *, struct mbuf *,
78 int, int,
79 struct sockaddr *, struct sockaddr *,
80 struct sctphdr *, struct sctp_init_chunk *,
83
84struct mbuf *
85sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *,
86 struct sctp_chunkhdr *, int *, int *);
87void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *);
88
89int
90sctp_send_cookie_echo(struct mbuf *, int, int, struct sctp_tcb *,
91 struct sctp_nets *);
92
93void sctp_send_cookie_ack(struct sctp_tcb *);
94
95void
96sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int,
97 struct sctp_nets *);
98
99void
101 struct sctp_association *asoc,
102 struct sctp_stream_out *strq, int holds_lock);
103
104void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *);
105
106void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *);
107
108void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int);
109
110void
111sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *,
112 struct sctphdr *,
115
116void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked);
117
118void sctp_send_asconf_ack(struct sctp_tcb *);
119
121
122void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *);
123
124void sctp_toss_old_asconf(struct sctp_tcb *);
125
127
128void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net);
129
130#define SCTP_DATA_CHUNK_OVERHEAD(stcb) ((stcb)->asoc.idata_supported ? \
131 sizeof(struct sctp_idata_chunk) : \
132 sizeof(struct sctp_data_chunk))
133
134int
135sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
136 struct mbuf *, struct thread *, int);
137
138void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int);
139
140void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int);
141
142void send_forward_tsn(struct sctp_tcb *, struct sctp_association *);
143
144void sctp_send_sack(struct sctp_tcb *, int);
145
146void sctp_send_hb(struct sctp_tcb *, struct sctp_nets *, int);
147
148void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t);
149
150void
151sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *,
152 int, int, int);
153
154void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t);
155
156void
158
159void
161 struct sctp_stream_reset_list *,
162 int);
163
164void
167int
169
170int
173
174void
175sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *,
176 struct sctphdr *, uint32_t, struct mbuf *,
179
180void
181sctp_send_operr_to(struct sockaddr *, struct sockaddr *,
182 struct sctphdr *, uint32_t, struct mbuf *,
185
186#endif /* _KERNEL || __Userspace__ */
187
188#if defined(_KERNEL) || defined(__Userspace__)
189int
190sctp_sosend(struct socket *so,
191 struct sockaddr *addr,
192 struct uio *uio,
193 struct mbuf *top,
194 struct mbuf *control,
195 int flags,
196 struct thread *p
197);
198
199#endif
200#endif
__uint32_t uint32_t
Definition: in.h:62
__uint16_t uint16_t
Definition: in.h:57
__uint8_t uint8_t
Definition: in.h:52
struct route sctp_route_t
Definition: sctp_os_bsd.h:396
int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *)
Definition: sctp_output.c:2407
void sctp_send_deferred_reset_response(struct sctp_tcb *, struct sctp_stream_reset_list *, int)
void sctp_send_sack(struct sctp_tcb *, int)
int sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro)
void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *)
Definition: sctp_output.c:8909
void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int)
int sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro)
void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int)
void sctp_send_operr_to(struct sockaddr *, struct sockaddr *, struct sctphdr *, uint32_t, struct mbuf *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t)
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:2027
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:3297
void sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t)
void sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *, struct sctphdr *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t)
void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *)
Definition: sctp_output.c:6912
void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked)
Definition: sctp_output.c:9271
void sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, struct mbuf *, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_init_chunk *, uint8_t, uint32_t, uint32_t, uint16_t)
Definition: sctp_output.c:5457
int sctp_is_address_in_scope(struct sctp_ifa *ifa, struct sctp_scoping *scope, int do_update)
Definition: sctp_output.c:1867
int sctp_send_str_reset_req(struct sctp_tcb *, uint16_t, uint16_t *, uint8_t, uint8_t, uint8_t, uint16_t, uint16_t, uint8_t)
void sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, int, int, int)
void sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, uint32_t, struct mbuf *, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t)
__FBSDID("$FreeBSD$")
void sctp_send_cookie_ack(struct sctp_tcb *)
Definition: sctp_output.c:9116
void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net)
Definition: sctp_output.c:7769
int sctp_send_stream_reset_out_if_possible(struct sctp_tcb *, int)
void sctp_send_asconf_ack(struct sctp_tcb *)
Definition: sctp_output.c:9321
struct mbuf * sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, struct sctp_chunkhdr *, int *, int *)
Definition: sctp_output.c:4901
void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *)
Definition: sctp_output.c:9206
void send_forward_tsn(struct sctp_tcb *, struct sctp_association *)
int sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa)
Definition: sctp_output.c:2430
void sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, struct sctp_nets *)
Definition: sctp_output.c:9061
void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *)
Definition: sctp_output.c:9163
void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t)
void sctp_remove_from_wheel(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_stream_out *strq, int holds_lock)
int sctp_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *p)
void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t)
void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int)
Definition: sctp_output.c:9960
int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int)
void sctp_toss_old_asconf(struct sctp_tcb *)
Definition: sctp_output.c:6930
void sctp_fix_ecn_echo(struct sctp_association *)
Definition: sctp_output.c:7757
void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int)
Definition: sctp_output.c:4615
uint32_t sctp_get_frag_point(struct sctp_tcb *)
Definition: sctp_output.c:6219
void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, uint32_t, uint32_t, uint32_t, uint32_t)
int sctp_send_cookie_echo(struct mbuf *, int, int, struct sctp_tcb *, struct sctp_nets *)
Definition: sctp_output.c:8973
void sctp_send_hb(struct sctp_tcb *, struct sctp_nets *, int)
uint32_t vrf_id
Definition: sctp_pcb.h:109
Definition: sctp.h:48