in6_pcb.h revision 256281
161861Sru/*-
261861Sru * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
361861Sru * All rights reserved.
461861Sru *
561861Sru * Redistribution and use in source and binary forms, with or without
661861Sru * modification, are permitted provided that the following conditions
761861Sru * are met:
861861Sru * 1. Redistributions of source code must retain the above copyright
961861Sru *    notice, this list of conditions and the following disclaimer.
1061861Sru * 2. Redistributions in binary form must reproduce the above copyright
1161861Sru *    notice, this list of conditions and the following disclaimer in the
1261861Sru *    documentation and/or other materials provided with the distribution.
1361861Sru * 3. Neither the name of the project nor the names of its contributors
1461861Sru *    may be used to endorse or promote products derived from this software
1561861Sru *    without specific prior written permission.
1661861Sru *
1761861Sru * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1861861Sru * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1961861Sru * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2061861Sru * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2161861Sru * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2261861Sru * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2361861Sru * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2461861Sru * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2561861Sru * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2661861Sru * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2761861Sru * SUCH DAMAGE.
2861861Sru *
2961861Sru *	$KAME: in6_pcb.h,v 1.13 2001/02/06 09:16:53 itojun Exp $
3061861Sru */
3161861Sru
3261861Sru/*-
3361861Sru * Copyright (c) 1982, 1986, 1990, 1993
3461861Sru *	The Regents of the University of California.  All rights reserved.
3561861Sru *
3661861Sru * Redistribution and use in source and binary forms, with or without
3761861Sru * modification, are permitted provided that the following conditions
3861861Sru * are met:
3961861Sru * 1. Redistributions of source code must retain the above copyright
4061861Sru *    notice, this list of conditions and the following disclaimer.
4161861Sru * 2. Redistributions in binary form must reproduce the above copyright
4261861Sru *    notice, this list of conditions and the following disclaimer in the
4361861Sru *    documentation and/or other materials provided with the distribution.
4461861Sru * 4. Neither the name of the University nor the names of its contributors
4561861Sru *    may be used to endorse or promote products derived from this software
4661861Sru *    without specific prior written permission.
4761861Sru *
4861861Sru * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
4961861Sru * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5061861Sru * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5161861Sru * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5261861Sru * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5361861Sru * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5461861Sru * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5561861Sru * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5661861Sru * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5761861Sru * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5861861Sru * SUCH DAMAGE.
5961861Sru *
6061861Sru *	@(#)in_pcb.h	8.1 (Berkeley) 6/10/93
6161861Sru * $FreeBSD: stable/10/sys/netinet6/in6_pcb.h 241916 2012-10-22 21:49:56Z delphij $
6261861Sru */
6361861Sru
6461861Sru#ifndef _NETINET6_IN6_PCB_H_
6561861Sru#define	_NETINET6_IN6_PCB_H_
6661861Sru
6761861Sru#ifdef _KERNEL
6861861Sru#define	satosin6(sa)	((struct sockaddr_in6 *)(sa))
6961861Sru#define	sin6tosa(sin6)	((struct sockaddr *)(sin6))
7061861Sru#define	ifatoia6(ifa)	((struct in6_ifaddr *)(ifa))
7161861Sru
7261861Srustruct	inpcbgroup *
7361861Sru	in6_pcbgroup_byhash(struct inpcbinfo *, u_int, uint32_t);
7461861Srustruct	inpcbgroup *
7561861Sru	in6_pcbgroup_byinpcb(struct inpcb *);
7661861Srustruct inpcbgroup *
7761861Sru	in6_pcbgroup_bymbuf(struct inpcbinfo *, struct mbuf *);
7861861Srustruct	inpcbgroup *
7961861Sru	in6_pcbgroup_bytuple(struct inpcbinfo *, const struct in6_addr *,
8061861Sru	    u_short, const struct in6_addr *, u_short);
8161861Sru
8261861Sruvoid	in6_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);
8361861Sruvoid	in6_losing(struct inpcb *);
8461861Sruint	in6_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *);
8561861Sruint	in6_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *);
8661861Sruint	in6_pcbconnect_mbuf(struct inpcb *, struct sockaddr *,
8761861Sru	    struct ucred *, struct mbuf *);
8861861Sruvoid	in6_pcbdisconnect(struct inpcb *);
8961861Sruint	in6_pcbladdr(struct inpcb *, struct sockaddr *, struct in6_addr *);
9061861Srustruct	inpcb *
9161861Sru	in6_pcblookup_local(struct inpcbinfo *,
9261861Sru				 struct in6_addr *, u_short, int,
9361861Sru				 struct ucred *);
9461861Srustruct	inpcb *
9561861Sru	in6_pcblookup(struct inpcbinfo *, struct in6_addr *,
9661861Sru			   u_int, struct in6_addr *, u_int, int,
9761861Sru			   struct ifnet *);
9861861Srustruct	inpcb *
9961861Sru	in6_pcblookup_hash_locked(struct inpcbinfo *, struct in6_addr *,
10061861Sru			   u_int, struct in6_addr *, u_int, int,
10161861Sru			   struct ifnet *);
10261861Srustruct	inpcb *
10361861Sru	in6_pcblookup_mbuf(struct inpcbinfo *, struct in6_addr *,
10461861Sru			   u_int, struct in6_addr *, u_int, int,
10561861Sru			   struct ifnet *ifp, struct mbuf *);
10661861Sruvoid	in6_pcbnotify(struct inpcbinfo *, struct sockaddr *,
10761861Sru			   u_int, const struct sockaddr *, u_int, int, void *,
10861861Sru			   struct inpcb *(*)(struct inpcb *, int));
10961861Srustruct inpcb *
11061861Sru	in6_rtchange(struct inpcb *, int);
11161861Srustruct sockaddr *
11261861Sru	in6_sockaddr(in_port_t port, struct in6_addr *addr_p);
11361861Srustruct sockaddr *
11461861Sru	in6_v4mapsin6_sockaddr(in_port_t port, struct in_addr *addr_p);
11561861Sruint	in6_getpeeraddr(struct socket *so, struct sockaddr **nam);
11661861Sruint	in6_getsockaddr(struct socket *so, struct sockaddr **nam);
11761861Sruint	in6_mapped_sockaddr(struct socket *so, struct sockaddr **nam);
11861861Sruint	in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam);
11961861Sruint	in6_selecthlim(struct in6pcb *, struct ifnet *);
12061861Sruint	in6_pcbsetport(struct in6_addr *, struct inpcb *, struct ucred *);
12161861Sruvoid	init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m);
12261861Sru#endif /* _KERNEL */
12361861Sru
12461861Sru#endif /* !_NETINET6_IN6_PCB_H_ */
12561861Sru