BSD 4_3_Net_1 development
[unix-history] / egp / if.h
CommitLineData
5a1bce00
C
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 */
15struct interface {
16 struct interface *int_next;
17 struct sockaddr int_addr; /* address on this host */
18 union {
19 struct sockaddr intu_broadaddr;
20 struct sockaddr intu_dstaddr;
21 } int_intu;
22#define int_broadaddr int_intu.intu_broadaddr /* broadcast address */
23#define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */
24 u_long int_net; /* network # */
25 u_long int_netmask; /* net mask for addr */
26 u_long int_subnet; /* subnet # */
27 u_long int_subnetmask; /* subnet mask for addr */
28 int int_metric; /* init's routing entry */
29 int int_flags; /* see below */
30/* struct ifdebug int_input, int_output; /* packet tracing stuff */
31 int int_ipackets; /* input packets received */
32 int int_opackets; /* output packets sent */
33 char *int_name; /* from kernel if structure */
34 u_short int_transitions; /* times gone up-down */
35 int int_egpsock; /* egp raw socket */
36 int int_icmpsock; /* icmp raw socket */
37};
38
39/*
40 * 0x1 to 0x100 are reused from the kernel's ifnet definitions,
41 * the others agree with the RTS_ flags defined elsewhere.
42 */
43#define IFF_UP 0x1 /* interface is up */
44#define IFF_BROADCAST 0x2 /* broadcast address valid */
45#define IFF_DEBUG 0x4 /* turn on debugging */
46#define IFF_ROUTE 0x8 /* routing entry installed */
47#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
48
49#define IFF_PASSIVE 0x2000 /* can't tell if up/down */
50#define IFF_INTERFACE 0x4000 /* hardware interface */
51#define IFF_REMOTE 0x8000 /* interface isn't on this machine */
52
53/*
54struct interface *if_ifwithaddr();
55struct interface *if_ifwithnet();
56struct interface *if_iflookup();
57*/