1 /* 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. 5 * 6 * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of 7 * Leland Stanford Junior University. 8 * 9 * 10 * $Id: vif.h,v 1.4 1995/06/01 02:26:13 mycroft Exp $ 11 */ 12 13 /* 14 * User level Virtual Interface structure 15 * 16 * A "virtual interface" is either a physical, multicast-capable interface 17 * (called a "phyint") or a virtual point-to-point link (called a "tunnel"). 18 * (Note: all addresses, subnet numbers and masks are kept in NETWORK order.) 19 */ 20 struct uvif { 21 u_short uv_flags; /* VIFF_ flags defined below */ 22 u_char uv_metric; /* cost of this vif */ 23 u_int uv_rate_limit; /* rate limit on this vif */ 24 u_char uv_threshold; /* min ttl required to forward on vif */ 25 u_int32_t uv_lcl_addr; /* local address of this vif */ 26 u_int32_t uv_rmt_addr; /* remote end-point addr (tunnels only) */ 27 u_int32_t uv_subnet; /* subnet number (phyints only) */ 28 u_int32_t uv_subnetmask; /* subnet mask (phyints only) */ 29 u_int32_t uv_subnetbcast;/* subnet broadcast addr (phyints only) */ 30 char uv_name[IFNAMSIZ]; /* interface name */ 31 struct listaddr *uv_groups; /* list of local groups (phyints only) */ 32 struct listaddr *uv_neighbors; /* list of neighboring routers */ 33 struct vif_acl *uv_acl; /* access control list of groups */ 34 int uv_leaf_timer; /* time until this vif is considrd leaf */ 35 struct phaddr *uv_addrs; /* Additional subnets on this vif */ 36 }; 37 38 #define VIFF_KERNEL_FLAGS (VIFF_TUNNEL|VIFF_SRCRT) 39 #define VIFF_DOWN 0x0100 /* kernel state of interface */ 40 #define VIFF_DISABLED 0x0200 /* administratively disabled */ 41 #define VIFF_QUERIER 0x0400 /* I am the subnet's querier */ 42 #define VIFF_ONEWAY 0x0800 /* Maybe one way interface */ 43 #define VIFF_LEAF 0x1000 /* all neighbors are leaves */ 44 45 struct phaddr { 46 struct phaddr *pa_next; 47 u_long pa_addr; 48 u_long pa_mask; 49 }; 50 51 struct vif_acl { 52 struct vif_acl *acl_next; /* next acl member */ 53 u_int32_t acl_addr; /* Group address */ 54 u_int32_t acl_mask; /* Group addr. mask */ 55 }; 56 57 struct listaddr { 58 struct listaddr *al_next; /* link to next addr, MUST BE FIRST */ 59 u_int32_t al_addr; /* local group or neighbor address */ 60 u_long al_timer; /* for timing out group or neighbor */ 61 time_t al_ctime; /* neighbor creation time */ 62 u_int32_t al_genid; /* generation id for neighbor */ 63 u_char al_pv; /* router protocol version */ 64 u_char al_mv; /* router mrouted version */ 65 u_long al_timerid; /* returned by set timer */ 66 u_long al_query; /* second query in case of leave */ 67 u_short al_old; /* if old memberships are present */ 68 u_short al_last; /* # of query's since last old rep */ 69 u_char al_flags; /* flags related to this neighbor */ 70 }; 71 72 #define NF_LEAF 0x01 /* This neighbor is a leaf */ 73 #define NF_PRUNE 0x02 /* This neighbor understands prunes */ 74 #define NF_GENID 0x04 /* I supply genid & rtrlist in probe*/ 75 #define NF_MTRACE 0x08 /* I can understand mtrace requests */ 76 77 #define NO_VIF ((vifi_t)MAXVIFS) /* An invalid vif index */ 78