puname: do not support modifying arbitrary processes
[unleashed.git] / include / inet / tcp_stack.h
blobc99086982e8e069a85fd6a0a441254a599b0022c
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
26 #ifndef _INET_TCP_STACK_H
27 #define _INET_TCP_STACK_H
29 #include <sys/netstack.h>
30 #include <inet/ip.h>
31 #include <inet/ipdrop.h>
32 #include <inet/tcp_stats.h>
33 #include <sys/sunddi.h>
34 #include <sys/sunldi.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #ifdef _KERNEL
43 * TCP stack instances
45 struct tcp_stack {
46 netstack_t *tcps_netstack; /* Common netstack */
49 * Extra privileged ports. In host byte order.
50 * Protected by tcp_epriv_port_lock.
52 #define TCP_NUM_EPRIV_PORTS 64
53 int tcps_g_num_epriv_ports;
54 in_port_t tcps_g_epriv_ports[TCP_NUM_EPRIV_PORTS];
55 kmutex_t tcps_epriv_port_lock;
58 * The smallest anonymous port in the priviledged port range which TCP
59 * looks for free port. Use in the option TCP_ANONPRIVBIND.
61 in_port_t tcps_min_anonpriv_port;
63 /* holds the tcp tunables */
64 struct mod_prop_info_s *tcps_propinfo_tbl;
66 /* Hint not protected by any lock */
67 uint_t tcps_next_port_to_try;
69 /* TCP bind hash list - all tcp_t with state >= BOUND. */
70 struct tf_s *tcps_bind_fanout;
72 /* TCP queue hash list - all tcp_t in case they will be an acceptor. */
73 struct tf_s *tcps_acceptor_fanout;
76 * MIB-2 stuff for SNMP
77 * Note: tcpInErrs {tcp 15} is accumulated in ip.c
79 kstat_t *tcps_mibkp; /* kstat exporting mib2_tcp_t data */
80 kstat_t *tcps_kstat; /* kstat exporting tcp_stat_t data */
82 MD5_CTX tcps_iss_key;
84 /* Packet dropper for TCP IPsec policy drops. */
85 ipdropper_t tcps_dropper;
88 * These two variables control the rate for TCP to generate RSTs in
89 * response to segments not belonging to any connections. We limit
90 * TCP to sent out tcp_rst_sent_rate (ndd param) number of RSTs in
91 * each 1 second interval. This is to protect TCP against DoS attack.
93 int64_t tcps_last_rst_intrvl;
94 uint32_t tcps_rst_cnt;
96 ldi_ident_t tcps_ldi_ident;
98 /* Used to synchronize access when reclaiming memory */
99 mblk_t *tcps_ixa_cleanup_mp;
100 kmutex_t tcps_ixa_cleanup_lock;
101 kcondvar_t tcps_ixa_cleanup_ready_cv;
102 kcondvar_t tcps_ixa_cleanup_done_cv;
104 /* Variables for handling kmem reclaim call back. */
105 kmutex_t tcps_reclaim_lock;
106 boolean_t tcps_reclaim;
107 timeout_id_t tcps_reclaim_tid;
108 uint32_t tcps_reclaim_period;
110 /* Listener connection limit configuration. */
111 kmutex_t tcps_listener_conf_lock;
112 list_t tcps_listener_conf;
115 * Per CPU stats
117 * tcps_sc: array of pointer to per CPU stats. The i-th element in the
118 * array represents the stats of the CPU with cpu_seqid.
119 * tcps_sc_cnt: number of CPU stats in the tcps_sc array.
121 tcp_stats_cpu_t **tcps_sc;
122 int tcps_sc_cnt;
125 typedef struct tcp_stack tcp_stack_t;
127 #endif /* _KERNEL */
128 #ifdef __cplusplus
130 #endif
132 #endif /* _INET_TCP_STACK_H */