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.
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 */
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
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 = \
39 #define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */
45 #endif /* _NETINET_TCP_SEQ_H */