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