# 2.11BSD#431 - /usr/src/sys/net/route.h

##### Variables

    rthost            X
    rtnet             X
    rtstat            X

##### Macros

    RTFREE            X
    RTF_DYNAMIC       X
    RTF_GATEWAY       X
    RTF_HOST          X
    RTF_MODIFIED      X
    RTF_UP            X
    RTHASHMOD         X
    RTHASHSIZ         X

##### struct's

    route             X
    rtentry           X
    rtstat            X

       1: /*
       2:  * Copyright (c) 1980, 1986 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 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:  *	@(#)route.h	7.3 (Berkeley) 12/30/87
      13:  */
      14:
      15: /*
      16:  * Kernel resident routing tables.
      17:  *
      18:  * The routing tables are initialized when interface addresses
      19:  * are set by making entries for all directly connected interfaces.
      20:  */
      21:
      22: /*
      23:  * A route consists of a destination address and a reference
      24:  * to a routing entry.  These are often held by protocols
      25:  * in their control blocks, e.g. inpcb.
      26:  */
      27: struct route {
      28:     struct  rtentry *ro_rt;
      29:     struct  sockaddr ro_dst;
      30: };
      31:
      32: /*
      33:  * We distinguish between routes to hosts and routes to networks,
      34:  * preferring the former if available.  For each route we infer
      35:  * the interface to use from the gateway address supplied when
      36:  * the route was entered.  Routes that forward packets through
      37:  * gateways are marked so that the output routines know to address the
      38:  * gateway rather than the ultimate destination.
      39:  */
      40: struct rtentry {
      41:     u_int   rt_hash;                /* to speed lookups */
      42:     struct  sockaddr rt_dst;    /* key */
      43:     struct  sockaddr rt_gateway;    /* value */
      44:     short   rt_flags;       /* up/down?, host/net */
      45:     short   rt_refcnt;      /* # held references */
      46:     u_long  rt_use;         /* raw # packets forwarded */
      47:     struct  ifnet *rt_ifp;      /* the answer: interface to use */
      48: };
      49:
      50: #define RTF_UP      0x1     /* route useable */
      51: #define RTF_GATEWAY 0x2     /* destination is a gateway */
      52: #define RTF_HOST    0x4     /* host entry (net otherwise) */
      53: #define RTF_DYNAMIC 0x10        /* created dynamically (by redirect) */
      54: #define RTF_MODIFIED    0x20        /* modified dynamically (by redirect) */
      55:
      56: /*
      57:  * Routing statistics.
      58:  */
      59: struct  rtstat {
      60:     short   rts_badredirect;    /* bogus redirect calls */
      61:     short   rts_dynamic;        /* routes created by redirects */
      62:     short   rts_newgateway;     /* routes modified by redirects */
      63:     short   rts_unreach;        /* lookups which failed */
      64:     short   rts_wildcard;       /* lookups satisfied by a wildcard */
      65: };
      66:
      67: #ifdef SUPERVISOR
      68: #define RTFREE(rt) \
      69:     if ((rt)->rt_refcnt == 1) \
      70:         rtfree(rt); \
      71:     else \
      72:         (rt)->rt_refcnt--;
      73:
      74: #ifdef  GATEWAY
      75: #define RTHASHSIZ   64
      76: #else
      77: #define RTHASHSIZ   8
      78: #endif
      79: #if (RTHASHSIZ & (RTHASHSIZ - 1)) == 0
      80: #define RTHASHMOD(h)    ((h) & (RTHASHSIZ - 1))
      81: #else
      82: #define RTHASHMOD(h)    ((h) % RTHASHSIZ)
      83: #endif
      84: struct  mbuf *rthost[RTHASHSIZ];
      85: struct  mbuf *rtnet[RTHASHSIZ];
      86: struct  rtstat  rtstat;
      87: #endif

#### Defined variables

rthost defined in line 84; used 2 times

- in /usr/src/sys/net/route.c line 53, 231

rtnet defined in line 85; used 2 times

- in /usr/src/sys/net/route.c line 81, 234

rtstat defined in line 86; used 34 times

- in /usr/src/new/crash/route.c line 306, 314-325(12)
- in /usr/src/sys/net/route.c line 75, 92, 126, 142, 161, 176, 184-187(2)
- in /usr/src/ucb/netstat/route.c line 273, 280-291(12)

#### Defined struct's

route defined in line 27; used 50 times

