xref: /freebsd/sys/netinet/sctputil.h (revision 3ac76647)
1f8829a4aSRandall Stewart /*-
251369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
351369649SPedro F. Giffuni  *
4b1006367SRandall Stewart  * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
5807aad63SMichael Tuexen  * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
6807aad63SMichael Tuexen  * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
7f8829a4aSRandall Stewart  *
8f8829a4aSRandall Stewart  * Redistribution and use in source and binary forms, with or without
9f8829a4aSRandall Stewart  * modification, are permitted provided that the following conditions are met:
10f8829a4aSRandall Stewart  *
11f8829a4aSRandall Stewart  * a) Redistributions of source code must retain the above copyright notice,
12f8829a4aSRandall Stewart  *    this list of conditions and the following disclaimer.
13f8829a4aSRandall Stewart  *
14f8829a4aSRandall Stewart  * b) Redistributions in binary form must reproduce the above copyright
15f8829a4aSRandall Stewart  *    notice, this list of conditions and the following disclaimer in
16f8829a4aSRandall Stewart  *    the documentation and/or other materials provided with the distribution.
17f8829a4aSRandall Stewart  *
18f8829a4aSRandall Stewart  * c) Neither the name of Cisco Systems, Inc. nor the names of its
19f8829a4aSRandall Stewart  *    contributors may be used to endorse or promote products derived
20f8829a4aSRandall Stewart  *    from this software without specific prior written permission.
21f8829a4aSRandall Stewart  *
22f8829a4aSRandall Stewart  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23f8829a4aSRandall Stewart  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24f8829a4aSRandall Stewart  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25f8829a4aSRandall Stewart  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26f8829a4aSRandall Stewart  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27f8829a4aSRandall Stewart  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28f8829a4aSRandall Stewart  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29f8829a4aSRandall Stewart  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30f8829a4aSRandall Stewart  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31f8829a4aSRandall Stewart  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32f8829a4aSRandall Stewart  * THE POSSIBILITY OF SUCH DAMAGE.
33f8829a4aSRandall Stewart  */
34f8829a4aSRandall Stewart 
35807aad63SMichael Tuexen #ifndef _NETINET_SCTP_UTIL_H_
36807aad63SMichael Tuexen #define _NETINET_SCTP_UTIL_H_
37f8829a4aSRandall Stewart 
38fc14de76SRandall Stewart #if defined(_KERNEL) || defined(__Userspace__)
39f8829a4aSRandall Stewart 
40cfde3ff7SRandall Stewart #define SCTP_READ_LOCK_HELD 1
41cfde3ff7SRandall Stewart #define SCTP_READ_LOCK_NOT_HELD 0
42f8829a4aSRandall Stewart 
43f1f73e57SRandall Stewart #ifdef SCTP_ASOCLOG_OF_TSNS
44f1f73e57SRandall Stewart void sctp_print_out_track_log(struct sctp_tcb *stcb);
45f1f73e57SRandall Stewart #endif
46f1f73e57SRandall Stewart 
47478d3f09SRandall Stewart #ifdef SCTP_MBUF_LOGGING
48f8829a4aSRandall Stewart struct mbuf *sctp_m_free(struct mbuf *m);
49f8829a4aSRandall Stewart void sctp_m_freem(struct mbuf *m);
50f8829a4aSRandall Stewart #else
51f8829a4aSRandall Stewart #define sctp_m_free m_free
52f8829a4aSRandall Stewart #define sctp_m_freem m_freem
53f8829a4aSRandall Stewart #endif
54f8829a4aSRandall Stewart 
55306c2ba3SMichael Tuexen #if defined(SCTP_LOCAL_TRACE_BUF)
56c4739e2fSRandall Stewart void
57b27a6b7dSRandall Stewart      sctp_log_trace(uint32_t fr, const char *str SCTP_UNUSED, uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f);
58c4739e2fSRandall Stewart #endif
59f8829a4aSRandall Stewart 
60f8829a4aSRandall Stewart #define sctp_get_associd(stcb) ((sctp_assoc_t)stcb->asoc.assoc_id)
61f8829a4aSRandall Stewart 
62f8829a4aSRandall Stewart /*
63f8829a4aSRandall Stewart  * Function prototypes
64f8829a4aSRandall Stewart  */
65e92c2a8dSMichael Tuexen int32_t
66e92c2a8dSMichael Tuexen         sctp_map_assoc_state(int);
67e92c2a8dSMichael Tuexen 
686a27c376SRandall Stewart uint32_t
696a27c376SRandall Stewart          sctp_get_ifa_hash_val(struct sockaddr *addr);
706a27c376SRandall Stewart 
710053ed28SMichael Tuexen struct sctp_ifa *sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct sockaddr *addr, int hold_lock);
7242551e99SRandall Stewart 
730053ed28SMichael Tuexen struct sctp_ifa *sctp_find_ifa_by_addr(struct sockaddr *addr, uint32_t vrf_id, int holds_lock);
74f8829a4aSRandall Stewart 
75f8829a4aSRandall Stewart uint32_t sctp_select_initial_TSN(struct sctp_pcb *);
76f8829a4aSRandall Stewart 
77830d754dSRandall Stewart uint32_t sctp_select_a_tag(struct sctp_inpcb *, uint16_t lport, uint16_t rport, int);
78f8829a4aSRandall Stewart 
79c7f048abSMichael Tuexen int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t, uint32_t, uint16_t);
80f8829a4aSRandall Stewart 
81f8829a4aSRandall Stewart void sctp_fill_random_store(struct sctp_pcb *);
82f8829a4aSRandall Stewart 
838745f898SMichael Tuexen /*
848745f898SMichael Tuexen  * NOTE: sctp_timer_start() will increment the reference count of any relevant
858745f898SMichael Tuexen  * structure the timer is referencing, in order to prevent a race condition
868745f898SMichael Tuexen  * between the timer executing and the structure being freed.
878745f898SMichael Tuexen  *
888745f898SMichael Tuexen  * When the timer fires or sctp_timer_stop() is called, these references are
898745f898SMichael Tuexen  * removed.
908745f898SMichael Tuexen  */
91c4e848b7SRandall Stewart void
92f8829a4aSRandall Stewart sctp_timer_start(int, struct sctp_inpcb *, struct sctp_tcb *,
93f8829a4aSRandall Stewart     struct sctp_nets *);
94f8829a4aSRandall Stewart 
956e55db54SRandall Stewart void
96f8829a4aSRandall Stewart sctp_timer_stop(int, struct sctp_inpcb *, struct sctp_tcb *,
97a5d547adSRandall Stewart     struct sctp_nets *, uint32_t);
98f8829a4aSRandall Stewart 
9942551e99SRandall Stewart int
10042551e99SRandall Stewart     sctp_dynamic_set_primary(struct sockaddr *sa, uint32_t vrf_id);
10142551e99SRandall Stewart 
102f8829a4aSRandall Stewart void
103b1deed45SMichael Tuexen sctp_wakeup_the_read_socket(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
104b1deed45SMichael Tuexen     int so_locked
105b1deed45SMichael Tuexen     SCTP_UNUSED
106b1deed45SMichael Tuexen );
10744249214SRandall Stewart 
10844249214SRandall Stewart void
109f8829a4aSRandall Stewart sctp_add_to_readq(struct sctp_inpcb *inp,
110f8829a4aSRandall Stewart     struct sctp_tcb *stcb,
111f8829a4aSRandall Stewart     struct sctp_queued_to_read *control,
112f8829a4aSRandall Stewart     struct sockbuf *sb,
113ceaad40aSRandall Stewart     int end,
114cfde3ff7SRandall Stewart     int inpread_locked,
11528397ac1SMichael Tuexen     int so_locked);
116f8829a4aSRandall Stewart 
11742551e99SRandall Stewart void sctp_iterator_worker(void);
11842551e99SRandall Stewart 
119437fc91aSMichael Tuexen uint32_t sctp_get_prev_mtu(uint32_t);
1207215cc1bSMichael Tuexen uint32_t sctp_get_next_mtu(uint32_t);
121f8829a4aSRandall Stewart 
122f8829a4aSRandall Stewart void
123f8829a4aSRandall Stewart      sctp_timeout_handler(void *);
124f8829a4aSRandall Stewart 
12544f2a327SMichael Tuexen int
126f8829a4aSRandall Stewart sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *,
1278c8e10b7SMichael Tuexen     struct sctp_nets *, struct timeval *, int);
128f8829a4aSRandall Stewart 
129f8829a4aSRandall Stewart uint32_t sctp_calculate_len(struct mbuf *);
130f8829a4aSRandall Stewart 
131f8829a4aSRandall Stewart caddr_t sctp_m_getptr(struct mbuf *, int, int, uint8_t *);
132f8829a4aSRandall Stewart 
133f8829a4aSRandall Stewart struct sctp_paramhdr *
134f8829a4aSRandall Stewart sctp_get_next_param(struct mbuf *, int,
135f8829a4aSRandall Stewart     struct sctp_paramhdr *, int);
136f8829a4aSRandall Stewart 
1370053ed28SMichael Tuexen struct mbuf *sctp_add_pad_tombuf(struct mbuf *, int);
138f8829a4aSRandall Stewart 
1390053ed28SMichael Tuexen struct mbuf *sctp_pad_lastmbuf(struct mbuf *, int, struct mbuf *);
140f8829a4aSRandall Stewart 
14128397ac1SMichael Tuexen void sctp_ulp_notify(uint32_t, struct sctp_tcb *, uint32_t, void *, int);
142f8829a4aSRandall Stewart 
143f8829a4aSRandall Stewart void
144f8829a4aSRandall Stewart sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp,
145f8829a4aSRandall Stewart     struct sctp_inpcb *new_inp,
146d06c82f1SRandall Stewart     struct sctp_tcb *stcb, int waitflags);
147f8829a4aSRandall Stewart 
148f8829a4aSRandall Stewart void sctp_stop_timers_for_shutdown(struct sctp_tcb *);
149f8829a4aSRandall Stewart 
1505555400aSMichael Tuexen /* Stop all timers for association and remote addresses. */
1518803350dSMichael Tuexen void sctp_stop_association_timers(struct sctp_tcb *, bool);
1525555400aSMichael Tuexen 
153f5d30f7fSMichael Tuexen void sctp_report_all_outbound(struct sctp_tcb *, uint16_t, int);
154f8829a4aSRandall Stewart 
1550696e120SRandall Stewart int sctp_expand_mapping_array(struct sctp_association *, uint32_t);
156f8829a4aSRandall Stewart 
157ceaad40aSRandall Stewart void
158105b68b4SMichael Tuexen sctp_abort_notification(struct sctp_tcb *, bool, bool, uint16_t,
15928397ac1SMichael Tuexen     struct sctp_abort_chunk *, int);
160f8829a4aSRandall Stewart 
161f8829a4aSRandall Stewart /* We abort responding to an IP packet for some reason */
162f8829a4aSRandall Stewart void
163f30ac432SMichael Tuexen sctp_abort_association(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *,
164b1754ad1SMichael Tuexen     int, struct sockaddr *, struct sockaddr *,
165b1754ad1SMichael Tuexen     struct sctphdr *, struct mbuf *,
166f30ac432SMichael Tuexen     uint8_t, uint32_t,
167f30ac432SMichael Tuexen     uint32_t, uint16_t);
16817205eccSRandall Stewart 
169f8829a4aSRandall Stewart /* We choose to abort via user input */
170f8829a4aSRandall Stewart void
171a2b42326SMichael Tuexen sctp_abort_an_association(struct sctp_inpcb *, struct sctp_tcb *,
172105b68b4SMichael Tuexen     struct mbuf *, bool, int);
173f8829a4aSRandall Stewart 
174f8829a4aSRandall Stewart void
175b1754ad1SMichael Tuexen sctp_handle_ootb(struct mbuf *, int, int,
176b1754ad1SMichael Tuexen     struct sockaddr *, struct sockaddr *,
177b1754ad1SMichael Tuexen     struct sctphdr *, struct sctp_inpcb *,
178ff1ffd74SMichael Tuexen     struct mbuf *,
179d089f9b9SMichael Tuexen     uint8_t, uint32_t, uint16_t,
180f30ac432SMichael Tuexen     uint32_t, uint16_t);
18117205eccSRandall Stewart 
182d61a0ae0SRandall Stewart int
183d61a0ae0SRandall Stewart sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr,
184d61a0ae0SRandall Stewart     int totaddr, int *error);
18517205eccSRandall Stewart 
186fc26bf71SMichael Tuexen int
187fc26bf71SMichael Tuexen sctp_connectx_helper_find(struct sctp_inpcb *, struct sockaddr *,
188fc26bf71SMichael Tuexen     unsigned int, unsigned int *, unsigned int *, unsigned int);
189f8829a4aSRandall Stewart 
190f8829a4aSRandall Stewart int sctp_is_there_an_abort_here(struct mbuf *, int, uint32_t *);
1915e2c2d87SRandall Stewart #ifdef INET6
192f8829a4aSRandall Stewart uint32_t sctp_is_same_scope(struct sockaddr_in6 *, struct sockaddr_in6 *);
193f42a358aSRandall Stewart 
1940053ed28SMichael Tuexen struct sockaddr_in6 *sctp_recover_scope(struct sockaddr_in6 *, struct sockaddr_in6 *);
195f8829a4aSRandall Stewart 
196f8829a4aSRandall Stewart #define sctp_recover_scope_mac(addr, store) do { \
197f8829a4aSRandall Stewart 	 if ((addr->sin6_family == AF_INET6) && \
198f42a358aSRandall Stewart 	     (IN6_IS_SCOPE_LINKLOCAL(&addr->sin6_addr))) { \
199f8829a4aSRandall Stewart 		*store = *addr; \
200f42a358aSRandall Stewart 		if (addr->sin6_scope_id == 0) { \
201f8829a4aSRandall Stewart 			if (!sa6_recoverscope(store)) { \
202f8829a4aSRandall Stewart 				addr = store; \
203f8829a4aSRandall Stewart 			} \
204f42a358aSRandall Stewart 		} else { \
205f42a358aSRandall Stewart 			in6_clearscope(&addr->sin6_addr); \
206f42a358aSRandall Stewart 			addr = store; \
207f42a358aSRandall Stewart 		} \
208f8829a4aSRandall Stewart 	 } \
209f8829a4aSRandall Stewart } while (0)
2105e2c2d87SRandall Stewart #endif
211f8829a4aSRandall Stewart 
212f8829a4aSRandall Stewart int sctp_cmpaddr(struct sockaddr *, struct sockaddr *);
213f8829a4aSRandall Stewart 
214f8829a4aSRandall Stewart void sctp_print_address(struct sockaddr *);
215f8829a4aSRandall Stewart 
216f8829a4aSRandall Stewart int
217f8829a4aSRandall Stewart sctp_release_pr_sctp_chunk(struct sctp_tcb *, struct sctp_tmit_chunk *,
21828397ac1SMichael Tuexen     uint8_t, int);
219f8829a4aSRandall Stewart 
220ff1ffd74SMichael Tuexen struct mbuf *sctp_generate_cause(uint16_t, char *);
22132451da4SMichael Tuexen struct mbuf *sctp_generate_no_user_data_cause(uint32_t);
222f8829a4aSRandall Stewart 
22335918f85SRandall Stewart void
22435918f85SRandall Stewart sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp,
2257621bd5eSMichael Tuexen     struct sockaddr *sa, uint32_t vrf_id, int *error,
2267621bd5eSMichael Tuexen     void *p);
22735918f85SRandall Stewart void
2287621bd5eSMichael Tuexen sctp_bindx_delete_address(struct sctp_inpcb *inp, struct sockaddr *sa,
22935918f85SRandall Stewart     uint32_t vrf_id, int *error);
230f8829a4aSRandall Stewart 
2311b649582SRandall Stewart int sctp_local_addr_count(struct sctp_tcb *stcb);
2321b649582SRandall Stewart 
233f8829a4aSRandall Stewart void
234f8829a4aSRandall Stewart sctp_free_bufspace(struct sctp_tcb *, struct sctp_association *,
23580fefe0aSRandall Stewart     struct sctp_tmit_chunk *, int);
236f8829a4aSRandall Stewart 
237f8829a4aSRandall Stewart #define sctp_free_spbufspace(stcb, asoc, sp)  \
238f8829a4aSRandall Stewart do { \
239f8829a4aSRandall Stewart 	if (sp->data != NULL) { \
240f8829a4aSRandall Stewart 		if ((asoc)->total_output_queue_size >= sp->length) { \
241ad81507eSRandall Stewart 			atomic_subtract_int(&(asoc)->total_output_queue_size, sp->length); \
242f8829a4aSRandall Stewart 		} else { \
243f8829a4aSRandall Stewart 			(asoc)->total_output_queue_size = 0; \
244f8829a4aSRandall Stewart 		} \
245f8829a4aSRandall Stewart 		if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
246f8829a4aSRandall Stewart 		    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
247c6207881SMichael Tuexen 			SCTP_SB_DECR(&stcb->sctp_socket->so_snd, sp->length); \
248f8829a4aSRandall Stewart 		} \
249f8829a4aSRandall Stewart 	} \
250f8829a4aSRandall Stewart } while (0)
251f8829a4aSRandall Stewart 
252f8829a4aSRandall Stewart #define sctp_snd_sb_alloc(stcb, sz)  \
253f8829a4aSRandall Stewart do { \
254f8829a4aSRandall Stewart 	atomic_add_int(&stcb->asoc.total_output_queue_size,sz); \
255f8829a4aSRandall Stewart 	if ((stcb->sctp_socket != NULL) && \
256f8829a4aSRandall Stewart 	    ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \
257f8829a4aSRandall Stewart 	     (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \
258c6207881SMichael Tuexen 		SCTP_SB_INCR(&stcb->sctp_socket->so_snd, sz); \
259f8829a4aSRandall Stewart 	} \
260f8829a4aSRandall Stewart } while (0)
261f8829a4aSRandall Stewart 
262ea5eba11SMichael Tuexen /* functions to start/stop udp tunneling */
263c54a18d2SRandall Stewart void sctp_over_udp_stop(void);
264c54a18d2SRandall Stewart int sctp_over_udp_start(void);
265f8829a4aSRandall Stewart 
266f8829a4aSRandall Stewart int
267f8829a4aSRandall Stewart sctp_soreceive(struct socket *so, struct sockaddr **psa,
268f8829a4aSRandall Stewart     struct uio *uio,
269f8829a4aSRandall Stewart     struct mbuf **mp0,
270f8829a4aSRandall Stewart     struct mbuf **controlp,
271f8829a4aSRandall Stewart     int *flagsp);
272f8829a4aSRandall Stewart 
273f8829a4aSRandall Stewart void
274f8829a4aSRandall Stewart      sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d);
275f8829a4aSRandall Stewart 
276f8829a4aSRandall Stewart void
277f8829a4aSRandall Stewart sctp_wakeup_log(struct sctp_tcb *stcb,
278f8829a4aSRandall Stewart     uint32_t wake_cnt, int from);
279f8829a4aSRandall Stewart 
2806a91f103SRandall Stewart void sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t, uint16_t, uint16_t, int);
281f8829a4aSRandall Stewart 
282f8829a4aSRandall Stewart void sctp_log_nagle_event(struct sctp_tcb *stcb, int action);
283f8829a4aSRandall Stewart 
2844be807c4SMichael Tuexen #ifdef SCTP_MBUF_LOGGING
285f8829a4aSRandall Stewart void
286f8829a4aSRandall Stewart      sctp_log_mb(struct mbuf *m, int from);
287f8829a4aSRandall Stewart 
288f8829a4aSRandall Stewart void
2894be807c4SMichael Tuexen      sctp_log_mbc(struct mbuf *m, int from);
2904be807c4SMichael Tuexen #endif
2914be807c4SMichael Tuexen 
2924be807c4SMichael Tuexen void
293f8829a4aSRandall Stewart sctp_sblog(struct sockbuf *sb,
294f8829a4aSRandall Stewart     struct sctp_tcb *stcb, int from, int incr);
295f8829a4aSRandall Stewart 
296f8829a4aSRandall Stewart void
297f8829a4aSRandall Stewart sctp_log_strm_del(struct sctp_queued_to_read *control,
298f8829a4aSRandall Stewart     struct sctp_queued_to_read *poschk,
299f8829a4aSRandall Stewart     int from);
300f8829a4aSRandall Stewart void sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets *, int, uint8_t);
301f8829a4aSRandall Stewart void rto_logging(struct sctp_nets *net, int from);
302f8829a4aSRandall Stewart 
303f8829a4aSRandall Stewart void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc);
304f8829a4aSRandall Stewart 
305f8829a4aSRandall Stewart void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from);
306f8829a4aSRandall Stewart void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t);
30758e6eeefSMichael Tuexen void sctp_log_block(uint8_t, struct sctp_association *, ssize_t);
308f8829a4aSRandall Stewart void sctp_log_rwnd(uint8_t, uint32_t, uint32_t, uint32_t);
309f8829a4aSRandall Stewart void sctp_log_rwnd_set(uint8_t, uint32_t, uint32_t, uint32_t, uint32_t);
31042551e99SRandall Stewart int sctp_fill_stat_log(void *, size_t *);
311f8829a4aSRandall Stewart void sctp_log_fr(uint32_t, uint32_t, uint32_t, int);
312f8829a4aSRandall Stewart void sctp_log_sack(uint32_t, uint32_t, uint32_t, uint16_t, uint16_t, int);
313f8829a4aSRandall Stewart void sctp_log_map(uint32_t, uint32_t, uint32_t, int);
3140e13104dSRandall Stewart void sctp_print_mapping_array(struct sctp_association *asoc);
315f8829a4aSRandall Stewart void sctp_clr_stat_log(void);
316f8829a4aSRandall Stewart 
317f8829a4aSRandall Stewart #ifdef SCTP_AUDITING_ENABLED
318f8829a4aSRandall Stewart void
319f8829a4aSRandall Stewart sctp_auditing(int, struct sctp_inpcb *, struct sctp_tcb *,
320f8829a4aSRandall Stewart     struct sctp_nets *);
321f8829a4aSRandall Stewart void sctp_audit_log(uint8_t, uint8_t);
322f8829a4aSRandall Stewart 
323f8829a4aSRandall Stewart #endif
32410e0318aSMichael Tuexen uint32_t sctp_min_mtu(uint32_t, uint32_t, uint32_t);
32510e0318aSMichael Tuexen void sctp_hc_set_mtu(union sctp_sockstore *, uint16_t, uint32_t);
32610e0318aSMichael Tuexen uint32_t sctp_hc_get_mtu(union sctp_sockstore *, uint16_t);
3271a0b0216SMichael Tuexen void sctp_set_state(struct sctp_tcb *, int);
3281a0b0216SMichael Tuexen void sctp_add_substate(struct sctp_tcb *, int);
32925ec3553SMichael Tuexen uint32_t sctp_ticks_to_msecs(uint32_t);
33025ec3553SMichael Tuexen uint32_t sctp_msecs_to_ticks(uint32_t);
33125ec3553SMichael Tuexen uint32_t sctp_ticks_to_secs(uint32_t);
33225ec3553SMichael Tuexen uint32_t sctp_secs_to_ticks(uint32_t);
33325ec3553SMichael Tuexen 
334f8829a4aSRandall Stewart #endif				/* _KERNEL */
335f8829a4aSRandall Stewart #endif
336