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

##### Macros

    BIG_ENDIAN        X
    BYTE_ORDER        X
    IPDEFTTL          X
    IPFRAGTTL         X
    IPOPT_CLASS       X
    IPOPT_CONTROL     X
    IPOPT_COPIED      X
    IPOPT_DEBMEAS     X
    IPOPT_EOL         X
    IPOPT_LSRR        X
    IPOPT_MINOFF      X
    IPOPT_NOP         X
    IPOPT_NUMBER      X
    IPOPT_OFFSET      X
    IPOPT_OLEN        X
    IPOPT_OPTVAL      X
    IPOPT_RESERVED1   X
    IPOPT_RESERVED2   X
    IPOPT_RR          X
    IPOPT_SATID       X
    IPOPT_SECURITY    X
    IPOPT_SECUR_CONFIDX
    IPOPT_SECUR_EFTO  X
    IPOPT_SECUR_MMMM  X
    IPOPT_SECUR_RESTR X
    IPOPT_SECUR_SECRETX
    IPOPT_SECUR_TOPSECRETX
    IPOPT_SECUR_UNCLASSX
    IPOPT_SSRR        X
    IPOPT_TS          X
    IPOPT_TS_PRESPEC  X
    IPOPT_TS_TSANDADDRX
    IPOPT_TS_TSONLY   X
    IPTTLDEC          X
    IPVERSION         X
    IP_DF             X
    IP_MAXPACKET      X
    IP_MF             X
    IP_MSS            X
    LITTLE_ENDIAN     X
    MAXTTL            X
    PDP_ENDIAN        X

##### struct's

    ip                X
    ip_timestamp      X
    ipt_ta            X

