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