4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1997, 2002-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <netinet/tcp.h> /* for tcp_seq */
38 /* Maximum num of receiver's SACK blocks */
39 #define MAX_SACK_BLK 5
41 /* Receiver's SACK blk structure */
42 typedef struct sack_blk
48 /* Sender's notsack'ed blk structure */
49 typedef struct notsack_blk
51 struct notsack_blk
*next
;
54 uint32_t sack_cnt
; /* Dup SACK count */
58 /* SACK information in the tcp_t structure. */
61 int32_t tcp_pipe
; /* # of bytes in network */
62 tcp_seq tcp_fack
; /* highest sack'ed seq num */
63 tcp_seq tcp_sack_snxt
; /* next seq num to be rexmited using SACK. */
65 int32_t tcp_max_sack_blk
; /* max # of SACK info blk in a segment */
66 int32_t tcp_num_sack_blk
; /* num of blks in sack list */
67 sack_blk_t tcp_sack_list
[MAX_SACK_BLK
]; /* the sack list */
69 /* num of blks in notsack list */
70 int32_t tcp_num_notsack_blk
;
71 /* # of bytes represented in blks in notsack list */
72 uint32_t tcp_cnt_notsack_list
;
73 /* the notsack list */
74 notsack_blk_t
*tcp_notsack_list
;
77 extern void tcp_sack_insert(sack_blk_t
*, tcp_seq
, tcp_seq
, int32_t *);
78 extern void tcp_sack_remove(sack_blk_t
*, tcp_seq
, int32_t *);
79 extern void tcp_notsack_insert(notsack_blk_t
**, tcp_seq
, tcp_seq
,
80 int32_t *, uint32_t *);
81 extern void tcp_notsack_remove(notsack_blk_t
**, tcp_seq
, int32_t *,
83 extern void tcp_notsack_update(notsack_blk_t
**, tcp_seq
, tcp_seq
,
84 int32_t *, uint32_t *);
88 * Macro to remove all the notsack'ed blks in sender.
91 * notsack_blk_t *head: pointer to the head of the list of notsack'ed blks.
93 #define TCP_NOTSACK_REMOVE_ALL(head) \
95 notsack_blk_t *prev, *tmp; \
100 bkmem_free((caddr_t)prev, sizeof (notsack_blk_t)); \
101 } while (tmp != NULL); \
109 #endif /* _INET_SACK_H */