5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011, Joyent Inc. All rights reserved.
24 * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
25 * Copyright (c) 2013 by Delphix. All rights reserved.
26 */
27
28 #ifndef _INET_TCP_IMPL_H
29 #define _INET_TCP_IMPL_H
30
31 /*
32 * TCP implementation private declarations. These interfaces are
33 * used to build the IP module and are not meant to be accessed
34 * by any modules except IP itself. They are undocumented and are
35 * subject to change without notice.
36 */
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 #ifdef _KERNEL
43
44 #include <sys/cpuvar.h>
45 #include <sys/clock_impl.h> /* For LBOLT_FASTPATH{,64} */
423 = (eager)->tcp_eager_prev_drop_q0; \
424 (eager)->tcp_eager_prev_drop_q0->tcp_eager_next_drop_q0 \
425 = (eager)->tcp_eager_next_drop_q0; \
426 (eager)->tcp_eager_prev_drop_q0 = NULL; \
427 (eager)->tcp_eager_next_drop_q0 = NULL; \
428 }
429
430 /*
431 * The format argument to pass to tcp_display().
432 * DISP_PORT_ONLY means that the returned string has only port info.
433 * DISP_ADDR_AND_PORT means that the returned string also contains the
434 * remote and local IP address.
435 */
436 #define DISP_PORT_ONLY 1
437 #define DISP_ADDR_AND_PORT 2
438
439 #define IP_ADDR_CACHE_SIZE 2048
440 #define IP_ADDR_CACHE_HASH(faddr) \
441 (ntohl(faddr) & (IP_ADDR_CACHE_SIZE -1))
442
443 /* TCP cwnd burst factor. */
444 #define TCP_CWND_INFINITE 65535
445 #define TCP_CWND_SS 3
446 #define TCP_CWND_NORMAL 5
447
448 /*
449 * TCP reassembly macros. We hide starting and ending sequence numbers in
450 * b_next and b_prev of messages on the reassembly queue. The messages are
451 * chained using b_cont. These macros are used in tcp_reass() so we don't
452 * have to see the ugly casts and assignments.
453 */
454 #define TCP_REASS_SEQ(mp) ((uint32_t)(uintptr_t)((mp)->b_next))
455 #define TCP_REASS_SET_SEQ(mp, u) ((mp)->b_next = \
456 (mblk_t *)(uintptr_t)(u))
457 #define TCP_REASS_END(mp) ((uint32_t)(uintptr_t)((mp)->b_prev))
458 #define TCP_REASS_SET_END(mp, u) ((mp)->b_prev = \
459 (mblk_t *)(uintptr_t)(u))
460
461 #define tcps_time_wait_interval tcps_propinfo_tbl[0].prop_cur_uval
462 #define tcps_conn_req_max_q tcps_propinfo_tbl[1].prop_cur_uval
463 #define tcps_conn_req_max_q0 tcps_propinfo_tbl[2].prop_cur_uval
464 #define tcps_conn_req_min tcps_propinfo_tbl[3].prop_cur_uval
465 #define tcps_conn_grace_period tcps_propinfo_tbl[4].prop_cur_uval
466 #define tcps_cwnd_max_ tcps_propinfo_tbl[5].prop_cur_uval
467 #define tcps_dbg tcps_propinfo_tbl[6].prop_cur_uval
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2011, Joyent Inc. All rights reserved.
24 * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
25 * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
26 */
27
28 #ifndef _INET_TCP_IMPL_H
29 #define _INET_TCP_IMPL_H
30
31 /*
32 * TCP implementation private declarations. These interfaces are
33 * used to build the IP module and are not meant to be accessed
34 * by any modules except IP itself. They are undocumented and are
35 * subject to change without notice.
36 */
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 #ifdef _KERNEL
43
44 #include <sys/cpuvar.h>
45 #include <sys/clock_impl.h> /* For LBOLT_FASTPATH{,64} */
423 = (eager)->tcp_eager_prev_drop_q0; \
424 (eager)->tcp_eager_prev_drop_q0->tcp_eager_next_drop_q0 \
425 = (eager)->tcp_eager_next_drop_q0; \
426 (eager)->tcp_eager_prev_drop_q0 = NULL; \
427 (eager)->tcp_eager_next_drop_q0 = NULL; \
428 }
429
430 /*
431 * The format argument to pass to tcp_display().
432 * DISP_PORT_ONLY means that the returned string has only port info.
433 * DISP_ADDR_AND_PORT means that the returned string also contains the
434 * remote and local IP address.
435 */
436 #define DISP_PORT_ONLY 1
437 #define DISP_ADDR_AND_PORT 2
438
439 #define IP_ADDR_CACHE_SIZE 2048
440 #define IP_ADDR_CACHE_HASH(faddr) \
441 (ntohl(faddr) & (IP_ADDR_CACHE_SIZE -1))
442
443 /*
444 * TCP reassembly macros. We hide starting and ending sequence numbers in
445 * b_next and b_prev of messages on the reassembly queue. The messages are
446 * chained using b_cont. These macros are used in tcp_reass() so we don't
447 * have to see the ugly casts and assignments.
448 */
449 #define TCP_REASS_SEQ(mp) ((uint32_t)(uintptr_t)((mp)->b_next))
450 #define TCP_REASS_SET_SEQ(mp, u) ((mp)->b_next = \
451 (mblk_t *)(uintptr_t)(u))
452 #define TCP_REASS_END(mp) ((uint32_t)(uintptr_t)((mp)->b_prev))
453 #define TCP_REASS_SET_END(mp, u) ((mp)->b_prev = \
454 (mblk_t *)(uintptr_t)(u))
455
456 #define tcps_time_wait_interval tcps_propinfo_tbl[0].prop_cur_uval
457 #define tcps_conn_req_max_q tcps_propinfo_tbl[1].prop_cur_uval
458 #define tcps_conn_req_max_q0 tcps_propinfo_tbl[2].prop_cur_uval
459 #define tcps_conn_req_min tcps_propinfo_tbl[3].prop_cur_uval
460 #define tcps_conn_grace_period tcps_propinfo_tbl[4].prop_cur_uval
461 #define tcps_cwnd_max_ tcps_propinfo_tbl[5].prop_cur_uval
462 #define tcps_dbg tcps_propinfo_tbl[6].prop_cur_uval
|