/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. Neither the name of the project nor the names of its contributors15* may be used to endorse or promote products derived from this software16* without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE22* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*30* $KAME: in6_pcb.h,v 1.13 2001/02/06 09:16:53 itojun Exp $31*/3233/*-34* Copyright (c) 1982, 1986, 1990, 199335* The Regents of the University of California. All rights reserved.36*37* Redistribution and use in source and binary forms, with or without38* modification, are permitted provided that the following conditions39* are met:40* 1. Redistributions of source code must retain the above copyright41* notice, this list of conditions and the following disclaimer.42* 2. Redistributions in binary form must reproduce the above copyright43* notice, this list of conditions and the following disclaimer in the44* documentation and/or other materials provided with the distribution.45* 3. Neither the name of the University nor the names of its contributors46* may be used to endorse or promote products derived from this software47* without specific prior written permission.48*49* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND50* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE51* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE52* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE53* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL54* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS55* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)56* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT57* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY58* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF59* SUCH DAMAGE.60*/6162#ifndef _NETINET6_IN6_PCB_H_63#define _NETINET6_IN6_PCB_H_6465#ifdef _KERNEL66#define satosin6(sa) ((struct sockaddr_in6 *)(sa))67#define sin6tosa(sin6) ((struct sockaddr *)(sin6))68#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))6970void in6_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);71void in6_losing(struct inpcb *);72int in6_pcbbind(struct inpcb *, struct sockaddr_in6 *, int, struct ucred *);73int in6_pcbconnect(struct inpcb *, struct sockaddr_in6 *, struct ucred *,74bool);75void in6_pcbdisconnect(struct inpcb *);76struct inpcb *in6_pcblookup_local(struct inpcbinfo *, const struct in6_addr *,77u_short, int, int, struct ucred *);78struct inpcb *in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo,79const struct in6_addr *faddr, u_int fport_arg,80const struct in6_addr *laddr, u_int lport_arg,81int lookupflags, uint8_t numa_domain, int fib);82struct inpcb *in6_pcblookup(struct inpcbinfo *, const struct in6_addr *, u_int,83const struct in6_addr *, u_int, int, struct ifnet *);84struct inpcb *in6_pcblookup_mbuf(struct inpcbinfo *, const struct in6_addr *,85u_int, const struct in6_addr *, u_int, int, struct ifnet *ifp,86struct mbuf *);87void in6_pcbnotify(struct inpcbinfo *, struct sockaddr_in6 *, u_int,88const struct sockaddr_in6 *, u_int, int, void *,89struct inpcb *(*)(struct inpcb *, int));90struct inpcb *91in6_rtchange(struct inpcb *, int);92int in6_getpeeraddr(struct socket *, struct sockaddr *);93int in6_getsockaddr(struct socket *, struct sockaddr *);94int in6_mapped_sockaddr(struct socket *, struct sockaddr *);95int in6_mapped_peeraddr(struct socket *, struct sockaddr *);96int in6_selecthlim(struct inpcb *, struct ifnet *);97int in6_pcbsetport(struct in6_addr *, struct inpcb *, struct ucred *);98void init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m, int);99#endif /* _KERNEL */100101#endif /* !_NETINET6_IN6_PCB_H_ */102103104