1*23192Smckusick /* 2*23192Smckusick * Copyright (c) 1982 Regents of the University of California. 3*23192Smckusick * All rights reserved. The Berkeley software License Agreement 4*23192Smckusick * specifies the terms and conditions for redistribution. 5*23192Smckusick * 6*23192Smckusick * @(#)tcp_seq.h 6.2 (Berkeley) 06/08/85 7*23192Smckusick */ 85124Swnj 95124Swnj /* 105124Swnj * TCP sequence numbers are 32 bit integers operated 115124Swnj * on with modular arithmetic. These macros can be 125124Swnj * used to compare such integers. 135124Swnj */ 145124Swnj #define SEQ_LT(a,b) ((int)((a)-(b)) < 0) 155124Swnj #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) 165124Swnj #define SEQ_GT(a,b) ((int)((a)-(b)) > 0) 175124Swnj #define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) 185124Swnj 195124Swnj /* 205124Swnj * Macros to initialize tcp sequence numbers for 215124Swnj * send and receive from initial send and receive 225124Swnj * sequence numbers. 235124Swnj */ 245124Swnj #define tcp_rcvseqinit(tp) \ 255124Swnj (tp)->rcv_nxt = (tp)->irs + 1 265124Swnj 275124Swnj #define tcp_sendseqinit(tp) \ 285124Swnj (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \ 295124Swnj (tp)->iss 305124Swnj 315124Swnj #define TCP_ISSINCR 128 /* increment for tcp_iss each second */ 325124Swnj 335124Swnj #ifdef KERNEL 345124Swnj tcp_seq tcp_iss; /* tcp initial send seq # */ 355124Swnj #endif 36