1139826Simp/*-
253541Sshin * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
353541Sshin * All rights reserved.
453541Sshin *
553541Sshin * Redistribution and use in source and binary forms, with or without
653541Sshin * modification, are permitted provided that the following conditions
753541Sshin * are met:
853541Sshin * 1. Redistributions of source code must retain the above copyright
953541Sshin *    notice, this list of conditions and the following disclaimer.
1053541Sshin * 2. Redistributions in binary form must reproduce the above copyright
1153541Sshin *    notice, this list of conditions and the following disclaimer in the
1253541Sshin *    documentation and/or other materials provided with the distribution.
1353541Sshin * 3. Neither the name of the project nor the names of its contributors
1453541Sshin *    may be used to endorse or promote products derived from this software
1553541Sshin *    without specific prior written permission.
1653541Sshin *
1753541Sshin * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1853541Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1953541Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2053541Sshin * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2153541Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2253541Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2353541Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2453541Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2553541Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2653541Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2753541Sshin * SUCH DAMAGE.
2853541Sshin *
29174510Sobrien *	$KAME: in6_pcb.h,v 1.13 2001/02/06 09:16:53 itojun Exp $
3053541Sshin */
3153541Sshin
32139826Simp/*-
3353541Sshin * Copyright (c) 1982, 1986, 1990, 1993
3453541Sshin *	The Regents of the University of California.  All rights reserved.
3553541Sshin *
3653541Sshin * Redistribution and use in source and binary forms, with or without
3753541Sshin * modification, are permitted provided that the following conditions
3853541Sshin * are met:
3953541Sshin * 1. Redistributions of source code must retain the above copyright
4053541Sshin *    notice, this list of conditions and the following disclaimer.
4153541Sshin * 2. Redistributions in binary form must reproduce the above copyright
4253541Sshin *    notice, this list of conditions and the following disclaimer in the
4353541Sshin *    documentation and/or other materials provided with the distribution.
4453541Sshin * 4. Neither the name of the University nor the names of its contributors
4553541Sshin *    may be used to endorse or promote products derived from this software
4653541Sshin *    without specific prior written permission.
4753541Sshin *
4853541Sshin * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
4953541Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5053541Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5153541Sshin * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5253541Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5353541Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5453541Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5553541Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5653541Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5753541Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5853541Sshin * SUCH DAMAGE.
5953541Sshin *
6053541Sshin *	@(#)in_pcb.h	8.1 (Berkeley) 6/10/93
61174510Sobrien * $FreeBSD$
6253541Sshin */
6353541Sshin
6453541Sshin#ifndef _NETINET6_IN6_PCB_H_
6553541Sshin#define	_NETINET6_IN6_PCB_H_
6653541Sshin
6755205Speter#ifdef _KERNEL
6853541Sshin#define	satosin6(sa)	((struct sockaddr_in6 *)(sa))
6953541Sshin#define	sin6tosa(sin6)	((struct sockaddr *)(sin6))
7053541Sshin#define	ifatoia6(ifa)	((struct in6_ifaddr *)(ifa))
7153541Sshin
72222748Srwatsonstruct	inpcbgroup *
73222748Srwatson	in6_pcbgroup_byhash(struct inpcbinfo *, u_int, uint32_t);
74222748Srwatsonstruct	inpcbgroup *
75241916Sdelphij	in6_pcbgroup_byinpcb(struct inpcb *);
76222748Srwatsonstruct inpcbgroup *
77222748Srwatson	in6_pcbgroup_bymbuf(struct inpcbinfo *, struct mbuf *);
78222748Srwatsonstruct	inpcbgroup *
79241916Sdelphij	in6_pcbgroup_bytuple(struct inpcbinfo *, const struct in6_addr *,
80241916Sdelphij	    u_short, const struct in6_addr *, u_short);
81222748Srwatson
82241916Sdelphijvoid	in6_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);
83241916Sdelphijvoid	in6_losing(struct inpcb *);
84241916Sdelphijint	in6_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *);
85241916Sdelphijint	in6_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *);
86241916Sdelphijint	in6_pcbconnect_mbuf(struct inpcb *, struct sockaddr *,
87241916Sdelphij	    struct ucred *, struct mbuf *);
88241916Sdelphijvoid	in6_pcbdisconnect(struct inpcb *);
89194777Sbzint	in6_pcbladdr(struct inpcb *, struct sockaddr *, struct in6_addr *);
9053541Sshinstruct	inpcb *
91241916Sdelphij	in6_pcblookup_local(struct inpcbinfo *,
92180427Sbz				 struct in6_addr *, u_short, int,
93241916Sdelphij				 struct ucred *);
9453541Sshinstruct	inpcb *
95241916Sdelphij	in6_pcblookup(struct inpcbinfo *, struct in6_addr *,
96222488Srwatson			   u_int, struct in6_addr *, u_int, int,
97241916Sdelphij			   struct ifnet *);
98222488Srwatsonstruct	inpcb *
99241916Sdelphij	in6_pcblookup_hash_locked(struct inpcbinfo *, struct in6_addr *,
100222488Srwatson			   u_int, struct in6_addr *, u_int, int,
101241916Sdelphij			   struct ifnet *);
102222691Srwatsonstruct	inpcb *
103241916Sdelphij	in6_pcblookup_mbuf(struct inpcbinfo *, struct in6_addr *,
104222691Srwatson			   u_int, struct in6_addr *, u_int, int,
105241916Sdelphij			   struct ifnet *ifp, struct mbuf *);
106241916Sdelphijvoid	in6_pcbnotify(struct inpcbinfo *, struct sockaddr *,
107125776Sume			   u_int, const struct sockaddr *, u_int, int, void *,
108241916Sdelphij			   struct inpcb *(*)(struct inpcb *, int));
10998211Shsustruct inpcb *
110241916Sdelphij	in6_rtchange(struct inpcb *, int);
111102218Struckmanstruct sockaddr *
112241916Sdelphij	in6_sockaddr(in_port_t port, struct in6_addr *addr_p);
113102218Struckmanstruct sockaddr *
114241916Sdelphij	in6_v4mapsin6_sockaddr(in_port_t port, struct in_addr *addr_p);
115241916Sdelphijint	in6_getpeeraddr(struct socket *so, struct sockaddr **nam);
116241916Sdelphijint	in6_getsockaddr(struct socket *so, struct sockaddr **nam);
117241916Sdelphijint	in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam);
118241916Sdelphijint	in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam);
119241916Sdelphijint	in6_selecthlim(struct in6pcb *, struct ifnet *);
120241916Sdelphijint	in6_pcbsetport(struct in6_addr *, struct inpcb *, struct ucred *);
121241916Sdelphijvoid	init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m);
12255205Speter#endif /* _KERNEL */
12353541Sshin
12453541Sshin#endif /* !_NETINET6_IN6_PCB_H_ */
125