install correct aliases file
[unix-history] / usr / src / sbin / routed / interface.h
CommitLineData
5ff67f98
DF
1/*
2 * Copyright (c) 1983 Regents of the University of California.
0eb85d71 3 * All rights reserved.
5ff67f98 4 *
0eb85d71 5 * Redistribution and use in source and binary forms are permitted
b8c620d6
KB
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.
0eb85d71 16 *
b8c620d6 17 * @(#)interface.h 5.5 (Berkeley) %G%
5ff67f98 18 */
1ead8310
SL
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 */
32struct interface {
33 struct interface *int_next;
34 struct sockaddr int_addr; /* address on this host */
35 union {
36 struct sockaddr intu_broadaddr;
37 struct sockaddr intu_dstaddr;
38 } int_intu;
39#define int_broadaddr int_intu.intu_broadaddr /* broadcast address */
40#define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */
41 int int_metric; /* init's routing entry */
42 int int_flags; /* see below */
d002aa8c
MK
43 /* START INTERNET SPECIFIC */
44 u_long int_net; /* network # */
45 u_long int_netmask; /* net mask for addr */
46 u_long int_subnet; /* subnet # */
47 u_long int_subnetmask; /* subnet mask for addr */
48 /* END INTERNET SPECIFIC */
1ead8310
SL
49 struct ifdebug int_input, int_output; /* packet tracing stuff */
50 int int_ipackets; /* input packets received */
51 int int_opackets; /* output packets sent */
52 char *int_name; /* from kernel if structure */
53 u_short int_transitions; /* times gone up-down */
54};
55
56/*
d002aa8c 57 * 0x1 to 0x10 are reused from the kernel's ifnet definitions,
2198ed48 58 * the others agree with the RTS_ flags defined elsewhere.
1ead8310
SL
59 */
60#define IFF_UP 0x1 /* interface is up */
61#define IFF_BROADCAST 0x2 /* broadcast address valid */
62#define IFF_DEBUG 0x4 /* turn on debugging */
a28c0bd8 63#define IFF_LOOPBACK 0x8 /* software loopback net */
1ead8310 64#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
2198ed48 65
4fad5a6e 66#define IFF_SUBNET 0x1000 /* interface on subnetted network */
2198ed48
MK
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 */
1ead8310
SL
70
71struct interface *if_ifwithaddr();
4fad5a6e 72struct interface *if_ifwithdstaddr();
1ead8310
SL
73struct interface *if_ifwithnet();
74struct interface *if_iflookup();