- in /usr/src/sys/net/route.c line 36(2), 121(2)
- in /usr/src/sys/netinet/in_pcb.c line 145(2)
- in /usr/src/sys/netinet/ip_icmp.c line 438(2)
- in /usr/src/sys/netinet/ip_input.c line 87(2)
- in /usr/src/sys/netinet/ip_output.c line 49(2), 57(2)
- in /usr/src/sys/netinet/tcp_input.c line 1258(2)
- in /usr/src/sys/netinet/tcp_subr.c line 113(2)
- in /usr/src/sys/netns/idp_usrreq.c line 125(2), 198(2)
- in /usr/src/sys/netns/ns_error.c line 140(2), 300(2)
- in /usr/src/sys/netns/ns_input.c line 287-288(4), 410(2), 430(2)
- in /usr/src/sys/netns/ns_ip.c line 49(2), 227(2), 293(2), 368(2)
- in /usr/src/sys/netns/ns_output.c line 40(2), 46(2)
- in /usr/src/sys/netns/ns_pcb.c line 114(2)
- in /usr/src/sys/netns/spp_usrreq.c line 1016(2)

rtentry defined in line 40; used 75 times

- in line 28
- in /usr/src/new/crash/dispnet.c line 526(2)
- in /usr/src/new/crash/route.c line 48(2), 55-56(4), 78-80(6), 101(2), 107-109(4), 123(2), 190(2)
- in /usr/src/sbin/route/route.c line 31(2), 105(2), 171(2)
- in /usr/src/sbin/routed/tables.c line 173(2)
- in /usr/src/sys/net/route.c line 38(2), 57(2), 96(2), 122(2), 203(2), 213-217(4), 239(2), 310-311(4), 335(2)
- in /usr/src/sys/netinet/in_pcb.c line 159-162(4), 337(2)
- in /usr/src/sys/netinet/ip_output.c line 92(2)
- in /usr/src/sys/netinet/tcp_input.c line 1265(2)
- in /usr/src/sys/netns/idp_usrreq.c line 237(2)
- in /usr/src/sys/netns/ns_pcb.c line 131-135(4)
- in /usr/src/ucb/netstat/route.c line 63(2), 103(2)

rtstat defined in line 59; used 6 times

- in line 86(2)
- in /usr/src/new/crash/route.c line 306(2)
- in /usr/src/ucb/netstat/route.c line 273(2)

#### Defined macros

RTFREE defined in line 68; used 13 times

- in /usr/src/sys/netinet/in_pcb.c line 158
- in /usr/src/sys/netinet/ip_input.c line 719, 884
- in /usr/src/sys/netinet/ip_output.c line 91, 254
- in /usr/src/sys/netns/idp_usrreq.c line 236
- in /usr/src/sys/netns/ns_input.c line 432
- in /usr/src/sys/netns/ns_ip.c line 326, 343, 371, 416
- in /usr/src/sys/netns/ns_output.c line 133
- in /usr/src/sys/netns/ns_pcb.c line 130

RTF_DYNAMIC defined in line 53; used 7 times

- in /usr/src/new/crash/route.c line 38
- in /usr/src/sys/net/route.c line 160, 175, 316
- in /usr/src/sys/netinet/in_pcb.c line 340
- in /usr/src/sys/netinet/ip_input.c line 914
- in /usr/src/ucb/netstat/route.c line 51

RTF_GATEWAY defined in line 51; used 20 times

- in /usr/src/new/crash/route.c line 36
- in /usr/src/sbin/route/route.c line 172, 395
- in /usr/src/sbin/routed/startup.c line 261
- in /usr/src/sbin/routed/tables.c line 148, 196-198(2)
- in /usr/src/sbin/routed/trace.c line 126
- in /usr/src/sys/net/route.c line 160, 168, 274, 316
- in /usr/src/sys/netinet/ip_icmp.c line 314, 322
- in /usr/src/sys/netinet/ip_input.c line 923, 936
- in /usr/src/sys/netinet/ip_output.c line 124
- in /usr/src/sys/netns/idp_usrreq.c line 225
- in /usr/src/sys/netns/ns_output.c line 96
- in /usr/src/ucb/netstat/route.c line 49

RTF_HOST defined in line 52; used 30 times

- in /usr/src/new/crash/route.c line 37, 136
- in /usr/src/sbin/route/route.c line 393
- in /usr/src/sbin/routed/inet.c line 136, 145
- in /usr/src/sbin/routed/startup.c line 259
- in /usr/src/sbin/routed/tables.c line 127
- in /usr/src/sbin/routed/trace.c line 127
- in /usr/src/sys/net/route.c line 160, 169(2), 229, 242, 283, 316
- in /usr/src/sys/netinet/in.c line 299-301(2), 362-365(2), 399-402(2)
- in /usr/src/sys/netinet/ip_icmp.c line 322
- in /usr/src/sys/netinet/ip_input.c line 935
- in /usr/src/sys/netns/idp_usrreq.c line 220
- in /usr/src/sys/netns/ns.c line 145, 210, 257
- in /usr/src/sys/netns/ns_output.c line 96
- in /usr/src/ucb/netstat/route.c line 50, 115

