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 262763 2014-03-05 01:17:47Z glebius $ |
31 */ 32 33#ifndef _NET_ROUTE_H_ 34#define _NET_ROUTE_H_ 35 |
36#include <sys/counter.h> 37 |
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 |
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 */ |
118 struct ifnet *rt_ifp; /* the answer: interface to use */ 119 struct ifaddr *rt_ifa; /* the answer: interface address to use */ |
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 */ |
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 |
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 --- |