* Copyright (c) 1982, 1986 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* @(#)tcp.h 7.5 (Berkeley) %G%
* Definitions for byte order,
* according to byte significance from low address to high.
#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */
#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
#define BYTE_ORDER LITTLE_ENDIAN
#define BYTE_ORDER BIG_ENDIAN /* mc68000, tahoe, most others */
* Per RFC 793, September, 1981.
u_short th_sport
; /* source port */
u_short th_dport
; /* destination port */
tcp_seq th_seq
; /* sequence number */
tcp_seq th_ack
; /* acknowledgement number */
#if BYTE_ORDER == LITTLE_ENDIAN
u_char th_x2
:4, /* (unused) */
th_off
:4; /* data offset */
#if BYTE_ORDER == BIG_ENDIAN
u_char th_off
:4, /* data offset */
u_short th_win
; /* window */
u_short th_sum
; /* checksum */
u_short th_urp
; /* urgent pointer */
* Default maximum segment size for TCP.
* With an IP MSS of 576, this is 536,
* but 512 is probably more convenient.
#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
* User-settable options (used with setsockopt).
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
#define TCP_MAXSEG 0x02 /* set maximum segment size */