1 /* route.h 4.6 82/03/30 */ 2 3 /* 4 * Structure of kernel resident routing 5 * data base. Assumption is user routing 6 * daemon maintains this data base based 7 * on routing information it gleans from 8 * gateway protocols it listens to (e.g. GGP). 9 * 10 * TO ADD: 11 * more statistics -- smooth usage figures 12 */ 13 struct rtentry { 14 u_long rt_hash; /* for net or for host */ 15 struct sockaddr rt_dst; /* match value */ 16 struct sockaddr rt_gateway; /* who to forward to */ 17 short rt_flags; /* see below */ 18 short rt_refcnt; /* # held references */ 19 u_long rt_use; /* raw # packets forwarded */ 20 struct ifnet *rt_ifp; /* interface to use */ 21 }; 22 23 struct route { 24 struct rtentry *ro_rt; 25 struct sockaddr ro_dst; 26 caddr_t ro_pcb; /* back pointer? */ 27 }; 28 29 /* 30 * Flags and host/network status. 31 */ 32 #define RTF_UP 0x1 /* route useable */ 33 #define RTF_DIRECT 0x2 /* destination is a neighbor */ 34 #define RTF_HOST 0x4 /* host entry (net otherwise) */ 35 36 #ifdef KERNEL 37 /* 38 * Lookup are hashed by a key. Each hash bucket 39 * consists of a linked list of mbuf's 40 * containing routing entries. Dead entries are 41 * reclaimed along with mbufs. 42 */ 43 #define RTHASHSIZ 7 44 struct mbuf *rthost[RTHASHSIZ]; 45 struct mbuf *rtnet[RTHASHSIZ]; 46 #endif 47