1 /* route.h 4.2 82/03/28 */ 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_key; /* lookup key */ 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_MUNGE 0x2 /* munge packet src address */ 34 35 #ifdef KERNEL 36 /* 37 * Lookup are hashed by a key. Each hash bucket 38 * consists of a linked list of mbuf's 39 * containing routing entries. Dead entries are 40 * reclaimed along with mbufs. 41 */ 42 #define RTHASHSIZ 16 43 struct mbuf *routehash[RTHASHSIZ]; 44 45 struct rtentry *reroute(); 46 #endif 47