route.c (204902) | route.c (207369) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1991, 1993 3 * The Regents of the University of California. 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)route.c 8.3.1.1 (Berkeley) 2/23/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1991, 1993 3 * The Regents of the University of California. 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)route.c 8.3.1.1 (Berkeley) 2/23/95 |
30 * $FreeBSD: head/sys/net/route.c 204902 2010-03-09 01:11:45Z qingli $ | 30 * $FreeBSD: head/sys/net/route.c 207369 2010-04-29 11:52:42Z bz $ |
31 */ 32/************************************************************************ 33 * Note: In this file a 'fib' is a "forwarding information base" * 34 * Which is the new name for an in kernel routing (next hop) table. * 35 ***********************************************************************/ 36 37#include "opt_inet.h" 38#include "opt_route.h" --- 44 unchanged lines hidden (view full) --- 83 * to an interface. XXX this is a shotgun aproach to a problem that needs 84 * a more fine grained solution.. that will come. 85 */ 86u_int rt_add_addr_allfibs = 1; 87SYSCTL_INT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RW, 88 &rt_add_addr_allfibs, 0, ""); 89TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs); 90 | 31 */ 32/************************************************************************ 33 * Note: In this file a 'fib' is a "forwarding information base" * 34 * Which is the new name for an in kernel routing (next hop) table. * 35 ***********************************************************************/ 36 37#include "opt_inet.h" 38#include "opt_route.h" --- 44 unchanged lines hidden (view full) --- 83 * to an interface. XXX this is a shotgun aproach to a problem that needs 84 * a more fine grained solution.. that will come. 85 */ 86u_int rt_add_addr_allfibs = 1; 87SYSCTL_INT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RW, 88 &rt_add_addr_allfibs, 0, ""); 89TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs); 90 |
91VNET_DEFINE(struct radix_node_head *, rt_tables); 92static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ 93VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ | |
94VNET_DEFINE(struct rtstat, rtstat); | 91VNET_DEFINE(struct rtstat, rtstat); |
92#define V_rtstat VNET(rtstat) |
|
95 | 93 |
94VNET_DEFINE(struct radix_node_head *, rt_tables); |
|
96#define V_rt_tables VNET(rt_tables) | 95#define V_rt_tables VNET(rt_tables) |
97#define V_rtzone VNET(rtzone) | 96 97VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ |
98#define V_rttrash VNET(rttrash) | 98#define V_rttrash VNET(rttrash) |
99#define V_rtstat VNET(rtstat) | |
100 101 102/* compare two sockaddr structures */ 103#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) 104 105/* 106 * Convert a 'struct radix_node *' to a 'struct rtentry *'. 107 * The operation can be done safely (in this code) because a 108 * 'struct rtentry' starts with two 'struct radix_node''s, the first 109 * one representing leaf nodes in the routing tree, which is 110 * what the code in radix.c passes us as a 'struct radix_node'. 111 * 112 * But because there are a lot of assumptions in this conversion, 113 * do not cast explicitly, but always use the macro below. 114 */ 115#define RNTORT(p) ((struct rtentry *)(p)) 116 | 99 100 101/* compare two sockaddr structures */ 102#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) 103 104/* 105 * Convert a 'struct radix_node *' to a 'struct rtentry *'. 106 * The operation can be done safely (in this code) because a 107 * 'struct rtentry' starts with two 'struct radix_node''s, the first 108 * one representing leaf nodes in the routing tree, which is 109 * what the code in radix.c passes us as a 'struct radix_node'. 110 * 111 * But because there are a lot of assumptions in this conversion, 112 * do not cast explicitly, but always use the macro below. 113 */ 114#define RNTORT(p) ((struct rtentry *)(p)) 115 |
116static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ 117#define V_rtzone VNET(rtzone) 118 |
|
117#if 0 118/* default fib for tunnels to use */ 119u_int tunnel_fib = 0; 120SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); 121#endif 122 123/* 124 * handler for net.my_fibnum --- 1473 unchanged lines hidden --- | 119#if 0 120/* default fib for tunnels to use */ 121u_int tunnel_fib = 0; 122SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); 123#endif 124 125/* 126 * handler for net.my_fibnum --- 1473 unchanged lines hidden --- |