##### unions's

    ipt_timestamp     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.h	7.6.1.2 (2.11BSD) 1995/10/09
      13:  */
      14: #ifndef BYTE_ORDER
      15: /*
      16:  * Definitions for byte order,
      17:  * according to byte significance from low address to high.
      18:  */
      19: #define LITTLE_ENDIAN   1234    /* least-significant byte first (vax) */
      20: #define BIG_ENDIAN  4321    /* most-significant byte first (IBM, net) */
      21: #define PDP_ENDIAN  3412    /* LSB first in word, MSW first in long (pdp) */
      22:
      23: #ifdef vax
      24: #define BYTE_ORDER  LITTLE_ENDIAN
      25: #else
      26: #ifdef pdp11
      27: #define BYTE_ORDER  PDP_ENDIAN
      28: #else
      29: #define BYTE_ORDER  BIG_ENDIAN  /* mc68000, tahoe, most others */
      30: #endif
      31: #endif
      32: #endif BYTE_ORDER
      33:
      34: /*
      35:  * Definitions for internet protocol version 4.
      36:  * Per RFC 791, September 1981.
      37:  */
      38: #define IPVERSION   4
      39:
      40: /*
      41:  * Structure of an internet header, naked of options.
      42:  *
      43:  * We declare ip_len and ip_off to be short, rather than u_short
      44:  * pragmatically since otherwise unsigned comparisons can result
      45:  * against negative integers quite easily, and fail in subtle ways.
      46:  */
      47: struct ip {
      48: #if BYTE_ORDER == LITTLE_ENDIAN
      49:     u_char  ip_hl:4,        /* header length */
      50:         ip_v:4;         /* version */
      51: #endif
      52: #if BYTE_ORDER == BIG_ENDIAN
      53:     u_char  ip_v:4,         /* version */
      54:         ip_hl:4;        /* header length */
      55: #endif
      56: #if BYTE_ORDER == PDP_ENDIAN
      57:     u_int   ip_hl:4,        /* header length */
      58:         ip_v:4;         /* version */
      59: #endif
      60:     u_char  ip_tos;         /* type of service */
      61:     short   ip_len;         /* total length */
      62:     u_short ip_id;          /* identification */
      63:     short   ip_off;         /* fragment offset field */
      64: #define IP_DF 0x4000            /* dont fragment flag */
      65: #define IP_MF 0x2000            /* more fragments flag */
      66:     u_char  ip_ttl;         /* time to live */
      67:     u_char  ip_p;           /* protocol */
      68:     u_short ip_sum;         /* checksum */
      69:     struct  in_addr ip_src,ip_dst;  /* source and dest address */
      70: };
      71:
      72: #define IP_MAXPACKET    65535L      /* maximum packet size */
      73:
      74: /*
      75:  * Definitions for options.
      76:  */
      77: #define IPOPT_COPIED(o)     ((o)&0x80)
      78: #define IPOPT_CLASS(o)      ((o)&0x60)
      79: #define IPOPT_NUMBER(o)     ((o)&0x1f)
      80:
      81: #define IPOPT_CONTROL       0x00
      82: #define IPOPT_RESERVED1     0x20
      83: #define IPOPT_DEBMEAS       0x40
      84: #define IPOPT_RESERVED2     0x60
      85:
      86: #define IPOPT_EOL       0       /* end of option list */
      87: #define IPOPT_NOP       1       /* no operation */
      88:
      89: #define IPOPT_RR        7       /* record packet route */
      90: #define IPOPT_TS        68      /* timestamp */
      91: #define IPOPT_SECURITY      130     /* provide s,c,h,tcc */
      92: #define IPOPT_LSRR      131     /* loose source route */
      93: #define IPOPT_SATID     136     /* satnet id */
      94: #define IPOPT_SSRR      137     /* strict source route */
      95:
      96: /*
      97:  * Offsets to fields in options other than EOL and NOP.
      98:  */
      99: #define IPOPT_OPTVAL        0       /* option ID */
     100: #define IPOPT_OLEN      1       /* option length */
     101: #define IPOPT_OFFSET        2       /* offset within option */
     102: #define IPOPT_MINOFF        4       /* min value of above */
     103:
     104: /*
     105:  * Time stamp option structure.
     106:  */
     107: struct  ip_timestamp {
     108:     u_char  ipt_code;       /* IPOPT_TS */
     109:     u_char  ipt_len;        /* size of structure (variable) */
     110:     u_char  ipt_ptr;        /* index of current entry */
     111: #if BYTE_ORDER == LITTLE_ENDIAN
     112:     u_char  ipt_flg:4,      /* flags, see below */
     113:         ipt_oflw:4;     /* overflow counter */
     114: #endif
     115: #if BYTE_ORDER == BIG_ENDIAN
     116:     u_char  ipt_oflw:4,     /* overflow counter */
     117:         ipt_flg:4;      /* flags, see below */
     118: #endif
     119: #if BYTE_ORDER == PDP_ENDIAN
     120:     u_char  ipt_flg:4,      /* flags, see below */
     121:         ipt_oflw:4;     /* overflow counter */
     122: #endif
     123:     union ipt_timestamp {
     124:         n_long  ipt_time[1];
     125:         struct  ipt_ta {
     126:             struct in_addr ipt_addr;
     127:             n_long ipt_time;
     128:         } ipt_ta[1];
     129:     } ipt_timestamp;
     130: };
     131:
     132: /* flag bits for ipt_flg */
     133: #define IPOPT_TS_TSONLY     0       /* timestamps only */
     134: #define IPOPT_TS_TSANDADDR  1       /* timestamps and addresses */
     135: #define IPOPT_TS_PRESPEC    2       /* specified modules only */
     136:
     137: /* bits for security (not byte swapped) */
     138: #define IPOPT_SECUR_UNCLASS 0x0000
     139: #define IPOPT_SECUR_CONFID  0xf135
     140: #define IPOPT_SECUR_EFTO    0x789a
     141: #define IPOPT_SECUR_MMMM    0xbc4d
     142: #define IPOPT_SECUR_RESTR   0xaf13
     143: #define IPOPT_SECUR_SECRET  0xd788
     144: #define IPOPT_SECUR_TOPSECRET   0x6bc5
     145:
     146: /*
     147:  * Internet implementation parameters.
     148:  */
     149: #define MAXTTL      255     /* maximum time to live (seconds) */
     150: #define IPDEFTTL    64      /* default ttl, from RFC 1340 */
     151: #define IPFRAGTTL   60      /* time to live for frags, slowhz */
     152: #define IPTTLDEC    1       /* subtracted when forwarding */
     153:
     154: #define IP_MSS      576     /* default maximum segment size */

#### Defined struct's

ip defined in line 47; used 264 times

