1994-09-08 00:26:13 +00:00
|
|
|
/*
|
|
|
|
* The mrouted program is covered by the license in the accompanying file
|
|
|
|
* named "LICENSE". Use of the mrouted program represents acceptance of
|
|
|
|
* the terms and conditions listed in that file.
|
|
|
|
*
|
|
|
|
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
|
|
|
|
* Leland Stanford Junior University.
|
|
|
|
*
|
|
|
|
*
|
1999-08-28 01:35:59 +00:00
|
|
|
* $FreeBSD$
|
1999-01-20 07:55:57 +00:00
|
|
|
* route.h,v 3.8.4.6 1997/07/01 23:02:35 fenner Exp
|
1994-09-08 00:26:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Routing Table Entry, one per subnet from which a multicast could originate.
|
|
|
|
* (Note: all addresses, subnet numbers and masks are kept in NETWORK order.)
|
|
|
|
*
|
1995-06-13 18:05:16 +00:00
|
|
|
* The Routing Table is stored as a doubly-linked list of these structures,
|
|
|
|
* ordered by decreasing value of rt_originmask and, secondarily, by
|
|
|
|
* decreasing value of rt_origin within each rt_originmask value.
|
1994-09-08 00:26:13 +00:00
|
|
|
* This data structure is efficient for generating route reports, whether
|
|
|
|
* full or partial, for processing received full reports, for clearing the
|
|
|
|
* CHANGED flags, and for periodically advancing the timers in all routes.
|
|
|
|
* It is not so efficient for updating a small number of routes in response
|
|
|
|
* to a partial report. In a stable topology, the latter are rare; if they
|
|
|
|
* turn out to be costing a lot, we can add an auxiliary hash table for
|
|
|
|
* faster access to arbitrary route entries.
|
|
|
|
*/
|
|
|
|
struct rtentry {
|
|
|
|
struct rtentry *rt_next; /* link to next entry MUST BE FIRST */
|
1995-06-13 18:05:16 +00:00
|
|
|
u_int32 rt_origin; /* subnet origin of multicasts */
|
|
|
|
u_int32 rt_originmask; /* subnet mask for origin */
|
1994-09-08 00:26:13 +00:00
|
|
|
short rt_originwidth; /* # bytes of origin subnet number */
|
|
|
|
u_char rt_metric; /* cost of route back to origin */
|
|
|
|
u_char rt_flags; /* RTF_ flags defined below */
|
1995-06-13 18:05:16 +00:00
|
|
|
u_int32 rt_gateway; /* first-hop gateway back to origin */
|
1994-09-08 00:26:13 +00:00
|
|
|
vifi_t rt_parent; /* incoming vif (ie towards origin) */
|
|
|
|
vifbitmap_t rt_children; /* outgoing children vifs */
|
1995-06-13 18:05:16 +00:00
|
|
|
u_int32 *rt_dominants; /* per vif dominant gateways */
|
1999-01-20 07:55:57 +00:00
|
|
|
nbrbitmap_t rt_subordinates; /* bitmap of subordinate gateways */
|
|
|
|
nbrbitmap_t rt_subordadv; /* recently advertised subordinates */
|
1995-06-28 17:58:49 +00:00
|
|
|
u_int rt_timer; /* for timing out the route entry */
|
1995-06-13 18:05:16 +00:00
|
|
|
struct rtentry *rt_prev; /* link to previous entry */
|
|
|
|
struct gtable *rt_groups; /* link to active groups */
|
1994-09-08 00:26:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define RTF_CHANGED 0x01 /* route changed but not reported */
|
1999-01-20 07:55:57 +00:00
|
|
|
#define RTF_HOLDDOWN 0x04 /* this route is in holddown */
|
1994-09-08 00:26:13 +00:00
|
|
|
|
|
|
|
#define ALL_ROUTES 0 /* possible arguments to report() */
|
|
|
|
#define CHANGED_ROUTES 1 /* and report_to_all_neighbors() */
|
1999-01-20 07:55:57 +00:00
|
|
|
|
|
|
|
#define RT_FMT(r, s) inet_fmts((r)->rt_origin, (r)->rt_originmask, s)
|