BSD 4_3_Reno release
[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
1c15e888
C
6 * provided that: (1) source distributions retain this entire copyright
7 * notice and comment, and (2) distributions including binaries display
8 * the following acknowledgement: ``This product includes software
9 * developed by the University of California, Berkeley and its contributors''
10 * in the documentation or other materials provided with the distribution
11 * and in all advertising materials mentioning features or use of this
12 * software. Neither the name of the University nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
0eb85d71 18 *
1c15e888 19 * @(#)interface.h 5.6 (Berkeley) 6/1/90
5ff67f98 20 */
1ead8310
SL
21
22/*
23 * Routing table management daemon.
24 */
25
26/*
27 * An ``interface'' is similar to an ifnet structure,
28 * except it doesn't contain q'ing info, and it also
29 * handles ``logical'' interfaces (remote gateways
30 * that we want to keep polling even if they go down).
31 * The list of interfaces which we maintain is used
32 * in supplying the gratuitous routing table updates.
33 */
34struct interface {
35 struct interface *int_next;
36 struct sockaddr int_addr; /* address on this host */
37 union {
38 struct sockaddr intu_broadaddr;
39 struct sockaddr intu_dstaddr;
40 } int_intu;
41#define int_broadaddr int_intu.intu_broadaddr /* broadcast address */
42#define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */
43 int int_metric; /* init's routing entry */
44 int int_flags; /* see below */
d002aa8c
MK
45 /* START INTERNET SPECIFIC */
46 u_long int_net; /* network # */
47 u_long int_netmask; /* net mask for addr */
48 u_long int_subnet; /* subnet # */
49 u_long int_subnetmask; /* subnet mask for addr */
50 /* END INTERNET SPECIFIC */
1ead8310
SL
51 struct ifdebug int_input, int_output; /* packet tracing stuff */
52 int int_ipackets; /* input packets received */
53 int int_opackets; /* output packets sent */
54 char *int_name; /* from kernel if structure */
55 u_short int_transitions; /* times gone up-down */
56};
57
58/*
d002aa8c 59 * 0x1 to 0x10 are reused from the kernel's ifnet definitions,
2198ed48 60 * the others agree with the RTS_ flags defined elsewhere.
1ead8310
SL
61 */
62#define IFF_UP 0x1 /* interface is up */
63#define IFF_BROADCAST 0x2 /* broadcast address valid */
64#define IFF_DEBUG 0x4 /* turn on debugging */
a28c0bd8 65#define IFF_LOOPBACK 0x8 /* software loopback net */
1ead8310 66#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
2198ed48 67
4fad5a6e 68#define IFF_SUBNET 0x1000 /* interface on subnetted network */
2198ed48
MK
69#define IFF_PASSIVE 0x2000 /* can't tell if up/down */
70#define IFF_INTERFACE 0x4000 /* hardware interface */
71#define IFF_REMOTE 0x8000 /* interface isn't on this machine */
1ead8310
SL
72
73struct interface *if_ifwithaddr();
4fad5a6e 74struct interface *if_ifwithdstaddr();
1ead8310
SL
75struct interface *if_ifwithnet();
76struct interface *if_iflookup();