1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)in_pcb.c 8.2 (Berkeley) 1/4/94 61 */ 62 63#include <sys/cdefs.h> |
64__FBSDID("$FreeBSD: head/sys/netinet6/in6_src.c 241916 2012-10-22 21:49:56Z delphij $"); |
65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_mpath.h" 69 70#include <sys/param.h> 71#include <sys/systm.h> 72#include <sys/lock.h> --- 49 unchanged lines hidden (view full) --- 122#define ADDRSEL_XUNLOCK() sx_xunlock(&addrsel_sxlock) 123 124#define ADDR_LABEL_NOTAPP (-1) 125static VNET_DEFINE(struct in6_addrpolicy, defaultaddrpolicy); 126#define V_defaultaddrpolicy VNET(defaultaddrpolicy) 127 128VNET_DEFINE(int, ip6_prefer_tempaddr) = 0; 129 |
130static int selectroute(struct sockaddr_in6 *, struct ip6_pktopts *, |
131 struct ip6_moptions *, struct route_in6 *, struct ifnet **, |
132 struct rtentry **, int, u_int); 133static int in6_selectif(struct sockaddr_in6 *, struct ip6_pktopts *, |
134 struct ip6_moptions *, struct route_in6 *ro, struct ifnet **, |
135 struct ifnet *, u_int); |
136 137static struct in6_addrpolicy *lookup_addrsel_policy(struct sockaddr_in6 *); 138 139static void init_policy_queue(void); 140static int add_addrsel_policyent(struct in6_addrpolicy *); 141static int delete_addrsel_policyent(struct in6_addrpolicy *); |
142static int walk_addrsel_policy(int (*)(struct in6_addrpolicy *, void *), 143 void *); |
144static int dump_addrsel_policyent(struct in6_addrpolicy *, void *); 145static struct in6_addrpolicy *match_addrsel_policy(struct sockaddr_in6 *); 146 147/* 148 * Return an IPv6 address, which is the most appropriate for a given 149 * destination and user specified options. 150 * If necessary, this function lookups the routing table and returns 151 * an entry to the caller for later use. --- 1025 unchanged lines hidden --- |