1 /* $NetBSD: prune.h,v 1.1 2002/10/01 03:31:09 itojun Exp $ */
4 * The mrouted program is covered by the license in the accompanying file
5 * named "LICENSE". Use of the mrouted program represents acceptance of
6 * the terms and conditions listed in that file.
8 * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
9 * Leland Stanford Junior University.
15 * Each group entry is a member of two doubly-linked lists:
17 * a) A list hanging off of the routing table entry for this source (rt_groups)
18 * sorted by group address under the routing entry (gt_next, gt_prev)
19 * b) An independent list pointed to by kernel_table, which is a list of
20 * active source,group's (gt_gnext, gt_gprev).
24 struct gtable
*gt_next
; /* pointer to the next entry */
25 struct gtable
*gt_prev
; /* back pointer for linked list */
26 struct gtable
*gt_gnext
; /* fwd pointer for group list */
27 struct gtable
*gt_gprev
; /* rev pointer for group list */
28 u_int32_t gt_mcastgrp
; /* multicast group associated */
29 vifbitmap_t gt_scope
; /* scoped interfaces */
30 u_char gt_ttls
[MAXVIFS
]; /* ttl vector for forwarding */
31 vifbitmap_t gt_grpmems
; /* forw. vifs for src, grp */
32 int gt_prsent_timer
; /* prune timer for this group */
33 int gt_timer
; /* timer for this group entry */
34 time_t gt_ctime
; /* time of entry creation */
35 u_char gt_grftsnt
; /* graft sent/retransmit timer */
36 struct stable
*gt_srctbl
; /* source table */
37 struct ptable
*gt_pruntbl
; /* prune table */
38 struct rtentry
*gt_route
; /* parent route */
40 struct rsrr_cache
*gt_rsrr_cache
; /* RSRR cache */
47 * When source-based prunes exist, there will be a struct ptable here as well.
51 struct stable
*st_next
; /* pointer to the next entry */
52 u_int32_t st_origin
; /* host origin of multicasts */
53 u_long st_pktcnt
; /* packet count for src-grp entry */
57 * structure to store incoming prunes. Can hang off of either group or source.
61 struct ptable
*pt_next
; /* pointer to the next entry */
62 u_int32_t pt_router
; /* router that sent this prune */
63 vifi_t pt_vifi
; /* vif prune received on */
64 int pt_timer
; /* timer for prune */
68 * The packet format for a traceroute request.
71 u_int32_t tr_src
; /* traceroute source */
72 u_int32_t tr_dst
; /* traceroute destination */
73 u_int32_t tr_raddr
; /* traceroute response address */
74 #if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN)
76 u_int qid
: 24; /* traceroute query id */
77 u_int ttl
: 8; /* traceroute response ttl */
81 u_int ttl
: 8; /* traceroute response ttl */
82 u_int qid
: 24; /* traceroute query id */
84 #endif /* BYTE_ORDER */
91 * Traceroute response format. A traceroute response has a tr_query at the
92 * beginning, followed by one tr_resp for each hop taken.
95 u_int32_t tr_qarr
; /* query arrival time */
96 u_int32_t tr_inaddr
; /* incoming interface address */
97 u_int32_t tr_outaddr
; /* outgoing interface address */
98 u_int32_t tr_rmtaddr
; /* parent address in source tree */
99 u_int32_t tr_vifin
; /* input packet count on interface */
100 u_int32_t tr_vifout
; /* output packet count on interface */
101 u_int32_t tr_pktcnt
; /* total incoming packets for src-grp */
102 u_char tr_rproto
; /* routing protocol deployed on router */
103 u_char tr_fttl
; /* ttl required to forward on outvif */
104 u_char tr_smask
; /* subnet mask for src addr */
105 u_char tr_rflags
; /* forwarding error codes */
108 /* defs within mtrace */
111 #define QLEN sizeof(struct tr_query)
112 #define RLEN sizeof(struct tr_resp)
114 /* fields for tr_rflags (forwarding error codes) */
116 #define TR_WRONG_IF 1
122 #define TR_RP_OR_CORE 8
124 #define TR_NO_MULTICAST 10
125 #define TR_NO_SPACE 0x81
126 #define TR_OLD_ROUTER 0x82
127 #define TR_ADMIN_DENY 0x83
129 /* fields for tr_rproto (routing protocol) */
130 #define PROTO_DVMRP 1
131 #define PROTO_MOSPF 2
134 #define PROTO_PIM_SPEC 5
135 #define PROTO_PIM_STAT 6
136 #define PROTO_DVMRP_STAT 7
137 #define PROTO_PIM_MBGP 8
139 #define MASK_TO_VAL(x, i) { \
140 u_int32_t _x = ntohl(x); \
146 #define VAL_TO_MASK(x, i) { \
147 x = htonl(~((1 << (32 - (i))) - 1)); \
150 #define NBR_VERS(n) (((n)->al_pv << 8) + (n)->al_mv)