1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)table.h 5.2 (Berkeley) 4/20/86
7: */
8:
9: /*
10: * Routing table management daemon.
11: */
12:
13: /*
14: * Routing table structure; differs a bit from kernel tables.
15: *
16: * Note: the union below must agree in the first 4 members
17: * so the ioctl's will work.
18: */
19: struct rthash {
20: struct rt_entry *rt_forw;
21: struct rt_entry *rt_back;
22: };
23:
24: struct rt_entry {
25: struct rt_entry *rt_forw;
26: struct rt_entry *rt_back;
27: union {
28: struct rtentry rtu_rt;
29: struct {
30: u_long rtu_hash;
31: struct sockaddr rtu_dst;
32: struct sockaddr rtu_router;
33: short rtu_flags;
34: short rtu_state;
35: int rtu_timer;
36: int rtu_metric;
37: struct interface *rtu_ifp;
38: } rtu_entry;
39: } rt_rtu;
40: };
41:
42: #define rt_rt rt_rtu.rtu_rt /* pass to ioctl */
43: #define rt_hash rt_rtu.rtu_entry.rtu_hash /* for net or host */
44: #define rt_dst rt_rtu.rtu_entry.rtu_dst /* match value */
45: #define rt_router rt_rtu.rtu_entry.rtu_router /* who to forward to */
46: #define rt_flags rt_rtu.rtu_entry.rtu_flags /* kernel flags */
47: #define rt_timer rt_rtu.rtu_entry.rtu_timer /* for invalidation */
48: #define rt_state rt_rtu.rtu_entry.rtu_state /* see below */
49: #define rt_metric rt_rtu.rtu_entry.rtu_metric /* cost of route */
50: #define rt_ifp rt_rtu.rtu_entry.rtu_ifp /* interface to take */
51:
52: #define ROUTEHASHSIZ 32 /* must be a power of 2 */
53: #define ROUTEHASHMASK (ROUTEHASHSIZ - 1)
54:
55: /*
56: * "State" of routing table entry.
57: */
58: #define RTS_CHANGED 0x1 /* route has been altered recently */
59: #define RTS_EXTERNAL 0x2 /* extern info, not installed or sent */
60: #define RTS_INTERNAL 0x4 /* internal route, not installed */
61: #define RTS_PASSIVE IFF_PASSIVE /* don't time out route */
62: #define RTS_INTERFACE IFF_INTERFACE /* route is for network interface */
63: #define RTS_REMOTE IFF_REMOTE /* route is for ``remote'' entity */
64: #define RTS_SUBNET IFF_SUBNET /* route is for network subnet */
65:
66: /*
67: * Flags are same as kernel, with this addition for af_rtflags:
68: */
69: #define RTF_SUBNET 0x8000 /* pseudo: route to subnet */
70:
71: struct rthash nethash[ROUTEHASHSIZ];
72: struct rthash hosthash[ROUTEHASHSIZ];
73: struct rt_entry *rtlookup();
74: struct rt_entry *rtfind();
Defined variables
Defined struct's
rt_entry
defined in line
24; used 56 times
- in line 20-26(6),
73-74(4)
- in /usr/src/etc/routed/inet.c line
152(2)
- in /usr/src/etc/routed/input.c line
24(2)
- in /usr/src/etc/routed/output.c line
65(2),
77(2)
- in /usr/src/etc/routed/startup.c line
168(2),
225(2)
- in /usr/src/etc/routed/tables.c line
28-32(4),
44(2),
62-66(4),
80(2),
107(2),
130(2),
164(2),
207(2),
241-243(4)
- in /usr/src/etc/routed/timer.c line
25(2),
37(2),
85(2),
93(2)
- in /usr/src/etc/routed/trace.c line
118(2)
rthash
defined in line
19; used 24 times
Defined macros
rt_dst
defined in line
44; used 11 times
rt_ifp
defined in line
50; used 11 times
rt_rt
defined in line
42; used 5 times
rt_state
defined in line
48; used 26 times
- in /usr/src/etc/routed/inet.c line
162-185(6)
- in /usr/src/etc/routed/input.c line
116,
128,
168
- in /usr/src/etc/routed/output.c line
84,
90
- in /usr/src/etc/routed/startup.c line
180
- in /usr/src/etc/routed/tables.c line
139,
152,
171,
177-178(2),
195,
210-214(2)
- in /usr/src/etc/routed/timer.c line
43-44(2),
53-54(2)
- in /usr/src/etc/routed/trace.c line
165,
174
Usage of this include