4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
28 * Copyright (c) 1982, 1986 Regents of the University of California.
29 * All rights reserved. The Berkeley software License Agreement
30 * specifies the terms and conditions for redistribution.
33 #ifndef _NETINET_TCP_H
34 #define _NETINET_TCP_H
36 /* tcp.h 1.11 88/08/19 SMI; from UCB 7.2 10/28/86 */
39 #include <sys/isa_defs.h>
40 #include <sys/inttypes.h>
46 typedef uint32_t tcp_seq
;
49 * Per RFC 793, September, 1981.
52 uint16_t th_sport
; /* source port */
53 uint16_t th_dport
; /* destination port */
54 tcp_seq th_seq
; /* sequence number */
55 tcp_seq th_ack
; /* acknowledgement number */
56 #ifdef _BIT_FIELDS_LTOH
57 uint_t th_x2
:4, /* (unused) */
58 th_off
:4; /* data offset */
60 uint_t th_off
:4, /* data offset */
61 th_x2
:4; /* (unused) */
72 uint16_t th_win
; /* window */
73 uint16_t th_sum
; /* checksum */
74 uint16_t th_urp
; /* urgent pointer */
79 #define TCPOPT_MAXSEG 2
80 #define TCPOPT_WSCALE 3
81 #define TCPOPT_SACK_PERMITTED 4
83 #define TCPOPT_TSTAMP 8
86 * Default maximum segment size for TCP.
87 * With an IP MTU of 576, this is 536.
92 * Options for use with [gs]etsockopt at the TCP level.
94 * Note: Some of the TCP_ namespace has conflict with and
95 * and is exposed through <xti.h>. (It also requires exposing
96 * options not implemented). The options with potential
97 * for conflicts use #ifndef guards.
100 #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
104 #define TCP_MAXSEG 0x02 /* set maximum segment size */
107 #ifndef TCP_KEEPALIVE
108 #define TCP_KEEPALIVE 0x8 /* set keepalive timer */
112 #define TCP_NOTIFY_THRESHOLD 0x10
113 #define TCP_ABORT_THRESHOLD 0x11
114 #define TCP_CONN_NOTIFY_THRESHOLD 0x12
115 #define TCP_CONN_ABORT_THRESHOLD 0x13
116 #define TCP_RECVDSTADDR 0x14
117 #define TCP_INIT_CWND 0x15
118 #define TCP_KEEPALIVE_THRESHOLD 0x16
119 #define TCP_KEEPALIVE_ABORT_THRESHOLD 0x17
120 #define TCP_CORK 0x18
121 #define TCP_RTO_INITIAL 0x19
122 #define TCP_RTO_MIN 0x1A
123 #define TCP_RTO_MAX 0x1B
124 #define TCP_LINGER2 0x1C
126 /* gap for expansion of ``standard'' options */
127 #define TCP_ANONPRIVBIND 0x20 /* for internal use only */
128 #define TCP_EXCLBIND 0x21 /* for internal use only */
129 #define TCP_KEEPIDLE 0x22
130 #define TCP_KEEPCNT 0x23
131 #define TCP_KEEPINTVL 0x24
137 #endif /* _NETINET_TCP_H */