home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / netinet / h / tcp_seq < prev    next >
Encoding:
Text File  |  1995-01-11  |  1.4 KB  |  53 lines

  1. /*
  2.  * $Header: /ax/networking:include/netinet/tcp_seq.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/netinet/tcp_seq.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    tcp_seq.h,v $
  8.  * Revision 1.1  95/01/11  10:17:03  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:27:53  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* @(#)tcp_seq.h    1.1 87/07/01 3.2/4.3NFSSRC */
  16. /*
  17.  * Copyright (c) 1982, 1986 Regents of the University of California.
  18.  * All rights reserved.  The Berkeley software License Agreement
  19.  * specifies the terms and conditions for redistribution.
  20.  *
  21.  *    @(#)tcp_seq.h    7.1 (Berkeley) 6/5/86
  22.  */
  23.  
  24. /*
  25.  * TCP sequence numbers are 32 bit integers operated
  26.  * on with modular arithmetic.  These macros can be
  27.  * used to compare such integers.
  28.  */
  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)
  33.  
  34. /*
  35.  * Macros to initialize tcp sequence numbers for
  36.  * send and receive from initial send and receive
  37.  * sequence numbers.
  38.  */
  39. #define    tcp_rcvseqinit(tp) \
  40.     (tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1
  41.  
  42. #define    tcp_sendseqinit(tp) \
  43.     (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \
  44.         (tp)->iss
  45.  
  46. #define    TCP_ISSINCR    (125*1024)    /* increment for tcp_iss each second */
  47.  
  48. #ifdef KERNEL
  49. tcp_seq    tcp_iss;        /* tcp initial send seq # */
  50. #endif
  51.  
  52. /* EOF tcp_seq.h */
  53.