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

##### Macros

    BIG_ENDIAN        X
    BYTE_ORDER        X
    IP_MSS            X
    LITTLE_ENDIAN     X
    PDP_ENDIAN        X
    TCPOPT_EOL        X
    TCPOPT_MAXSEG     X
    TCPOPT_NOP        X
    TCP_MAXSEG        X
    TCP_MSS           X
    TCP_NODELAY       X
    TH_ACK            X
    TH_FIN            X
    TH_PUSH           X
    TH_RST            X
    TH_SYN            X
    TH_URG            X

##### struct's

    tcphdr            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:  *	@(#)tcp.h	7.4.1.1 (Berkeley) 2/7/88
      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: typedef u_long  tcp_seq;
      35: /*
      36:  * TCP header.
      37:  * Per RFC 793, September, 1981.
      38:  */
      39: struct tcphdr {
      40:     u_short th_sport;       /* source port */
      41:     u_short th_dport;       /* destination port */
      42:     tcp_seq th_seq;         /* sequence number */
      43:     tcp_seq th_ack;         /* acknowledgement number */
      44: #if BYTE_ORDER == LITTLE_ENDIAN
      45:     u_char  th_x2:4,        /* (unused) */
      46:         th_off:4;       /* data offset */
      47: #endif
      48: #if BYTE_ORDER == BIG_ENDIAN
      49:     u_char  th_off:4,       /* data offset */
      50:         th_x2:4;        /* (unused) */
      51: #endif
      52: #if BYTE_ORDER == PDP_ENDIAN
      53:     u_int   th_x2:4,        /* (unused) */
      54:         th_off:4;       /* data offset */
      55: #endif
      56:     u_char  th_flags;
      57: #define TH_FIN  0x01
      58: #define TH_SYN  0x02
      59: #define TH_RST  0x04
      60: #define TH_PUSH 0x08
      61: #define TH_ACK  0x10
      62: #define TH_URG  0x20
      63:     u_short th_win;         /* window */
      64:     u_short th_sum;         /* checksum */
      65:     u_short th_urp;         /* urgent pointer */
      66: };
      67:
      68: #define TCPOPT_EOL  0
      69: #define TCPOPT_NOP  1
      70: #define TCPOPT_MAXSEG   2
      71:
      72: /*
      73:  * Default maximum segment size for TCP.
      74:  * With an IP MSS of 576, this is 536,
      75:  * but 512 is probably more convenient.
      76:  */
      77: #ifdef  lint
      78: #define TCP_MSS 536
      79: #else
      80: #ifndef IP_MSS
      81: #define IP_MSS  576
      82: #endif
      83: #define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
      84: #endif
      85:
      86: /*
      87:  * User-settable options (used with setsockopt).
      88:  */
      89: #define TCP_NODELAY 0x01    /* don't delay send to coalesce packets */
      90: #define TCP_MAXSEG  0x02    /* set maximum segment size */

#### Defined struct's

tcphdr defined in line 39; used 22 times

- in /usr/src/sys/netinet/tcp_debug.c line 103(2)
- in /usr/src/sys/netinet/tcp_input.c line 236(2), 244(2), 255(2)
- in /usr/src/sys/netinet/tcp_output.c line 289(2), 327(2)
- in /usr/src/sys/netinet/tcp_subr.c line 147-151(4), 293(2), 303(2)
- in /usr/src/usr.sbin/trpt/trpt.c line 269(2)

#### Defined macros

BIG_ENDIAN defined in line 20; used 2 times

- in line 29, 48

BYTE_ORDER defined in line 29; used 4 times

- in line 14, 44-52(3)

IP_MSS defined in line 81; used 3 times

- in line 80-83(2)
- in /usr/src/sys/netinet/tcp_output.c line 265

LITTLE_ENDIAN defined in line 19; used 2 times

- in line 24, 44

PDP_ENDIAN defined in line 21; used 2 times

- in line 27, 52

TCPOPT_EOL defined in line 68; used 2 times

- in /usr/src/sys/netinet/tcp_input.c line 1178
- in /usr/src/sys/netinet/tcp_output.c line 285

TCPOPT_MAXSEG defined in line 70; used 1 times

- in /usr/src/sys/netinet/tcp_output.c line 43

TCPOPT_NOP defined in line 69; used 1 times

- in /usr/src/sys/netinet/tcp_input.c line 1180

TCP_MAXSEG defined in line 90; never used
TCP_MSS defined in line 83; used 3 times

- in /usr/src/sys/netinet/tcp_input.c line 1275, 1289
- in /usr/src/sys/netinet/tcp_subr.c line 177

TCP_NODELAY defined in line 89; never used
TH_ACK defined in line 61; used 10 times

- in /usr/src/sys/netinet/tcp_input.c line 382, 444-449(2), 455, 464, 679, 950, 1138, 1144
- in /usr/src/sys/netinet/tcp_subr.c line 131

TH_FIN defined in line 57; used 15 times

- in /usr/src/sys/netinet/tcp_input.c line 61, 158, 506, 533, 546, 552, 630, 1035, 1052, 1059
- in /usr/src/sys/netinet/tcp_output.c line 113, 122, 234, 251, 343

TH_PUSH defined in line 60; used 2 times

- in /usr/src/sys/netinet/tcp_input.c line 630
- in /usr/src/sys/netinet/tcp_output.c line 320

TH_RST defined in line 59; used 10 times

- in /usr/src/sys/netinet/tcp_input.c line 380, 448, 548, 643, 1119, 1136-1144(3)
- in /usr/src/sys/netinet/tcp_output.c line 130, 234

TH_SYN defined in line 58; used 12 times

- in /usr/src/sys/netinet/tcp_input.c line 384, 453, 523-524(2), 597, 671, 1141, 1195
- in /usr/src/sys/netinet/tcp_output.c line 130, 234, 261, 341

TH_URG defined in line 62; used 5 times

- in /usr/src/sys/netinet/tcp_input.c line 529, 566, 969, 979
- in /usr/src/sys/netinet/tcp_output.c line 305

#### Usage of this include

tcp.h used 12 times

- in /usr/src/new/crash/dispnet.c line 33
- in /usr/src/new/crash/inet.c line 25
- in /usr/src/sys/netinet/ip_input.c line 35
- in /usr/src/sys/netinet/tcp_debug.c line 39
- in /usr/src/sys/netinet/tcp_input.c line 32
- in /usr/src/sys/netinet/tcp_output.c line 31
- in /usr/src/sys/netinet/tcp_subr.c line 33
- in /usr/src/sys/netinet/tcp_timer.c line 32
- in /usr/src/sys/netinet/tcp_usrreq.c line 33
- in /usr/src/ucb/PORT/systat/netstat.c line 28
- in /usr/src/ucb/netstat/inet.c line 36
- in /usr/src/usr.sbin/trpt/trpt.c line 33

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