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