/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2014 by Delphix. All rights reserved.
*/
/* Copyright (c) 1990 Mentat Inc. */
#ifndef _INET_TCP_H
#define _INET_TCP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/inttypes.h>
#include <sys/socket_proto.h>
#include <inet/tcp_stack.h>
#include <inet/tcp_sack.h>
/* TCP states */
/* states < TCPS_ESTABLISHED are those where connections not established */
/* states > TCPS_CLOSE_WAIT are those where user has closed */
/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */
/*
* Internal flags used in conjunction with the packet header flags.
* Used in tcp_input_data to keep track of what needs to be done.
*/
/*
* TCP sequence numbers are 32 bit integers operated
* on with modular arithmetic. These macros can be
* used to compare such integers.
*/
/* TCP Protocol header */
typedef struct tcphdr_s {
} tcph_t;
/* TCP Protocol header (used if the header is known to be 32-bit aligned) */
typedef struct tcphdra_s {
} tcpha_t;
struct conn_s;
struct tcp_listen_cnt_s;
/*
* Control structure for each open TCP stream,
* defined only within the kernel or for a kmem user.
* NOTE: tcp_reinit_values MUST have a line for each field in this structure!
*/
typedef struct tcp_s {
/* Pointer to next T/W block */
/* Pointer to previous T/W next */
/* data segment */
/* lbolt on last packet, used for PAWS */
/* Fields arranged in approximate access order along main paths */
/* Following manipulated by TCP under squeue protection */
/* Following manipulated by TCP under squeue protection */
/* SACK related info */
/* Cache ip addresses that */
/* complete the 3-way handshake */
/* all eagers form a circular list */
union {
} tcp_conn;
/*
* TCP Keepalive Timer members.
* All keepalive timer intervals are in milliseconds.
*/
/*
* TCP connection is terminated if we don't hear back from the peer
* for tcp_ka_abort_thres milliseconds after the first keepalive probe.
* tcp_ka_rinterval is the interval in milliseconds between successive
* keepalive probes. tcp_ka_cnt is the number of keepalive probes to
* be sent before terminating the connection, if we don't hear back from
* peer.
* tcp_ka_abort_thres = tcp_ka_rinterval * tcp_ka_cnt
*/
/*
* The header template lives in conn_ht_iphc allocated by tcp_build_hdrs
* We maintain three pointers into conn_ht_iphc.
*/
int tcp_ipsec_overhead;
/*
* All fusion-related fields are protected by squeue.
*/
/*
* This variable is accessed without any lock protection
* and therefore must not be declared as a bit field along
* with the rest which require such condition.
*/
/* protected by the tcp_non_sq_lock lock */
/*
* tcp_closemp_used is protected by listener's tcp_eager_lock
* when used for eagers. When used for a tcp in TIME_WAIT state
* or in tcp_close(), it is not protected by any lock as we
* do not expect any other thread to use it concurrently.
* We do allow re-use of tcp_closemp in tcp_time_wait_collector()
* and tcp_close() but not concurrently.
*/
/*
* previous and next eagers in the list of droppable eagers. See
* the comments before MAKE_DROPPABLE(). These pointers are
* protected by listener's tcp_eager_lock.
*/
/*
* Have we flow controlled xmitter?
* This variable can be modified outside the squeue and hence must
* not be declared as a bit field along with the rest that are
* modified only within the squeue.
* protected by the tcp_non_sq_lock lock.
*/
/*
* Sender's next sequence number at the time the window was shrunk.
*/
/*
* Socket generation number which is bumped when a connection attempt
* is initiated. Its main purpose is to ensure that the socket does not
* miss the asynchronous connected/disconnected notification.
*/
/* mblk_t used to enter TCP's squeue from the service routine. */
/* Mutex for accessing tcp_rsrv_mp */
/* For connection counting. */
/* Segment reassembly timer. */
/* FIN-WAIT-2 flush timeout */
#ifdef DEBUG
#endif
} tcp_t;
#ifdef DEBUG
depth))
#else
#endif
extern void tcp_conn_reclaim(void *);
extern void tcp_ddi_g_init(void);
extern void tcp_ddi_g_destroy(void);
/* Pad for the tf_t structure to avoid false cache line sharing. */
/*
* The TCP Fanout structure for bind and acceptor hashes.
* The hash tables and their linkage (tcp_*_hash, tcp_ptp*hn) are
* protected by the per-bucket tf_lock. Each tcp_t
* inserted in the list points back at this lock using tcp_*_lockp.
*
* The bind and acceptor hash queues are lists of tcp_t.
*/
/* listener hash and acceptor hash queue head */
typedef struct tf_s {
} tf_t;
/* Also used in ipclassifier.c */
extern struct kmem_cache *tcp_sack_info_cache;
#endif /* (defined(_KERNEL) || defined(_KMEMUSER)) */
/* Contract private interface between TCP and Clustering. */
typedef struct cl_tcp_info_s {
#ifdef _KERNEL
/* Note: V4_PART_OF_V6 is meant to be used only for _KERNEL defined stuff */
#endif /* _KERNEL */
/*
* Hook functions to enable cluster networking
* On non-clustered systems these vectors must always be NULL.
*/
/*
* Contracted Consolidation Private ioctl for aborting TCP connections.
* In order to keep the offsets and size of the structure the same between
* a 32-bit application and a 64-bit amd64 kernel, we use a #pragma
* pack(4).
*/
#pragma pack(4)
#endif
typedef struct tcp_ioc_abort_conn_s {
#pragma pack()
#endif
#ifdef __cplusplus
}
#endif
#endif /* _INET_TCP_H */