checkpoint of hacking for mail.cs.berkeley.edu
[unix-history] / usr / src / sbin / XNSrouted / interface.h
CommitLineData
e69f81e0 1/*
3565c602
KB
2 * Copyright (c) 1983 The Regents of the University of California.
3 * All rights reserved.
e69f81e0 4 *
6ecf3d85 5 * %sccs.include.redist.c%
3565c602 6 *
6ecf3d85 7 * @(#)interface.h 5.5 (Berkeley) %G%
e69f81e0 8 */
970cc093
KS
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 * We list only one address for each interface, the AF_XNS one.
22 */
23#define NIFADDR 3
24struct interface {
25 struct interface *int_next;
26 struct sockaddr int_addr; /* address on this host */
27 union {
28 struct sockaddr intu_broadaddr;
29 struct sockaddr intu_dstaddr;
30 } int_intu;
31#define int_broadaddr int_intu.intu_broadaddr /* broadcast address */
32#define int_dstaddr int_intu.intu_dstaddr /* other end of p-to-p link */
33 int int_metric; /* init's routing entry */
34 int int_flags; /* see below */
35 struct ifdebug int_input, int_output; /* packet tracing stuff */
36 int int_ipackets; /* input packets received */
37 int int_opackets; /* output packets sent */
38 char *int_name; /* from kernel if structure */
39 u_short int_transitions; /* times gone up-down */
e69f81e0
KS
40/*XNS Specific entry */
41 struct sameq {
42 struct sameq *n; /* q of other pt-to-pt links */
43 struct sameq *p; /* with same net # */
44 } int_sq;
970cc093
KS
45};
46
47/*
e69f81e0 48 * 0x1 to 0x10 are reused from the kernel's ifnet definitions,
970cc093
KS
49 * the others agree with the RTS_ flags defined elsewhere.
50 */
51#define IFF_UP 0x1 /* interface is up */
52#define IFF_BROADCAST 0x2 /* broadcast address valid */
53#define IFF_DEBUG 0x4 /* turn on debugging */
54#define IFF_ROUTE 0x8 /* routing entry installed */
55#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
970cc093
KS
56
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 */
60
61struct interface *if_ifwithaddr();
e69f81e0 62struct interface *if_ifwithdstaddr();
970cc093
KS
63struct interface *if_ifwithnet();
64struct interface *if_iflookup();