Deleted Added
full compact
sctp_output.h (189121) sctp_output.h (204141)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 *
10 * b) Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the distribution.
13 *
14 * c) Neither the name of Cisco Systems, Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 *
10 * b) Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the distribution.
13 *
14 * c) Neither the name of Cisco Systems, Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 189121 2009-02-27 20:54:45Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 204141 2010-02-20 20:30:40Z tuexen $");
35
36#ifndef __sctp_output_h__
37#define __sctp_output_h__
38
39#include <netinet/sctp_header.h>
40
41#if defined(_KERNEL) || defined(__Userspace__)
42
43
44struct mbuf *
45sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp,
46 struct sctp_scoping *scope,
47 struct mbuf *m_at,
48 int cnt_inits_to);
49
50
51int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *);
52
53
54int
55sctp_is_address_in_scope(struct sctp_ifa *ifa,
56 int ipv4_addr_legal,
57 int ipv6_addr_legal,
58 int loopback_scope,
59 int ipv4_local_scope,
60 int local_scope,
61 int site_scope,
62 int do_update);
63int
64 sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa);
65
66struct sctp_ifa *
67sctp_source_address_selection(struct sctp_inpcb *inp,
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
72int
73 sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t * ro);
74int
75 sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t * ro);
76
77void
78sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int
79#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
80 SCTP_UNUSED
81#endif
82);
83
84void
85sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *,
86 struct mbuf *, int, int, struct sctphdr *, struct sctp_init_chunk *,
87 uint32_t, uint16_t, int);
88
89struct mbuf *
90sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *,
91 struct sctp_chunkhdr *, int *);
92void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *);
93
94int
95sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *,
96 struct sctp_nets *);
97
98void sctp_send_cookie_ack(struct sctp_tcb *);
99
100void
101sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int,
102 struct sctp_nets *);
103
104void
105sctp_remove_from_wheel(struct sctp_tcb *stcb,
106 struct sctp_association *asoc,
107 struct sctp_stream_out *strq, int holds_lock);
108
109
110void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *);
111
112void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *);
113
35
36#ifndef __sctp_output_h__
37#define __sctp_output_h__
38
39#include <netinet/sctp_header.h>
40
41#if defined(_KERNEL) || defined(__Userspace__)
42
43
44struct mbuf *
45sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp,
46 struct sctp_scoping *scope,
47 struct mbuf *m_at,
48 int cnt_inits_to);
49
50
51int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *);
52
53
54int
55sctp_is_address_in_scope(struct sctp_ifa *ifa,
56 int ipv4_addr_legal,
57 int ipv6_addr_legal,
58 int loopback_scope,
59 int ipv4_local_scope,
60 int local_scope,
61 int site_scope,
62 int do_update);
63int
64 sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa);
65
66struct sctp_ifa *
67sctp_source_address_selection(struct sctp_inpcb *inp,
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
72int
73 sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t * ro);
74int
75 sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t * ro);
76
77void
78sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int
79#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
80 SCTP_UNUSED
81#endif
82);
83
84void
85sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *,
86 struct mbuf *, int, int, struct sctphdr *, struct sctp_init_chunk *,
87 uint32_t, uint16_t, int);
88
89struct mbuf *
90sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *,
91 struct sctp_chunkhdr *, int *);
92void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *);
93
94int
95sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *,
96 struct sctp_nets *);
97
98void sctp_send_cookie_ack(struct sctp_tcb *);
99
100void
101sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int,
102 struct sctp_nets *);
103
104void
105sctp_remove_from_wheel(struct sctp_tcb *stcb,
106 struct sctp_association *asoc,
107 struct sctp_stream_out *strq, int holds_lock);
108
109
110void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *);
111
112void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *);
113
114void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *);
114void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int);
115
116void
117sctp_send_shutdown_complete2(struct mbuf *, int, struct sctphdr *,
118 uint32_t, uint16_t);
119
120void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked);
121
122void sctp_send_asconf_ack(struct sctp_tcb *);
123
124int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *);
125
126void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *);
127
128void sctp_toss_old_asconf(struct sctp_tcb *);
129
130void sctp_fix_ecn_echo(struct sctp_association *);
131
132int
133sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
134 struct mbuf *, struct thread *, int);
135
136void
137sctp_insert_on_wheel(struct sctp_tcb *stcb,
138 struct sctp_association *asoc,
139 struct sctp_stream_out *strq, int holdslock);
140
141void
142sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int
143#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
144 SCTP_UNUSED
145#endif
146);
147void
148sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int
149#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
150 SCTP_UNUSED
151#endif
152);
153
154void send_forward_tsn(struct sctp_tcb *, struct sctp_association *);
155
156void sctp_send_sack(struct sctp_tcb *);
157
158/* EY 05/07/08 if nr_sacks used, the following function will be called instead of sctp_send_sack */
159void sctp_send_nr_sack(struct sctp_tcb *);
160
161int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *);
162
163void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t);
164
165
166void
167sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *,
168 int, int);
169
170
171
172void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t);
173
174
175void
176sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk,
177 int number_entries, uint16_t * list,
178 uint32_t seq, uint32_t resp_seq, uint32_t last_sent);
179
180void
181sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk,
182 int number_entries, uint16_t * list,
183 uint32_t seq);
184
185void
186sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk,
187 uint32_t seq);
188
189void
190sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk,
191 uint32_t resp_seq, uint32_t result);
192
193void
194sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk,
195 uint32_t resp_seq, uint32_t result,
196 uint32_t send_una, uint32_t recv_next);
197
198int
199sctp_send_str_reset_req(struct sctp_tcb *stcb,
200 int number_entries,
201 uint16_t * list,
202 uint8_t send_out_req,
203 uint32_t resp_seq,
204 uint8_t send_in_req,
205 uint8_t send_tsn_req,
206 uint8_t add_str,
207 uint16_t adding);
208
209
210void
211sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t,
212 struct mbuf *, uint32_t, uint16_t);
213
214void sctp_send_operr_to(struct mbuf *, int, struct mbuf *, uint32_t, uint32_t, uint16_t);
215
216#endif /* _KERNEL || __Userspace__ */
217
218#if defined(_KERNEL) || defined (__Userspace__)
219int
220sctp_sosend(struct socket *so,
221 struct sockaddr *addr,
222 struct uio *uio,
223 struct mbuf *top,
224 struct mbuf *control,
225 int flags,
226 struct thread *p
227);
228
229#endif
230#endif
115
116void
117sctp_send_shutdown_complete2(struct mbuf *, int, struct sctphdr *,
118 uint32_t, uint16_t);
119
120void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked);
121
122void sctp_send_asconf_ack(struct sctp_tcb *);
123
124int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *);
125
126void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *);
127
128void sctp_toss_old_asconf(struct sctp_tcb *);
129
130void sctp_fix_ecn_echo(struct sctp_association *);
131
132int
133sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
134 struct mbuf *, struct thread *, int);
135
136void
137sctp_insert_on_wheel(struct sctp_tcb *stcb,
138 struct sctp_association *asoc,
139 struct sctp_stream_out *strq, int holdslock);
140
141void
142sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int
143#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
144 SCTP_UNUSED
145#endif
146);
147void
148sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int
149#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING)
150 SCTP_UNUSED
151#endif
152);
153
154void send_forward_tsn(struct sctp_tcb *, struct sctp_association *);
155
156void sctp_send_sack(struct sctp_tcb *);
157
158/* EY 05/07/08 if nr_sacks used, the following function will be called instead of sctp_send_sack */
159void sctp_send_nr_sack(struct sctp_tcb *);
160
161int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *);
162
163void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t);
164
165
166void
167sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *,
168 int, int);
169
170
171
172void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t);
173
174
175void
176sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk,
177 int number_entries, uint16_t * list,
178 uint32_t seq, uint32_t resp_seq, uint32_t last_sent);
179
180void
181sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk,
182 int number_entries, uint16_t * list,
183 uint32_t seq);
184
185void
186sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk,
187 uint32_t seq);
188
189void
190sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk,
191 uint32_t resp_seq, uint32_t result);
192
193void
194sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk,
195 uint32_t resp_seq, uint32_t result,
196 uint32_t send_una, uint32_t recv_next);
197
198int
199sctp_send_str_reset_req(struct sctp_tcb *stcb,
200 int number_entries,
201 uint16_t * list,
202 uint8_t send_out_req,
203 uint32_t resp_seq,
204 uint8_t send_in_req,
205 uint8_t send_tsn_req,
206 uint8_t add_str,
207 uint16_t adding);
208
209
210void
211sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t,
212 struct mbuf *, uint32_t, uint16_t);
213
214void sctp_send_operr_to(struct mbuf *, int, struct mbuf *, uint32_t, uint32_t, uint16_t);
215
216#endif /* _KERNEL || __Userspace__ */
217
218#if defined(_KERNEL) || defined (__Userspace__)
219int
220sctp_sosend(struct socket *so,
221 struct sockaddr *addr,
222 struct uio *uio,
223 struct mbuf *top,
224 struct mbuf *control,
225 int flags,
226 struct thread *p
227);
228
229#endif
230#endif