Commit | Line | Data |
---|---|---|
5ff67f98 DF |
1 | /* |
2 | * Copyright (c) 1983 Regents of the University of California. | |
0eb85d71 | 3 | * All rights reserved. |
5ff67f98 | 4 | * |
d60d530a | 5 | * %sccs.include.redist.c% |
0eb85d71 | 6 | * |
d60d530a | 7 | * @(#)interface.h 5.6 (Berkeley) %G% |
5ff67f98 | 8 | */ |
1ead8310 SL |
9 | |
10 | /* | |
11 | * Routing table management daemon. | |
12 | */ | |
13 | ||
14 | /* | |
15 | * An ``interface'' is similar to an ifnet structure, | |
16 | * except it doesn't contain q'ing info, and it also | |
17 | * handles ``logical'' interfaces (remote gateways | |
18 | * that we want to keep polling even if they go down). | |
19 | * The list of interfaces which we maintain is used | |
20 | * in supplying the gratuitous routing table updates. | |
21 | */ | |
22 | struct interface { | |
23 | struct interface *int_next; | |
24 | struct sockaddr int_addr; /* address on this host */ | |
25 | union { | |
26 | struct sockaddr intu_broadaddr; | |
27 | struct sockaddr intu_dstaddr; | |
28 | } int_intu; | |
29 | #define int_broadaddr int_intu.intu_broadaddr /* broadcast address */ | |
30 | #define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */ | |
31 | int int_metric; /* init's routing entry */ | |
32 | int int_flags; /* see below */ | |
d002aa8c MK |
33 | /* START INTERNET SPECIFIC */ |
34 | u_long int_net; /* network # */ | |
35 | u_long int_netmask; /* net mask for addr */ | |
36 | u_long int_subnet; /* subnet # */ | |
37 | u_long int_subnetmask; /* subnet mask for addr */ | |
38 | /* END INTERNET SPECIFIC */ | |
1ead8310 SL |
39 | struct ifdebug int_input, int_output; /* packet tracing stuff */ |
40 | int int_ipackets; /* input packets received */ | |
41 | int int_opackets; /* output packets sent */ | |
42 | char *int_name; /* from kernel if structure */ | |
43 | u_short int_transitions; /* times gone up-down */ | |
44 | }; | |
45 | ||
46 | /* | |
d002aa8c | 47 | * 0x1 to 0x10 are reused from the kernel's ifnet definitions, |
2198ed48 | 48 | * the others agree with the RTS_ flags defined elsewhere. |
1ead8310 SL |
49 | */ |
50 | #define IFF_UP 0x1 /* interface is up */ | |
51 | #define IFF_BROADCAST 0x2 /* broadcast address valid */ | |
52 | #define IFF_DEBUG 0x4 /* turn on debugging */ | |
a28c0bd8 | 53 | #define IFF_LOOPBACK 0x8 /* software loopback net */ |
1ead8310 | 54 | #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */ |
2198ed48 | 55 | |
4fad5a6e | 56 | #define IFF_SUBNET 0x1000 /* interface on subnetted network */ |
2198ed48 MK |
57 | #define IFF_PASSIVE 0x2000 /* can't tell if up/down */ |
58 | #define IFF_INTERFACE 0x4000 /* hardware interface */ | |
59 | #define IFF_REMOTE 0x8000 /* interface isn't on this machine */ | |
1ead8310 SL |
60 | |
61 | struct interface *if_ifwithaddr(); | |
4fad5a6e | 62 | struct interface *if_ifwithdstaddr(); |
1ead8310 SL |
63 | struct interface *if_ifwithnet(); |
64 | struct interface *if_iflookup(); |