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