- in /usr/src/bin/ping/ping.c line 463(2), 471(2), 554-556(4), 593(2), 776(2), 784(2), 809(2), 832(2), 841(2), 880(2), 929(2)
- in /usr/src/sys/netimp/if_imp.c line 480(4)
- in /usr/src/sys/netinet/ip_icmp.c line 51(2), 59(2), 113-118(4), 142(4), 168(2), 356(2), 362(2), 418(2)
- in /usr/src/sys/netinet/ip_input.c line 85(2), 96(2), 122-129(8), 138(2), 191(2), 306(2), 336-337(4), 420-421(4), 427(2), 525(2), 536(2), 807(2), 815(2), 823-826(4), 855(2), 916(2), 963(2)
- in /usr/src/sys/netinet/ip_output.c line 52-55(4), 64(2), 198(2), 206-209(6), 274(4), 284-298(16), 308(2), 315(2)
- in /usr/src/sys/netinet/raw_ip.c line 47(4), 60(2), 91-102(10)
- in /usr/src/sys/netinet/tcp_input.c line 202-203(6), 215-216(4), 245-246(4)
- in /usr/src/sys/netinet/tcp_output.c line 391-392(4)
- in /usr/src/sys/netinet/tcp_subr.c line 76(2), 156-157(4), 291(2)
- in /usr/src/sys/netinet/udp_usrreq.c line 64(2), 78-79(6), 86-91(6), 97(2), 107(2), 135-136(4), 177(2), 261-262(4)
- in /usr/src/sys/netns/ns_ip.c line 129(2), 144(2), 150-151(4), 158(2), 166-167(4), 226(2), 247(2), 253-268(12)
- in /usr/src/sys/pdpif/if_de.c line 779(2)
- in /usr/src/sys/pdpif/if_ec.c line 500(2)
- in /usr/src/sys/pdpif/if_en.c line 430(2)
- in /usr/src/sys/pdpif/if_vv.c line 791(2)
- in /usr/src/usr.sbin/timed/measure.c line 50(4)
- in /usr/src/usr.sbin/traceroute/traceroute.c line 235(2), 468(2), 483(2), 547(2), 558(2), 620-622(4), 638(2), 671-674(4)

ip_timestamp defined in line 107; used 4 times

- in /usr/src/sys/netinet/ip_input.c line 530(2), 644(2)

ipt_ta defined in line 125; never used

#### Defined union's

ipt_timestamp defined in line 123; never used

#### Defined macros

BIG_ENDIAN defined in line 20; used 3 times

- in line 29, 52, 115

BYTE_ORDER defined in line 29; used 7 times

- in line 14, 48-56(3), 111-119(3)

IPDEFTTL defined in line 150; used 1 times

- in /usr/src/sys/netinet/in_proto.c line 155

IPFRAGTTL defined in line 151; used 1 times

- in /usr/src/sys/netinet/ip_input.c line 332

IPOPT_CLASS defined in line 78; never used
IPOPT_CONTROL defined in line 81; never used
IPOPT_COPIED defined in line 77; used 1 times

- in /usr/src/sys/netinet/ip_output.c line 327

IPOPT_DEBMEAS defined in line 83; never used
IPOPT_EOL defined in line 86; used 4 times

- in /usr/src/sys/netinet/ip_input.c line 539
- in /usr/src/sys/netinet/ip_output.c line 318, 333, 437

IPOPT_LSRR defined in line 92; never used
IPOPT_MINOFF defined in line 102; used 7 times

- in /usr/src/bin/ping/ping.c line 300, 566, 578, 589
- in /usr/src/sys/netinet/ip_input.c line 566, 617
- in /usr/src/sys/netinet/ip_output.c line 461

IPOPT_NOP defined in line 87; used 4 times

- in /usr/src/sys/netinet/ip_input.c line 541, 786
- in /usr/src/sys/netinet/ip_output.c line 320, 439

IPOPT_NUMBER defined in line 79; never used
IPOPT_OFFSET defined in line 101; used 15 times

- in /usr/src/bin/ping/ping.c line 300
- in /usr/src/sys/netinet/ip_input.c line 53, 566-567(2), 608, 617-618(2), 639, 755, 775, 788-790(2)
- in /usr/src/sys/netinet/ip_output.c line 470, 476-478(2)

IPOPT_OLEN defined in line 100; used 8 times

- in /usr/src/bin/ping/ping.c line 299
- in /usr/src/sys/netinet/ip_input.c line 544-546(2), 748
- in /usr/src/sys/netinet/ip_output.c line 323, 442-443(2), 466

IPOPT_OPTVAL defined in line 99; used 3 times

- in /usr/src/bin/ping/ping.c line 298
- in /usr/src/sys/netinet/ip_input.c line 538
- in /usr/src/sys/netinet/ip_output.c line 436

IPOPT_RESERVED1 defined in line 82; never used
IPOPT_RESERVED2 defined in line 84; never used
IPOPT_RR defined in line 89; used 1 times

- in /usr/src/bin/ping/ping.c line 298

