]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/mrouted/vif.h
This commit was generated by cvs2svn to compensate for changes in r39297,
[FreeBSD/FreeBSD.git] / usr.sbin / mrouted / vif.h
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$
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_char           uv_admetric;   /* advertised cost of this vif          */
24     u_int            uv_rate_limit; /* rate limit on this vif               */
25     u_char           uv_threshold;  /* min ttl required to forward on vif   */
26     u_int32          uv_lcl_addr;   /* local address of this vif            */
27     u_int32          uv_rmt_addr;   /* remote end-point addr (tunnels only) */
28     u_int32          uv_subnet;     /* subnet number         (phyints only) */
29     u_int32          uv_subnetmask; /* subnet mask           (phyints only) */
30     u_int32          uv_subnetbcast;/* subnet broadcast addr (phyints only) */
31     char             uv_name[IFNAMSIZ]; /* interface name                   */
32     struct listaddr *uv_groups;     /* list of local groups  (phyints only) */
33     struct listaddr *uv_neighbors;  /* list of neighboring routers          */
34     struct vif_acl  *uv_acl;        /* access control list of groups        */
35     int              uv_leaf_timer; /* time until this vif is considrd leaf */
36     struct phaddr   *uv_addrs;      /* Additional subnets on this vif       */
37 };
38
39 #define VIFF_KERNEL_FLAGS       (VIFF_TUNNEL|VIFF_SRCRT)
40 #define VIFF_DOWN               0x0100         /* kernel state of interface */
41 #define VIFF_DISABLED           0x0200         /* administratively disabled */
42 #define VIFF_QUERIER            0x0400         /* I am the subnet's querier */
43 #define VIFF_ONEWAY             0x0800         /* Maybe one way interface   */
44 #define VIFF_LEAF               0x1000         /* all neighbors are leaves  */
45 #define VIFF_IGMPV1             0x2000         /* Act as an IGMPv1 Router   */
46
47 struct phaddr {
48     struct phaddr   *pa_next;
49     u_int32          pa_subnet;         /* extra subnet                 */
50     u_int32          pa_subnetmask;     /* netmask of extra subnet      */
51     u_int32          pa_subnetbcast;    /* broadcast of extra subnet    */
52 };
53
54 struct vif_acl {
55     struct vif_acl  *acl_next;      /* next acl member         */
56     u_int32          acl_addr;      /* Group address           */
57     u_int32          acl_mask;      /* Group addr. mask        */
58 };
59
60 struct listaddr {
61     struct listaddr *al_next;           /* link to next addr, MUST BE FIRST */
62     u_int32          al_addr;           /* local group or neighbor address  */
63     u_long           al_timer;          /* for timing out group or neighbor */
64     time_t           al_ctime;          /* neighbor creation time           */
65     u_int32          al_genid;          /* generation id for neighbor       */
66     u_char           al_pv;             /* router protocol version          */
67     u_char           al_mv;             /* router mrouted version           */
68     u_long           al_timerid;        /* returned by set timer            */
69     u_long           al_query;          /* second query in case of leave    */
70     u_short          al_old;            /* time since heard old report      */
71     u_char           al_flags;          /* flags related to this neighbor   */
72 };
73
74 #define NF_LEAF                 0x01    /* This neighbor is a leaf */
75 #define NF_PRUNE                0x02    /* This neighbor understands prunes */
76 #define NF_GENID                0x04    /* I supply genid & rtrlist in probe*/
77 #define NF_MTRACE               0x08    /* I can understand mtrace requests */
78
79 #define NO_VIF          ((vifi_t)MAXVIFS)  /* An invalid vif index */