RTF_MODIFIED defined in line 54; used 3 times

- in /usr/src/sys/net/route.c line 183
- in /usr/src/sys/netinet/ip_input.c line 914
- in /usr/src/ucb/netstat/route.c line 52

RTF_UP defined in line 50; used 20 times

- in /usr/src/new/crash/route.c line 35
- in /usr/src/sbin/route/route.c line 391
- in /usr/src/sbin/routed/startup.c line 257
- in /usr/src/sbin/routed/tables.c line 142
- in /usr/src/sbin/routed/trace.c line 125
- in /usr/src/sys/net/route.c line 47, 60, 102, 262, 315
- in /usr/src/sys/netinet/in.c line 301, 399-406(3)
- in /usr/src/sys/netinet/ip_output.c line 89
- in /usr/src/sys/netns/ns.c line 257-260(2)
- in /usr/src/sys/netns/ns_output.c line 83
- in /usr/src/sys/pdpif/if_en.c line 153
- in /usr/src/ucb/netstat/route.c line 48

RTHASHMOD defined in line 82; used 3 times

- in /usr/src/sys/net/route.c line 56, 231-234(2)

RTHASHSIZ defined in line 77; used 7 times

- in line 79-85(6)
- in /usr/src/sys/net/route.c line 30

#### Usage of this include

route.h used 51 times

- in /usr/src/libexec/identd/src/kernel/2.11bsd.c line 37
- in /usr/src/new/crash/dispnet.c line 21
- in /usr/src/new/crash/inet.c line 17
- in /usr/src/new/crash/route.c line 16
- in /usr/src/sbin/route/route.c line 20
- in /usr/src/sbin/routed/defs.h line 18
- in /usr/src/sys/net/if_loop.c line 31
- in /usr/src/sys/net/if_sl.c line 55
- in /usr/src/sys/net/raw_cb.c line 25
- in /usr/src/sys/net/raw_usrreq.c line 24
- in /usr/src/sys/net/route.c line 26
- in /usr/src/sys/netimp/if_imp.c line 28
- in /usr/src/sys/netimp/raw_imp.c line 19
- in /usr/src/sys/netinet/in.c line 25
- in /usr/src/sys/netinet/in_pcb.c line 27
- in /usr/src/sys/netinet/ip_icmp.c line 24
- in /usr/src/sys/netinet/ip_input.c line 26
- in /usr/src/sys/netinet/ip_output.c line 23
- in /usr/src/sys/netinet/raw_ip.c line 23
- in /usr/src/sys/netinet/tcp_debug.c line 30
- in /usr/src/sys/netinet/tcp_input.c line 24
- in /usr/src/sys/netinet/tcp_output.c line 23
- in /usr/src/sys/netinet/tcp_subr.c line 23
- in /usr/src/sys/netinet/tcp_timer.c line 24
- in /usr/src/sys/netinet/tcp_usrreq.c line 25
- in /usr/src/sys/netinet/udp_usrreq.c line 24
- in /usr/src/sys/netns/idp_usrreq.c line 26
- in /usr/src/sys/netns/ns.c line 26
- in /usr/src/sys/netns/ns_error.c line 24
- in /usr/src/sys/netns/ns_input.c line 28
- in /usr/src/sys/netns/ns_ip.c line 31
- in /usr/src/sys/netns/ns_output.c line 23
- in /usr/src/sys/netns/ns_pcb.c line 23
- in /usr/src/sys/netns/spp_debug.c line 24
- in /usr/src/sys/netns/spp_usrreq.c line 26
- in /usr/src/sys/pdpif/if_de.h line 10
- in /usr/src/sys/pdpif/if_dmc.c line 39
- in /usr/src/sys/pdpif/if_ec.c line 62
- in /usr/src/sys/pdpif/if_en.c line 34
- in /usr/src/sys/pdpif/if_qe.c line 126
- in /usr/src/sys/pdpif/if_qt.c line 73
- in /usr/src/sys/pdpif/if_vv.c line 60
- in /usr/src/sys/sys/sys_socket.c line 28
- in /usr/src/ucb/PORT/systat/netcmds.c line 22
- in /usr/src/ucb/PORT/systat/netstat.c line 21
- in /usr/src/ucb/netstat/inet.c line 28
- in /usr/src/ucb/netstat/ns.c line 27
- in /usr/src/ucb/netstat/route.c line 25
- in /usr/src/usr.bin/fstat/fstat.c line 39
- in /usr/src/usr.sbin/trpt/trpt.c line 25
- in /usr/src/usr.sbin/trsp/trsp.c line 23

Last modified: 1988-04-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1381 |