route.h (260508) | route.h (262763) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 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.h 8.4 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 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.h 8.4 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/route.h 260508 2014-01-10 12:13:55Z melifaro $ | 30 * $FreeBSD: head/sys/net/route.h 262763 2014-03-05 01:17:47Z glebius $ |
31 */ 32 33#ifndef _NET_ROUTE_H_ 34#define _NET_ROUTE_H_ 35 | 31 */ 32 33#ifndef _NET_ROUTE_H_ 34#define _NET_ROUTE_H_ 35 |
36#include <sys/counter.h> 37 |
|
36/* 37 * Kernel resident routing tables. 38 * 39 * The routing tables are initialized when interface addresses 40 * are set by making entries for all directly connected interfaces. 41 */ 42 43/* --- 8 unchanged lines hidden (view full) --- 52 struct in_ifaddr *ro_ia; 53 int ro_flags; 54 struct sockaddr ro_dst; 55}; 56 57#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ 58#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ 59 | 38/* 39 * Kernel resident routing tables. 40 * 41 * The routing tables are initialized when interface addresses 42 * are set by making entries for all directly connected interfaces. 43 */ 44 45/* --- 8 unchanged lines hidden (view full) --- 54 struct in_ifaddr *ro_ia; 55 int ro_flags; 56 struct sockaddr ro_dst; 57}; 58 59#define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ 60#define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ 61 |
60/* 61 * These numbers are used by reliable protocols for determining 62 * retransmission behavior and are included in the routing structure. 63 */ 64struct rt_metrics_lite { 65 u_long rmx_mtu; /* MTU for this path */ 66 u_long rmx_expire; /* lifetime for route, e.g. redirect */ 67 u_long rmx_pksent; /* packets sent using this route */ 68 u_long rmx_weight; /* absolute weight */ 69}; 70 | |
71struct rt_metrics { 72 u_long rmx_locks; /* Kernel must leave these values alone */ 73 u_long rmx_mtu; /* MTU for this path */ 74 u_long rmx_hopcount; /* max hops expected */ 75 u_long rmx_expire; /* lifetime for route, e.g. redirect */ 76 u_long rmx_recvpipe; /* inbound delay-bandwidth product */ 77 u_long rmx_sendpipe; /* outbound delay-bandwidth product */ 78 u_long rmx_ssthresh; /* outbound gateway buffer limit */ --- 40 unchanged lines hidden (view full) --- 119 /* 120 * XXX struct rtentry must begin with a struct radix_node (or two!) 121 * because the code does some casts of a 'struct radix_node *' 122 * to a 'struct rtentry *' 123 */ 124#define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key))) 125#define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) 126 struct sockaddr *rt_gateway; /* value */ | 62struct rt_metrics { 63 u_long rmx_locks; /* Kernel must leave these values alone */ 64 u_long rmx_mtu; /* MTU for this path */ 65 u_long rmx_hopcount; /* max hops expected */ 66 u_long rmx_expire; /* lifetime for route, e.g. redirect */ 67 u_long rmx_recvpipe; /* inbound delay-bandwidth product */ 68 u_long rmx_sendpipe; /* outbound delay-bandwidth product */ 69 u_long rmx_ssthresh; /* outbound gateway buffer limit */ --- 40 unchanged lines hidden (view full) --- 110 /* 111 * XXX struct rtentry must begin with a struct radix_node (or two!) 112 * because the code does some casts of a 'struct radix_node *' 113 * to a 'struct rtentry *' 114 */ 115#define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key))) 116#define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) 117 struct sockaddr *rt_gateway; /* value */ |
127 int rt_flags; /* up/down?, host/net */ 128 int rt_refcnt; /* # held references */ | |
129 struct ifnet *rt_ifp; /* the answer: interface to use */ 130 struct ifaddr *rt_ifa; /* the answer: interface address to use */ | 118 struct ifnet *rt_ifp; /* the answer: interface to use */ 119 struct ifaddr *rt_ifa; /* the answer: interface address to use */ |
131 struct rt_metrics_lite rt_rmx; /* metrics used by rx'ing protocols */ 132 u_int rt_fibnum; /* which FIB */ 133#ifdef _KERNEL 134 /* XXX ugly, user apps use this definition but don't have a mtx def */ 135 struct mtx rt_mtx; /* mutex for routing entry */ 136#endif | 120 int rt_flags; /* up/down?, host/net */ 121 int rt_refcnt; /* # held references */ 122 u_int rt_fibnum; /* which FIB */ 123 u_long rt_mtu; /* MTU for this path */ 124 u_long rt_weight; /* absolute weight */ 125 u_long rt_expire; /* lifetime for route, e.g. redirect */ 126#define rt_endzero rt_pksent 127 counter_u64_t rt_pksent; /* packets sent using this route */ 128 struct mtx rt_mtx; /* mutex for routing entry */ |
137}; 138 139/* 140 * Following structure necessary for 4.3 compatibility; 141 * We should eventually move it to a compat file. 142 */ 143struct ortentry { 144 u_long rt_hash; /* to speed lookups */ 145 struct sockaddr rt_dst; /* key */ 146 struct sockaddr rt_gateway; /* value */ 147 short rt_flags; /* up/down?, host/net */ 148 short rt_refcnt; /* # held references */ 149 u_long rt_use; /* raw # packets forwarded */ 150 struct ifnet *rt_ifp; /* the answer: interface to use */ 151}; 152 | 129}; 130 131/* 132 * Following structure necessary for 4.3 compatibility; 133 * We should eventually move it to a compat file. 134 */ 135struct ortentry { 136 u_long rt_hash; /* to speed lookups */ 137 struct sockaddr rt_dst; /* key */ 138 struct sockaddr rt_gateway; /* value */ 139 short rt_flags; /* up/down?, host/net */ 140 short rt_refcnt; /* # held references */ 141 u_long rt_use; /* raw # packets forwarded */ 142 struct ifnet *rt_ifp; /* the answer: interface to use */ 143}; 144 |
153#define rt_use rt_rmx.rmx_pksent 154 | |
155#define RTF_UP 0x1 /* route usable */ 156#define RTF_GATEWAY 0x2 /* destination is a gateway */ 157#define RTF_HOST 0x4 /* host entry (net otherwise) */ 158#define RTF_REJECT 0x8 /* host or net unreachable */ 159#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ 160#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ 161#define RTF_DONE 0x40 /* message confirmed */ 162/* 0x80 unused, was RTF_DELCLONE */ --- 277 unchanged lines hidden --- | 145#define RTF_UP 0x1 /* route usable */ 146#define RTF_GATEWAY 0x2 /* destination is a gateway */ 147#define RTF_HOST 0x4 /* host entry (net otherwise) */ 148#define RTF_REJECT 0x8 /* host or net unreachable */ 149#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ 150#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ 151#define RTF_DONE 0x40 /* message confirmed */ 152/* 0x80 unused, was RTF_DELCLONE */ --- 277 unchanged lines hidden --- |