8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / stand / lib / tcp / tcp_sack.h
blobd4707cda66784b0db7b52ca675cbaa3500d530ee
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 1997, 2002-2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _INET_SACK_H
28 #define _INET_SACK_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <netinet/tcp.h> /* for tcp_seq */
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
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
44 tcp_seq begin;
45 tcp_seq end;
46 } sack_blk_t;
48 /* Sender's notsack'ed blk structure */
49 typedef struct notsack_blk
51 struct notsack_blk *next;
52 tcp_seq begin;
53 tcp_seq end;
54 uint32_t sack_cnt; /* Dup SACK count */
55 } notsack_blk_t;
58 /* SACK information in the tcp_t structure. */
59 typedef struct
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;
75 } tcp_sack_info_t;
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 *,
82 uint32_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.
90 * Param:
91 * notsack_blk_t *head: pointer to the head of the list of notsack'ed blks.
93 #define TCP_NOTSACK_REMOVE_ALL(head) \
94 { \
95 notsack_blk_t *prev, *tmp; \
96 tmp = (head); \
97 do { \
98 prev = tmp; \
99 tmp = tmp->next; \
100 bkmem_free((caddr_t)prev, sizeof (notsack_blk_t)); \
101 } while (tmp != NULL); \
102 (head) = NULL; \
105 #ifdef __cplusplus
107 #endif
109 #endif /* _INET_SACK_H */