IT++ Logo
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
itpp::Sequence_Number Class Reference

#include <itpp/protocol/tcp.h>

Public Member Functions

 Sequence_Number ()
 Default constructor.
 
 Sequence_Number (const Sequence_Number &n)
 ADD DOCUMENTATION HERE.
 
Sequence_Numberoperator= (const Sequence_Number &n)
 ADD DOCUMENTATION HERE.
 
Sequence_Numberoperator= (const int &rep)
 ADD DOCUMENTATION HERE.
 
bool operator== (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
bool operator!= (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
bool operator> (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
bool operator>= (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
bool operator< (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
bool operator<= (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
Sequence_Number operator+ (const int n) const
 ADD DOCUMENTATION HERE.
 
Sequence_Numberoperator+= (const int n)
 ADD DOCUMENTATION HERE.
 
Sequence_Number operator- (const int n) const
 ADD DOCUMENTATION HERE.
 
Sequence_Numberoperator-= (const int n)
 ADD DOCUMENTATION HERE.
 
int operator- (const Sequence_Number &n) const
 ADD DOCUMENTATION HERE.
 
int value () const
 Access to internal representation.
 

Protected Member Functions

 Sequence_Number (int n)
 ADD DOCUMENTATION HERE.
 

Protected Attributes

int seq
 ADD DOCUMENTATION HERE.
 

Friends

Sequence_Number operator+ (const int n1, const Sequence_Number &n2)
 ADD DOCUMENTATION HERE.
 
std::ostream & operator<< (std::ostream &os, const Sequence_Number &n)
 ADD DOCUMENTATION HERE.
 

Detailed Description

TSequenceNumber represents a sequence number in a byte stream. As simulations may get quite long sequence numbers based on 32 bit integers may overflow. This is not a major problem as long as this overflow is considered when comparing sequence numbers. TSequenceNumber defines relational operators base on subtraction instead of using built-in int relational operators. This approach works well for arbitrary long simulations as long as the "real" sequence numbers (i.e. the numbers seen without overflow) compared to each other do not differ by more than 2^31-1 (INT_MAX) which is not a serious restriction in a realistic TCP scenario.

See Also
TTCPSegment
Author
Bodamer

Definition at line 71 of file tcp.h.


The documentation for this class was generated from the following file:
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:34 for IT++ by Doxygen 1.8.2