xref: /freebsd/sys/netinet/sctp_asconf.h (revision c3179e6660e1365111b89cb6c05c3a4c47375e73)
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 
35f8829a4aSRandall Stewart #ifndef _NETINET_SCTP_ASCONF_H_
36f8829a4aSRandall Stewart #define _NETINET_SCTP_ASCONF_H_
37f8829a4aSRandall Stewart 
38fc14de76SRandall Stewart #if defined(_KERNEL) || defined(__Userspace__)
39f8829a4aSRandall Stewart 
40139bc87fSRandall Stewart /*
41139bc87fSRandall Stewart  * function prototypes
42139bc87fSRandall Stewart  */
436fb7b4fbSMichael Tuexen extern void sctp_asconf_cleanup(struct sctp_tcb *);
44f8829a4aSRandall Stewart 
453232788eSRandall Stewart extern struct mbuf *sctp_compose_asconf(struct sctp_tcb *, int *, int);
46f8829a4aSRandall Stewart 
47f8829a4aSRandall Stewart extern void
48b1754ad1SMichael Tuexen sctp_handle_asconf(struct mbuf *, unsigned int, struct sockaddr *,
49b1754ad1SMichael Tuexen     struct sctp_asconf_chunk *, struct sctp_tcb *, int);
50f8829a4aSRandall Stewart 
51f8829a4aSRandall Stewart extern void
523232788eSRandall Stewart sctp_handle_asconf_ack(struct mbuf *, int, struct sctp_asconf_ack_chunk *,
533232788eSRandall Stewart     struct sctp_tcb *, struct sctp_nets *, int *);
54f8829a4aSRandall Stewart 
55f8829a4aSRandall Stewart extern uint32_t
56*7a9dbc33SMichael Tuexen sctp_addr_mgmt_ep_sa(struct sctp_inpcb *, struct sockaddr *, uint32_t,
57*7a9dbc33SMichael Tuexen     uint32_t);
58f8829a4aSRandall Stewart 
591b649582SRandall Stewart extern int
601b649582SRandall Stewart sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void *ptr,
611b649582SRandall Stewart     uint32_t val);
621b649582SRandall Stewart extern void
631b649582SRandall Stewart sctp_asconf_iterator_stcb(struct sctp_inpcb *inp,
641b649582SRandall Stewart     struct sctp_tcb *stcb,
651b649582SRandall Stewart     void *ptr, uint32_t type);
661b649582SRandall Stewart extern void sctp_asconf_iterator_end(void *ptr, uint32_t val);
67f8829a4aSRandall Stewart 
68f8829a4aSRandall Stewart extern int32_t
69f8829a4aSRandall Stewart sctp_set_primary_ip_address_sa(struct sctp_tcb *,
70f8829a4aSRandall Stewart     struct sockaddr *);
71f8829a4aSRandall Stewart 
7242551e99SRandall Stewart extern void
73f8829a4aSRandall Stewart sctp_check_address_list(struct sctp_tcb *, struct mbuf *, int, int,
74f8829a4aSRandall Stewart     struct sockaddr *, uint16_t, uint16_t, uint16_t, uint16_t);
75f8829a4aSRandall Stewart 
76851b7298SRandall Stewart extern void
77851b7298SRandall Stewart      sctp_assoc_immediate_retrans(struct sctp_tcb *, struct sctp_nets *);
78851b7298SRandall Stewart extern void
79851b7298SRandall Stewart      sctp_net_immediate_retrans(struct sctp_tcb *, struct sctp_nets *);
80851b7298SRandall Stewart 
81830d754dSRandall Stewart extern void
82830d754dSRandall Stewart sctp_asconf_send_nat_state_update(struct sctp_tcb *stcb,
83830d754dSRandall Stewart     struct sctp_nets *net);
84830d754dSRandall Stewart 
85c54a18d2SRandall Stewart extern int
86c54a18d2SRandall Stewart     sctp_is_addr_pending(struct sctp_tcb *, struct sctp_ifa *);
87f8829a4aSRandall Stewart #endif				/* _KERNEL */
88f8829a4aSRandall Stewart 
89f8829a4aSRandall Stewart #endif				/* !_NETINET_SCTP_ASCONF_H_ */
90