1*6377Ssam /* route.h 4.6 82/03/30 */ 26332Ssam 36332Ssam /* 46332Ssam * Structure of kernel resident routing 56332Ssam * data base. Assumption is user routing 66332Ssam * daemon maintains this data base based 76332Ssam * on routing information it gleans from 86332Ssam * gateway protocols it listens to (e.g. GGP). 96332Ssam * 106332Ssam * TO ADD: 116332Ssam * more statistics -- smooth usage figures 126332Ssam */ 136332Ssam struct rtentry { 14*6377Ssam u_long rt_hash; /* for net or for host */ 156332Ssam struct sockaddr rt_dst; /* match value */ 166332Ssam struct sockaddr rt_gateway; /* who to forward to */ 176332Ssam short rt_flags; /* see below */ 186332Ssam short rt_refcnt; /* # held references */ 196332Ssam u_long rt_use; /* raw # packets forwarded */ 206332Ssam struct ifnet *rt_ifp; /* interface to use */ 216332Ssam }; 226332Ssam 236332Ssam struct route { 246332Ssam struct rtentry *ro_rt; 256332Ssam struct sockaddr ro_dst; 266332Ssam caddr_t ro_pcb; /* back pointer? */ 276332Ssam }; 286332Ssam 296332Ssam /* 306332Ssam * Flags and host/network status. 316332Ssam */ 326339Ssam #define RTF_UP 0x1 /* route useable */ 336357Ssam #define RTF_DIRECT 0x2 /* destination is a neighbor */ 34*6377Ssam #define RTF_HOST 0x4 /* host entry (net otherwise) */ 356332Ssam 366332Ssam #ifdef KERNEL 376332Ssam /* 386332Ssam * Lookup are hashed by a key. Each hash bucket 396332Ssam * consists of a linked list of mbuf's 406332Ssam * containing routing entries. Dead entries are 416332Ssam * reclaimed along with mbufs. 426332Ssam */ 43*6377Ssam #define RTHASHSIZ 7 44*6377Ssam struct mbuf *rthost[RTHASHSIZ]; 45*6377Ssam struct mbuf *rtnet[RTHASHSIZ]; 466332Ssam #endif 47