|
|
1.1 root 1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
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.
18: *
19: * @(#)interface.h 5.6 (Berkeley) 6/1/90
20: */
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: */
34: struct 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 */
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 */
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: /*
59: * 0x1 to 0x10 are reused from the kernel's ifnet definitions,
60: * the others agree with the RTS_ flags defined elsewhere.
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 */
65: #define IFF_LOOPBACK 0x8 /* software loopback net */
66: #define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
67:
68: #define IFF_SUBNET 0x1000 /* interface on subnetted network */
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 */
72:
73: struct interface *if_ifwithaddr();
74: struct interface *if_ifwithdstaddr();
75: struct interface *if_ifwithnet();
76: struct interface *if_iflookup();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.