2 * Portions Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
7 * Copyright (c) 1982, 1986 Regents of the University of California.
8 * All rights reserved. The Berkeley software License Agreement
9 * specifies the terms and conditions for redistribution.
17 #ifndef _NETINET_TCP_SEQ_H
18 #define _NETINET_TCP_SEQ_H
25 TCP sequence numbers are 32 bit integers operated
26 on with modular arithmetic. These macros can be
27 used to compare such integers.
29 #define SEQ_LT(a, b) ((int)((a)-(b)) < 0)
30 #define SEQ_LEQ(a, b) ((int)((a)-(b)) <= 0)
31 #define SEQ_GT(a, b) ((int)((a)-(b)) > 0)
32 #define SEQ_GEQ(a, b) ((int)((a)-(b)) >= 0)
35 Macros to initialize tcp sequence numbers for
36 send and receive from initial send and receive
39 #define tcp_rcvseqinit(tp) \
40 (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
42 #define tcp_sendseqinit(tp) \
43 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
46 #define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */
52 #endif /* _NETINET_TCP_SEQ_H */