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.
6 * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
7 * Leland Stanford Junior University.
11 * prune.h,v 3.8.4.5 1998/02/27 22:45:43 fenner Exp
17 * Each group entry is a member of two doubly-linked lists:
19 * a) A list hanging off of the routing table entry for this source (rt_groups)
20 * sorted by group address under the routing entry (gt_next, gt_prev)
21 * b) An independent list pointed to by kernel_table, which is a list of
22 * active source,group's (gt_gnext, gt_gprev).
26 struct gtable *gt_next; /* pointer to the next entry */
27 struct gtable *gt_prev; /* back pointer for linked list */
28 struct gtable *gt_gnext; /* fwd pointer for group list */
29 struct gtable *gt_gprev; /* rev pointer for group list */
30 u_int32 gt_mcastgrp; /* multicast group associated */
31 vifbitmap_t gt_scope; /* scoped interfaces */
32 u_char gt_ttls[MAXVIFS]; /* ttl vector for forwarding */
33 vifbitmap_t gt_grpmems; /* forw. vifs for src, grp */
34 int gt_prsent_timer; /* prune timer for this group */
35 int gt_timer; /* timer for this group entry */
36 time_t gt_ctime; /* time of entry creation */
37 u_char gt_grftsnt; /* graft sent/retransmit timer */
38 nbrbitmap_t gt_prunes; /* bitmap of neighbors who pruned */
39 struct stable *gt_srctbl; /* source table */
40 struct ptable *gt_pruntbl; /* prune table */
41 struct rtentry *gt_route; /* parent route */
42 int gt_rexmit_timer; /* timer for prune retransmission */
43 int gt_prune_rexmit; /* time til prune retransmission */
45 struct rsrr_cache *gt_rsrr_cache; /* RSRR cache */
52 * When source-based prunes exist, there will be a struct ptable here as well.
56 struct stable *st_next; /* pointer to the next entry */
57 u_int32 st_origin; /* host origin of multicasts */
58 u_long st_pktcnt; /* packet count for src-grp entry */
59 u_long st_savpkt; /* saved pkt cnt when no krnl entry */
60 time_t st_ctime; /* kernel entry creation time */
64 * structure to store incoming prunes. Can hang off of either group or source.
68 struct ptable *pt_next; /* pointer to the next entry */
69 u_int32 pt_router; /* router that sent this prune */
70 vifi_t pt_vifi; /* vif prune received on */
71 int pt_index; /* neighbor index of router */
72 int pt_timer; /* timer for prune */
75 #define MIN_PRUNE_LIFE TIMER_INTERVAL /* min prune lifetime to bother with */
78 * The packet format for a traceroute request.
81 u_int32 tr_src; /* traceroute source */
82 u_int32 tr_dst; /* traceroute destination */
83 u_int32 tr_raddr; /* traceroute response address */
84 #if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
86 u_int qid : 24; /* traceroute query id */
87 u_int ttl : 8; /* traceroute response ttl */
91 u_int ttl : 8; /* traceroute response ttl */
92 u_int qid : 24; /* traceroute query id */
94 #endif /* BYTE_ORDER */
101 * Traceroute response format. A traceroute response has a tr_query at the
102 * beginning, followed by one tr_resp for each hop taken.
105 u_int32 tr_qarr; /* query arrival time */
106 u_int32 tr_inaddr; /* incoming interface address */
107 u_int32 tr_outaddr; /* outgoing interface address */
108 u_int32 tr_rmtaddr; /* parent address in source tree */
109 u_int32 tr_vifin; /* input packet count on interface */
110 u_int32 tr_vifout; /* output packet count on interface */
111 u_int32 tr_pktcnt; /* total incoming packets for src-grp */
112 u_char tr_rproto; /* routing protocol deployed on router */
113 u_char tr_fttl; /* ttl required to forward on outvif */
114 u_char tr_smask; /* subnet mask for src addr */
115 u_char tr_rflags; /* forwarding error codes */
118 /* defs within mtrace */
121 #define QLEN sizeof(struct tr_query)
122 #define RLEN sizeof(struct tr_resp)
124 /* fields for tr_rflags (forwarding error codes) */
126 #define TR_WRONG_IF 1
132 #define TR_NO_SPACE 0x81
133 #define TR_OLD_ROUTER 0x82
135 /* fields for tr_rproto (routing protocol) */
136 #define PROTO_DVMRP 1
137 #define PROTO_MOSPF 2
141 #define MASK_TO_VAL(x, i) { \
142 u_int32 _x = ntohl(x); \
148 #define VAL_TO_MASK(x, i) { \
149 x = i ? htonl(~((1 << (32 - (i))) - 1)) : 0; \
152 #define NBR_VERS(n) (((n)->al_pv << 8) + (n)->al_mv)