# 2.11BSD#431 - /usr/src/sys/netinet/ip_var.h

##### Variables

    ip_defttl         X
    ipq               X
    ipstat            X

##### Macros

    IP_ALLOWBROADCAST X
    IP_FORWARDING     X
    IP_ROUTETOIF      X
    MAX_IPOPTLEN      X

##### struct's

    ipasfrag          X
    ipoption          X
    ipovly            X
    ipq               X
    ipstat            X

       1: /*
       2:  * Copyright (c) 1982, 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:  *	@(#)ip_var.h	7.4.1 (2.11BSD GTE) 12/31/93
      13:  */
      14:
      15: /*
      16:  * Overlay for ip header used by other protocols (tcp, udp).
      17:  */
      18: struct ipovly {
      19:     caddr_t ih_next, ih_prev;   /* for protocol sequence q's */
      20: #ifdef pdp11
      21:     u_long  ih_pad;
      22: #endif
      23:     u_char  ih_x1;          /* (unused) */
      24:     u_char  ih_pr;          /* protocol */
      25:     short   ih_len;         /* protocol length */
      26:     struct  in_addr ih_src;     /* source internet address */
      27:     struct  in_addr ih_dst;     /* destination internet address */
      28: };
      29:
      30: /*
      31:  * Ip reassembly queue structure.  Each fragment
      32:  * being reassembled is attached to one of these structures.
      33:  * They are timed out after ipq_ttl drops to 0, and may also
      34:  * be reclaimed if memory becomes tight.
      35:  */
      36: struct ipq {
      37:     struct  ipq *next,*prev;    /* to other reass headers */
      38: #ifdef pdp11
      39:     u_long  ipq_pad;
      40: #endif
      41:     u_char  ipq_ttl;        /* time for reass q to live */
      42:     u_char  ipq_p;          /* protocol of this fragment */
      43:     u_short ipq_id;         /* sequence id for reassembly */
      44:     struct  ipasfrag *ipq_next,*ipq_prev;
      45:                     /* to ip headers of fragments */
      46:     struct  in_addr ipq_src,ipq_dst;
      47: };
      48:
      49: /*
      50:  * Ip header, when holding a fragment.
      51:  *
      52:  * Note: ipf_next must be at same offset as ipq_next above
      53:  */
      54: struct  ipasfrag {
      55: #if BYTE_ORDER == LITTLE_ENDIAN
      56:     u_char  ip_hl:4,
      57:         ip_v:4;
      58: #endif
      59: #if BYTE_ORDER == BIG_ENDIAN
      60:     u_char  ip_v:4,
      61:         ip_hl:4;
      62: #endif
      63: #if BYTE_ORDER == PDP_ENDIAN
      64:     u_int   ip_hl:4,
      65:         ip_v:4;
      66: #endif
      67:     u_char  ipf_mff;        /* copied from (ip_off&IP_MF) */
      68:     short   ip_len;
      69:     u_short ip_id;
      70:     short   ip_off;
      71:     u_char  ip_ttl;
      72:     u_char  ip_p;
      73:     u_short ip_sum;
      74:     struct  ipasfrag *ipf_next; /* next fragment */
      75:     struct  ipasfrag *ipf_prev; /* previous fragment */
      76: #ifdef pdp11
      77:     u_long  ipf_pad;
      78: #endif
      79: };
      80:
      81: /*
      82:  * Structure stored in mbuf in inpcb.ip_options
      83:  * and passed to ip_output when ip options are in use.
      84:  * The actual length of the options (including ipopt_dst)
      85:  * is in m_len.
      86:  */
      87: #define MAX_IPOPTLEN    40
      88:
      89: struct ipoption {
      90:     struct  in_addr ipopt_dst;  /* first-hop dst if source routed */
      91:     char    ipopt_list[MAX_IPOPTLEN];   /* options proper */
      92: };
      93:
      94: struct  ipstat {
      95:     long    ips_total;      /* total packets received */
      96:     long    ips_badsum;     /* checksum bad */
      97:     long    ips_tooshort;       /* packet too short */
      98:     long    ips_toosmall;       /* not enough data */
      99:     long    ips_badhlen;        /* ip header length < data size */
     100:     long    ips_badlen;     /* ip length < ip header length */
     101:     long    ips_fragments;      /* fragments received */
     102:     long    ips_fragdropped;    /* frags dropped (dups, out of space) */
     103:     long    ips_fragtimeout;    /* fragments timed out */
     104:     long    ips_forward;        /* packets forwarded */
     105:     long    ips_cantforward;    /* packets rcvd for unreachable dest */
     106:     long    ips_redirectsent;   /* packets forwarded on same net */
     107: };
     108:
     109: #ifdef SUPERVISOR
     110: /* flags passed to ip_output as last parameter */
     111: #define IP_FORWARDING       0x1     /* most of ip header exists */
     112: #define IP_ROUTETOIF        SO_DONTROUTE    /* bypass routing tables */
     113: #define IP_ALLOWBROADCAST   SO_BROADCAST    /* can send broadcast packets */
     114:
     115: struct  ipstat  ipstat;
     116: struct  ipq ipq;            /* ip reass. queue */
     117: u_short ip_id;              /* ip packet ctr, for ids */
     118: int ip_defttl;          /* default IP ttl */
     119:
     120: struct  mbuf *ip_srcroute();
     121: #endif

