124327Ssklower /* 2*35551Sbostic * Copyright (c) 1983 The Regents of the University of California. 3*35551Sbostic * All rights reserved. 424327Ssklower * 5*35551Sbostic * Redistribution and use in source and binary forms are permitted 6*35551Sbostic * provided that the above copyright notice and this paragraph are 7*35551Sbostic * duplicated in all such forms and that any documentation, 8*35551Sbostic * advertising materials, and other materials related to such 9*35551Sbostic * distribution and use acknowledge that the software was developed 10*35551Sbostic * by the University of California, Berkeley. The name of the 11*35551Sbostic * University may not be used to endorse or promote products derived 12*35551Sbostic * from this software without specific prior written permission. 13*35551Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14*35551Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15*35551Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16*35551Sbostic * 17*35551Sbostic * @(#)interface.h 5.4 (Berkeley) 09/19/88 1824327Ssklower */ 1924308Ssklower 2024308Ssklower /* 2124308Ssklower * Routing table management daemon. 2224308Ssklower */ 2324308Ssklower 2424308Ssklower /* 2524308Ssklower * An ``interface'' is similar to an ifnet structure, 2624308Ssklower * except it doesn't contain q'ing info, and it also 2724308Ssklower * handles ``logical'' interfaces (remote gateways 2824308Ssklower * that we want to keep polling even if they go down). 2924308Ssklower * The list of interfaces which we maintain is used 3024308Ssklower * in supplying the gratuitous routing table updates. 3124308Ssklower * We list only one address for each interface, the AF_XNS one. 3224308Ssklower */ 3324308Ssklower #define NIFADDR 3 3424308Ssklower struct interface { 3524308Ssklower struct interface *int_next; 3624308Ssklower struct sockaddr int_addr; /* address on this host */ 3724308Ssklower union { 3824308Ssklower struct sockaddr intu_broadaddr; 3924308Ssklower struct sockaddr intu_dstaddr; 4024308Ssklower } int_intu; 4124308Ssklower #define int_broadaddr int_intu.intu_broadaddr /* broadcast address */ 4224308Ssklower #define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */ 4324308Ssklower int int_metric; /* init's routing entry */ 4424308Ssklower int int_flags; /* see below */ 4524308Ssklower struct ifdebug int_input, int_output; /* packet tracing stuff */ 4624308Ssklower int int_ipackets; /* input packets received */ 4724308Ssklower int int_opackets; /* output packets sent */ 4824308Ssklower char *int_name; /* from kernel if structure */ 4924308Ssklower u_short int_transitions; /* times gone up-down */ 5024327Ssklower /*XNS Specific entry */ 5124327Ssklower struct sameq { 5224327Ssklower struct sameq *n; /* q of other pt-to-pt links */ 5324327Ssklower struct sameq *p; /* with same net # */ 5424327Ssklower } int_sq; 5524308Ssklower }; 5624308Ssklower 5724308Ssklower /* 5824327Ssklower * 0x1 to 0x10 are reused from the kernel's ifnet definitions, 5924308Ssklower * the others agree with the RTS_ flags defined elsewhere. 6024308Ssklower */ 6124308Ssklower #define IFF_UP 0x1 /* interface is up */ 6224308Ssklower #define IFF_BROADCAST 0x2 /* broadcast address valid */ 6324308Ssklower #define IFF_DEBUG 0x4 /* turn on debugging */ 6424308Ssklower #define IFF_ROUTE 0x8 /* routing entry installed */ 6524308Ssklower #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ 6624308Ssklower 6724308Ssklower #define IFF_PASSIVE 0x2000 /* can't tell if up/down */ 6824308Ssklower #define IFF_INTERFACE 0x4000 /* hardware interface */ 6924308Ssklower #define IFF_REMOTE 0x8000 /* interface isn't on this machine */ 7024308Ssklower 7124308Ssklower struct interface *if_ifwithaddr(); 7224327Ssklower struct interface *if_ifwithdstaddr(); 7324308Ssklower struct interface *if_ifwithnet(); 7424308Ssklower struct interface *if_iflookup(); 75