Commit | Line | Data |
---|---|---|
8ae0e4b4 | 1 | /* |
0880b18e | 2 | * Copyright (c) 1982, 1986 Regents of the University of California. |
2b6b6284 | 3 | * All rights reserved. |
8ae0e4b4 | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
2b6b6284 | 6 | * |
dbf0c423 | 7 | * @(#)tcp_seq.h 7.4 (Berkeley) %G% |
8ae0e4b4 | 8 | */ |
5c3c035b BJ |
9 | |
10 | /* | |
11 | * TCP sequence numbers are 32 bit integers operated | |
12 | * on with modular arithmetic. These macros can be | |
13 | * used to compare such integers. | |
14 | */ | |
15 | #define SEQ_LT(a,b) ((int)((a)-(b)) < 0) | |
16 | #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) | |
17 | #define SEQ_GT(a,b) ((int)((a)-(b)) > 0) | |
18 | #define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) | |
19 | ||
20 | /* | |
21 | * Macros to initialize tcp sequence numbers for | |
22 | * send and receive from initial send and receive | |
23 | * sequence numbers. | |
24 | */ | |
25 | #define tcp_rcvseqinit(tp) \ | |
678bbab1 | 26 | (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1 |
5c3c035b BJ |
27 | |
28 | #define tcp_sendseqinit(tp) \ | |
29 | (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \ | |
30 | (tp)->iss | |
31 | ||
875dfa99 | 32 | #define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */ |
5c3c035b BJ |
33 | |
34 | #ifdef KERNEL | |
35 | tcp_seq tcp_iss; /* tcp initial send seq # */ | |
36 | #endif |