#### Defined variables

ip_defttl defined in line 118; used 4 times

- in /usr/src/sys/netinet/ip_input.c line 1022
- in /usr/src/sys/netinet/tcp_output.c line 392
- in /usr/src/sys/netinet/tcp_subr.c line 157
- in /usr/src/sys/netinet/udp_usrreq.c line 262

ipq defined in line 116; used 11 times

- in /usr/src/sys/netinet/ip_input.c line 78(3), 253(2), 331, 488-493(2), 510-512(3)

ipstat defined in line 115; used 60 times

- in /usr/src/new/crash/inet.c line 229-254(22)
- in /usr/src/sys/netinet/ip_input.c line 121-124(2), 130-135(2), 142, 151, 173, 234, 279, 430, 497, 511, 870, 952-958(3)
- in /usr/src/ucb/netstat/inet.c line 240-268(22)

#### Defined struct's

ipasfrag defined in line 54; used 41 times

- in line 44, 74-75(4)
- in /usr/src/new/crash/dispnet.c line 500(2)
- in /usr/src/sys/netinet/ip_input.c line 268-270(4), 278-280(4), 308-312(4), 335-338(4), 345(2), 354(2), 369(2), 389(2), 406(2), 442-444(4), 458(2), 471(2)

ipoption defined in line 89; used 4 times

- in /usr/src/sys/netinet/ip_output.c line 272(4)

ipovly defined in line 18; never used
ipq defined in line 36; used 16 times

- in line 37(2), 116(2)
- in /usr/src/new/crash/dispnet.c line 503(2)
- in /usr/src/sys/netinet/ip_input.c line 100(2), 309(2), 330(2), 440(2), 485(2)

ipstat defined in line 94; used 8 times

- in line 115(2)
- in /usr/src/new/crash/dispnet.c line 89(2)
- in /usr/src/new/crash/inet.c line 229(2)
- in /usr/src/ucb/netstat/inet.c line 240(2)

#### Defined macros

IP_ALLOWBROADCAST defined in line 113; used 3 times

- in /usr/src/sys/netinet/ip_output.c line 152
- in /usr/src/sys/netinet/raw_ip.c line 118-121(2)

IP_FORWARDING defined in line 111; used 2 times

- in /usr/src/sys/netinet/ip_input.c line 950
- in /usr/src/sys/netinet/ip_output.c line 68

IP_ROUTETOIF defined in line 112; used 2 times

- in /usr/src/sys/netinet/ip_output.c line 102, 253

MAX_IPOPTLEN defined in line 87; used 5 times

- in line 91
- in /usr/src/bin/ping/ping.c line 462
- in /usr/src/sys/netinet/ip_input.c line 54
- in /usr/src/sys/netinet/ip_output.c line 422-423(2)

#### Usage of this include

ip_var.h used 23 times

- in /usr/src/bin/ping/ping.c line 73
- in /usr/src/bin/sysctl/sysctl.c line 53
- in /usr/src/new/crash/dispnet.c line 32
- in /usr/src/new/crash/inet.c line 24
- in /usr/src/sys/netimp/if_imp.c line 33
- in /usr/src/sys/netinet/ip_input.c line 33
- in /usr/src/sys/netinet/ip_output.c line 31
- in /usr/src/sys/netinet/raw_ip.c line 30
- in /usr/src/sys/netinet/tcp_debug.c line 38
- in /usr/src/sys/netinet/tcp_input.c line 31
- in /usr/src/sys/netinet/tcp_output.c line 30
- in /usr/src/sys/netinet/tcp_subr.c line 31
- in /usr/src/sys/netinet/tcp_timer.c line 31
- in /usr/src/sys/netinet/tcp_usrreq.c line 32
- in /usr/src/sys/netinet/udp_usrreq.c line 31
- in /usr/src/sys/netns/ns_ip.c line 37
- in /usr/src/sys/pdpif/if_dmc.c line 38
- in /usr/src/sys/pdpif/if_en.c line 32
- in /usr/src/sys/pdpif/if_il.c line 55
- in /usr/src/sys/pdpif/if_vv.c line 67
- in /usr/src/ucb/PORT/systat/netstat.c line 27
- in /usr/src/ucb/netstat/inet.c line 35
- in /usr/src/usr.sbin/trpt/trpt.c line 32

Last modified: 1995-10-11 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1476 |