IPOPT_SATID defined in line 93; never used
IPOPT_SECURITY defined in line 91; never used
IPOPT_SECUR_CONFID defined in line 139; never used
IPOPT_SECUR_EFTO defined in line 140; never used
IPOPT_SECUR_MMMM defined in line 141; never used
IPOPT_SECUR_RESTR defined in line 142; never used
IPOPT_SECUR_SECRET defined in line 143; never used
IPOPT_SECUR_TOPSECRET defined in line 144; never used
IPOPT_SECUR_UNCLASS defined in line 138; never used
IPOPT_SSRR defined in line 94; used 2 times

- in /usr/src/sys/netinet/ip_input.c line 574, 598

IPOPT_TS defined in line 90; never used
IPOPT_TS_PRESPEC defined in line 135; never used
IPOPT_TS_TSANDADDR defined in line 134; never used
IPOPT_TS_TSONLY defined in line 133; never used
IPTTLDEC defined in line 152; used 2 times

- in /usr/src/sys/netinet/ip_input.c line 874-878(2)

IPVERSION defined in line 38; used 1 times

- in /usr/src/sys/netinet/ip_output.c line 69

IP_DF defined in line 64; used 4 times

- in /usr/src/sys/netinet/ip_icmp.c line 73
- in /usr/src/sys/netinet/ip_input.c line 248
- in /usr/src/sys/netinet/ip_output.c line 70, 179

IP_MAXPACKET defined in line 72; never used
IP_MF defined in line 65; used 7 times

- in /usr/src/sys/netinet/ip_icmp.c line 73
- in /usr/src/sys/netinet/ip_input.c line 269
- in /usr/src/sys/netinet/ip_output.c line 213-219(4), 238

IP_MSS defined in line 154; never used
LITTLE_ENDIAN defined in line 19; used 3 times

- in line 24, 48, 111

MAXTTL defined in line 149; used 3 times

- in /usr/src/sys/netinet/ip_icmp.c line 385
- in /usr/src/sys/netinet/raw_ip.c line 100
- in /usr/src/sys/netns/ns_ip.c line 269

PDP_ENDIAN defined in line 21; used 3 times

- in line 27, 56, 119

#### Usage of this include

ip.h used 40 times

- in /usr/src/bin/ping/ping.c line 71
- in /usr/src/bin/sysctl/sysctl.c line 50
- in /usr/src/libexec/identd/src/kernel/2.11bsd.c line 36
- in /usr/src/new/crash/inet.c line 21
- in /usr/src/sys/net/if_loop.c line 37
- in /usr/src/sys/net/if_sl.c line 60
- in /usr/src/sys/netimp/if_imp.c line 32
- in /usr/src/sys/netinet/if_ether.c line 41
- in /usr/src/sys/netinet/in_proto.c line 23
- in /usr/src/sys/netinet/ip_icmp.c line 31
- in /usr/src/sys/netinet/ip_input.c line 32
- in /usr/src/sys/netinet/ip_output.c line 30
- in /usr/src/sys/netinet/raw_ip.c line 29
- in /usr/src/sys/netinet/tcp_debug.c line 37
- in /usr/src/sys/netinet/tcp_input.c line 30
- in /usr/src/sys/netinet/tcp_output.c line 29
- in /usr/src/sys/netinet/tcp_subr.c line 30
- in /usr/src/sys/netinet/tcp_timer.c line 30
- in /usr/src/sys/netinet/tcp_usrreq.c line 31
- in /usr/src/sys/netinet/udp_usrreq.c line 30
- in /usr/src/sys/netns/ns_ip.c line 36
- in /usr/src/sys/pdpif/if_de.h line 16
- in /usr/src/sys/pdpif/if_dmc.c line 36
- in /usr/src/sys/pdpif/if_ec.c line 68
- in /usr/src/sys/pdpif/if_en.c line 31
- in /usr/src/sys/pdpif/if_il.c line 54
- in /usr/src/sys/pdpif/if_qe.c line 133
- in /usr/src/sys/pdpif/if_qt.c line 80
- in /usr/src/sys/pdpif/if_vv.c line 66
- in /usr/src/ucb/PORT/systat/netstat.c line 24
- in /usr/src/ucb/netstat/inet.c line 32
- in /usr/src/usr.sbin/ntp/ntp.c line 95
- in /usr/src/usr.sbin/ntp/ntp_adjust.c line 76
- in /usr/src/usr.sbin/ntp/ntp_proto.c line 129
- in /usr/src/usr.sbin/ntp/ntpd.c line 112
- in /usr/src/usr.sbin/ntp/test.c line 54
- in /usr/src/usr.sbin/timed/cmds.c line 13
- in /usr/src/usr.sbin/timed/measure.c line 14
- in /usr/src/usr.sbin/traceroute/traceroute.c line 204
- in /usr/src/usr.sbin/trpt/trpt.c line 31

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