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