1 /* interface.h 4.2 84/04/09 */ 2 3 /* 4 * Routing table management daemon. 5 */ 6 7 /* 8 * An ``interface'' is similar to an ifnet structure, 9 * except it doesn't contain q'ing info, and it also 10 * handles ``logical'' interfaces (remote gateways 11 * that we want to keep polling even if they go down). 12 * The list of interfaces which we maintain is used 13 * in supplying the gratuitous routing table updates. 14 * We list only one address for each interface, the AF_XNS one. 15 */ 16 #define NIFADDR 3 17 struct interface { 18 struct interface *int_next; 19 struct sockaddr int_addr; /* address on this host */ 20 union { 21 struct sockaddr intu_broadaddr; 22 struct sockaddr intu_dstaddr; 23 } int_intu; 24 #define int_broadaddr int_intu.intu_broadaddr /* broadcast address */ 25 #define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */ 26 int int_metric; /* init's routing entry */ 27 int int_flags; /* see below */ 28 struct ifdebug int_input, int_output; /* packet tracing stuff */ 29 int int_ipackets; /* input packets received */ 30 int int_opackets; /* output packets sent */ 31 char *int_name; /* from kernel if structure */ 32 u_short int_transitions; /* times gone up-down */ 33 int int_ripsock[2]; /* socket to listen for RIP packets on */ 34 }; 35 36 /* 37 * 0x1 to 0x100 are reused from the kernel's ifnet definitions, 38 * the others agree with the RTS_ flags defined elsewhere. 39 */ 40 #define IFF_UP 0x1 /* interface is up */ 41 #define IFF_BROADCAST 0x2 /* broadcast address valid */ 42 #define IFF_DEBUG 0x4 /* turn on debugging */ 43 #define IFF_ROUTE 0x8 /* routing entry installed */ 44 #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ 45 #define IFF_LOCAL 0x100 /* local network, host part encoded */ 46 47 #define IFF_PASSIVE 0x2000 /* can't tell if up/down */ 48 #define IFF_INTERFACE 0x4000 /* hardware interface */ 49 #define IFF_REMOTE 0x8000 /* interface isn't on this machine */ 50 51 struct interface *if_ifwithaddr(); 52 struct interface *if_ifwithnet(); 53 struct interface *if_iflookup(); 54