xref: /csrg-svn/sys/net/route.h (revision 6357)
1*6357Ssam /*	route.h	4.4	82/03/29	*/
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 {
146332Ssam 	u_long	rt_key;			/* lookup key */
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 */
33*6357Ssam #define	RTF_DIRECT	0x2		/* destination is a neighbor */
346332Ssam 
356332Ssam #ifdef KERNEL
366332Ssam /*
376332Ssam  * Lookup are hashed by a key.  Each hash bucket
386332Ssam  * consists of a linked list of mbuf's
396332Ssam  * containing routing entries.  Dead entries are
406332Ssam  * reclaimed along with mbufs.
416332Ssam  */
426332Ssam #define	RTHASHSIZ	16
436332Ssam struct mbuf *routehash[RTHASHSIZ];
446339Ssam 
456339Ssam struct	rtentry *reroute();
466332Ssam #endif
47