1 /* 2 * Copyright (c) 1983 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)interface.h 5.4 (Berkeley) 09/19/88 18 */ 19 20 /* 21 * Routing table management daemon. 22 */ 23 24 /* 25 * An ``interface'' is similar to an ifnet structure, 26 * except it doesn't contain q'ing info, and it also 27 * handles ``logical'' interfaces (remote gateways 28 * that we want to keep polling even if they go down). 29 * The list of interfaces which we maintain is used 30 * in supplying the gratuitous routing table updates. 31 * We list only one address for each interface, the AF_XNS one. 32 */ 33 #define NIFADDR 3 34 struct interface { 35 struct interface *int_next; 36 struct sockaddr int_addr; /* address on this host */ 37 union { 38 struct sockaddr intu_broadaddr; 39 struct sockaddr intu_dstaddr; 40 } int_intu; 41 #define int_broadaddr int_intu.intu_broadaddr /* broadcast address */ 42 #define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */ 43 int int_metric; /* init's routing entry */ 44 int int_flags; /* see below */ 45 struct ifdebug int_input, int_output; /* packet tracing stuff */ 46 int int_ipackets; /* input packets received */ 47 int int_opackets; /* output packets sent */ 48 char *int_name; /* from kernel if structure */ 49 u_short int_transitions; /* times gone up-down */ 50 /*XNS Specific entry */ 51 struct sameq { 52 struct sameq *n; /* q of other pt-to-pt links */ 53 struct sameq *p; /* with same net # */ 54 } int_sq; 55 }; 56 57 /* 58 * 0x1 to 0x10 are reused from the kernel's ifnet definitions, 59 * the others agree with the RTS_ flags defined elsewhere. 60 */ 61 #define IFF_UP 0x1 /* interface is up */ 62 #define IFF_BROADCAST 0x2 /* broadcast address valid */ 63 #define IFF_DEBUG 0x4 /* turn on debugging */ 64 #define IFF_ROUTE 0x8 /* routing entry installed */ 65 #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ 66 67 #define IFF_PASSIVE 0x2000 /* can't tell if up/down */ 68 #define IFF_INTERFACE 0x4000 /* hardware interface */ 69 #define IFF_REMOTE 0x8000 /* interface isn't on this machine */ 70 71 struct interface *if_ifwithaddr(); 72 struct interface *if_ifwithdstaddr(); 73 struct interface *if_ifwithnet(); 74 struct interface *if_iflookup(); 75