xref: /netbsd-src/usr.sbin/mrouted/vif.h (revision ae9172d6cd9432a6a1a56760d86b32c57a66c39c)
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.3 1994/06/09 16:04:05 brezak 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_char	     uv_threshold;  /* min ttl required to forward on vif   */
24     u_long	     uv_lcl_addr;   /* local address of this vif            */
25     u_long	     uv_rmt_addr;   /* remote end-point addr (tunnels only) */
26     u_long	     uv_subnet;     /* subnet number         (phyints only) */
27     u_long	     uv_subnetmask; /* subnet mask           (phyints only) */
28     u_long	     uv_subnetbcast;/* subnet broadcast addr (phyints only) */
29     char	     uv_name[IFNAMSIZ]; /* interface name                   */
30     struct listaddr *uv_groups;     /* list of local groups  (phyints only) */
31     struct listaddr *uv_neighbors;  /* list of neighboring routers          */
32 };
33 
34 #define VIFF_KERNEL_FLAGS	(VIFF_TUNNEL|VIFF_SRCRT)
35 #define VIFF_DOWN		0x0100	       /* kernel state of interface */
36 #define VIFF_DISABLED		0x0200	       /* administratively disabled */
37 #define VIFF_QUERIER		0x0400	       /* I am the subnet's querier */
38 
39 
40 struct listaddr {
41     struct listaddr *al_next;		/* link to next addr, MUST BE FIRST */
42     u_long	     al_addr;		/* local group or neighbor address  */
43     u_long	     al_timer;		/* for timing out group or neighbor */
44 };
45 
46 
47 #define NO_VIF		((vifi_t)MAXVIFS)  /* An invalid vif index */
48