File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / mrouted / route.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:10:48 2012 UTC (12 years, 4 months ago) by misho
Branches: mrouted, MAIN
CVS tags: v3_9_6p0, v3_9_6, v3_9_5, HEAD
mrouted

    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: /*
   11:  * Routing Table Entry, one per subnet from which a multicast could originate.
   12:  * (Note: all addresses, subnet numbers and masks are kept in NETWORK order.)
   13:  *
   14:  * The Routing Table is stored as a doubly-linked list of these structures,
   15:  * ordered by decreasing value of rt_originmask and, secondarily, by
   16:  * decreasing value of rt_origin within each rt_originmask value.
   17:  * This data structure is efficient for generating route reports, whether
   18:  * full or partial, for processing received full reports, for clearing the
   19:  * CHANGED flags, and for periodically advancing the timers in all routes.
   20:  * It is not so efficient for updating a small number of routes in response
   21:  * to a partial report.  In a stable topology, the latter are rare; if they
   22:  * turn out to be costing a lot, we can add an auxiliary hash table for
   23:  * faster access to arbitrary route entries.
   24:  */
   25: struct rtentry {
   26:     struct rtentry  *rt_next;		/* link to next entry MUST BE FIRST */
   27:     u_int32	     rt_origin;		/* subnet origin of multicasts      */
   28:     u_int32	     rt_originmask;	/* subnet mask for origin           */
   29:     short	     rt_originwidth;	/* # bytes of origin subnet number  */
   30:     u_char	     rt_metric;		/* cost of route back to origin     */
   31:     u_char	     rt_flags;		/* RTF_ flags defined below         */
   32:     u_int32	     rt_gateway;	/* first-hop gateway back to origin */
   33:     vifi_t	     rt_parent;	    	/* incoming vif (ie towards origin) */
   34:     vifbitmap_t	     rt_children;	/* outgoing children vifs           */
   35:     u_int32	    *rt_dominants;      /* per vif dominant gateways        */
   36:     nbrbitmap_t	     rt_subordinates;   /* bitmap of subordinate gateways   */
   37:     nbrbitmap_t	     rt_subordadv;      /* recently advertised subordinates */
   38:     u_int	     rt_timer;		/* for timing out the route entry   */
   39:     struct rtentry  *rt_prev;		/* link to previous entry           */
   40:     struct gtable   *rt_groups;		/* link to active groups 	    */
   41: };
   42: 
   43: #define	RTF_CHANGED		0x01	/* route changed but not reported   */
   44: #define	RTF_HOLDDOWN		0x04	/* this route is in holddown	    */
   45: 
   46: #define ALL_ROUTES	0		/* possible arguments to report()   */
   47: #define CHANGED_ROUTES	1		/*  and report_to_all_neighbors()   */
   48: 
   49: #define	RT_FMT(r, s)	inet_fmts((r)->rt_origin, (r)->rt_originmask, s, sizeof(s))

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>