bug: don't soisdisconnected on datagram sockets, want to reconnect
[unix-history] / usr / src / sys / netinet / tcp_seq.h
CommitLineData
8ae0e4b4
KM
1/*
2 * Copyright (c) 1982 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
875dfa99 6 * @(#)tcp_seq.h 6.4 (Berkeley) %G%
8ae0e4b4 7 */
5c3c035b
BJ
8
9/*
10 * TCP sequence numbers are 32 bit integers operated
11 * on with modular arithmetic. These macros can be
12 * used to compare such integers.
13 */
14#define SEQ_LT(a,b) ((int)((a)-(b)) < 0)
15#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0)
16#define SEQ_GT(a,b) ((int)((a)-(b)) > 0)
17#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0)
18
19/*
20 * Macros to initialize tcp sequence numbers for
21 * send and receive from initial send and receive
22 * sequence numbers.
23 */
24#define tcp_rcvseqinit(tp) \
678bbab1 25 (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
5c3c035b
BJ
26
27#define tcp_sendseqinit(tp) \
28 (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
29 (tp)->iss
30
875dfa99 31#define TCP_ISSINCR (125*1024) /* increment for tcp_iss each second */
5c3c035b
BJ
32
33#ifdef KERNEL
34tcp_seq tcp_iss; /* tcp initial send seq # */
35#endif