Home | History | Annotate | Line # | Download | only in mrouted
route.h revision 1.2
      1 /*
      2  * The mrouted program is covered by the license in the accompanying file
      3  * named "LICENSE".  Use of the mrouted program represents acceptance of
      4  * the terms and conditions listed in that file.
      5  *
      6  * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
      7  * Leland Stanford Junior University.
      8  *
      9  *
     10  * $Id: route.h,v 1.2 1995/06/01 02:26:06 mycroft Exp $
     11  */
     12 
     13 /*
     14  * Routing Table Entry, one per subnet from which a multicast could originate.
     15  * (Note: all addresses, subnet numbers and masks are kept in NETWORK order.)
     16  *
     17  * The Routing Table is stored as a doubly-linked list of these structures,
     18  * ordered by decreasing value of rt_originmask and, secondarily, by
     19  * decreasing value of rt_origin within each rt_originmask value.
     20  * This data structure is efficient for generating route reports, whether
     21  * full or partial, for processing received full reports, for clearing the
     22  * CHANGED flags, and for periodically advancing the timers in all routes.
     23  * It is not so efficient for updating a small number of routes in response
     24  * to a partial report.  In a stable topology, the latter are rare; if they
     25  * turn out to be costing a lot, we can add an auxiliary hash table for
     26  * faster access to arbitrary route entries.
     27  */
     28 struct rtentry {
     29     struct rtentry  *rt_next;		/* link to next entry MUST BE FIRST */
     30     u_int32_t	     rt_origin;		/* subnet origin of multicasts      */
     31     u_int32_t	     rt_originmask;	/* subnet mask for origin           */
     32     short	     rt_originwidth;	/* # bytes of origin subnet number  */
     33     u_char	     rt_metric;		/* cost of route back to origin     */
     34     u_char	     rt_flags;		/* RTF_ flags defined below         */
     35     u_int32_t	     rt_gateway;	/* first-hop gateway back to origin */
     36     vifi_t	     rt_parent;	    	/* incoming vif (ie towards origin) */
     37     vifbitmap_t	     rt_children;	/* outgoing children vifs           */
     38     vifbitmap_t	     rt_leaves;		/* subset of outgoing children vifs */
     39     u_int32_t	    *rt_dominants;      /* per vif dominant gateways        */
     40     u_int32_t	    *rt_subordinates;   /* per vif subordinate gateways     */
     41     u_long	    *rt_leaf_timers;	/* per vif leaf confirmation timers */
     42     u_long	     rt_timer;		/* for timing out the route entry   */
     43     struct rtentry  *rt_prev;		/* link to previous entry           */
     44     struct gtable   *rt_groups;		/* link to active groups 	    */
     45 };
     46 
     47 #define	RTF_CHANGED		0x01	/* route changed but not reported   */
     48 #define RTF_LEAF_TIMING		0x02	/* some leaf timers are running     */
     49 
     50 #define ALL_ROUTES	0		/* possible arguments to report()   */
     51 #define CHANGED_ROUTES	1		/*  and report_to_all_neighbors()   */
     52