epoc32/include/libc/netinet/tcp_seq.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 tcp_seq.h
     1 /* TCP_SEQ.H
       
     2  * 
       
     3  * Portions copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
       
     4  */
       
     5 
       
     6 /*
       
     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.
       
    10  */
       
    11 
       
    12 /** @file
       
    13 @publishedAll
       
    14 @released
       
    15 */
       
    16 
       
    17 #ifndef	_NETINET_TCP_SEQ_H
       
    18 #define	_NETINET_TCP_SEQ_H
       
    19 
       
    20 #ifdef	__cplusplus
       
    21 extern "C" {
       
    22 #endif
       
    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	__cplusplus
       
    49 }
       
    50 #endif
       
    51 
       
    52 #endif	/* _NETINET_TCP_SEQ_H */