Unleashed v1.4
[unleashed.git] / usr / src / uts / common / netinet / tcp_seq.h
blob1d9bf8935abbfd0eebbd4aaf7bf92ce64668d644
1 /*
2 * Copyright (c) 1982, 1986 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
7 #ifndef _NETINET_TCP_SEQ_H
8 #define _NETINET_TCP_SEQ_H
10 #pragma ident "%Z%%M% %I% %E% SMI"
11 /* tcp_seq.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/85 */
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
18 * TCP sequence numbers are 32 bit integers operated
19 * on with modular arithmetic. These macros can be
20 * used to compare such integers.
22 #define SEQ_LT(a, b) ((int32_t)((a)-(b)) < 0)
23 #define SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0)
24 #define SEQ_GT(a, b) ((int32_t)((a)-(b)) > 0)
25 #define SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0)
28 * Macros to initialize tcp sequence numbers for
29 * send and receive from initial send and receive
30 * sequence numbers.
32 #define tcp_rcvseqinit(tp) \
33 (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
35 #define tcp_sendseqinit(tp) \
36 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
37 (tp)->iss
39 #define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */
41 #ifdef __cplusplus
43 #endif
45 #endif /* _NETINET_TCP_SEQ_H */