INET Framework for OMNeT++/OMNEST
inet::tcp::TcpHeader Class Reference

Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:176 by opp_msgtool. More...

#include <TcpHeader_m.h>

Inheritance diagram for inet::tcp::TcpHeader:
inet::TransportHeaderBase inet::FieldsChunk inet::Chunk inet::IPrintableObject inet::IRegionTaggedObject

Public Member Functions

 TcpHeader ()
 
 TcpHeader (const TcpHeader &other)
 
virtual ~TcpHeader ()
 
TcpHeaderoperator= (const TcpHeader &other)
 
virtual TcpHeaderdup () const override
 
virtual void parsimPack (omnetpp::cCommBuffer *b) const override
 
virtual void parsimUnpack (omnetpp::cCommBuffer *b) override
 
virtual unsigned short getSrcPort () const
 
virtual void setSrcPort (unsigned short srcPort)
 
virtual unsigned short getDestPort () const
 
virtual void setDestPort (unsigned short destPort)
 
virtual uint32_t getSequenceNo () const
 
virtual void setSequenceNo (uint32_t sequenceNo)
 
virtual uint32_t getAckNo () const
 
virtual void setAckNo (uint32_t ackNo)
 
virtual ::inet::B getHeaderLength () const
 
virtual void setHeaderLength (::inet::B headerLength)
 
virtual bool getCwrBit () const
 
virtual void setCwrBit (bool cwrBit)
 
virtual bool getEceBit () const
 
virtual void setEceBit (bool eceBit)
 
virtual bool getUrgBit () const
 
virtual void setUrgBit (bool urgBit)
 
virtual bool getAckBit () const
 
virtual void setAckBit (bool ackBit)
 
virtual bool getPshBit () const
 
virtual void setPshBit (bool pshBit)
 
virtual bool getRstBit () const
 
virtual void setRstBit (bool rstBit)
 
virtual bool getSynBit () const
 
virtual void setSynBit (bool synBit)
 
virtual bool getFinBit () const
 
virtual void setFinBit (bool finBit)
 
virtual uint16_t getWindow () const
 
virtual void setWindow (uint16_t window)
 
virtual uint16_t getUrgentPointer () const
 
virtual void setUrgentPointer (uint16_t urgentPointer)
 
virtual uint16_t getCrc () const
 
virtual void setCrc (uint16_t crc)
 
virtual ::inet::CrcMode getCrcMode () const
 
virtual void setCrcMode (::inet::CrcMode crcMode)
 
virtual void setHeaderOptionArraySize (size_t size)
 
virtual size_t getHeaderOptionArraySize () const
 
virtual const TcpOptiongetHeaderOption (size_t k) const
 
virtual TcpOptiongetHeaderOptionForUpdate (size_t k)
 
virtual void setHeaderOption (size_t k, TcpOption *headerOption)
 
virtual TcpOptionremoveHeaderOption (size_t k)
 
TcpOptiondropHeaderOption (size_t k)
 
virtual void insertHeaderOption (size_t k, TcpOption *headerOption)
 
void insertHeaderOption (TcpOption *headerOption)
 
virtual void appendHeaderOption (TcpOption *headerOption)
 
virtual void eraseHeaderOption (size_t k)
 
uint32_t getSynFinLen () const
 Returns RFC 793 specified SEG.LEN: SEG.LEN = the number of octets occupied by the data in the segment (counting SYN and FIN) More...
 
virtual B getHeaderOptionArrayLength ()
 Calculate Length of TCP Options Array in bytes. More...
 
virtual void dropHeaderOptions ()
 Drops all TCP options of the TCP segment. More...
 
virtual unsigned int getSourcePort () const override
 
virtual void setSourcePort (unsigned int port) override
 
virtual unsigned int getDestinationPort () const override
 
virtual void setDestinationPort (unsigned int port) override
 
virtual std::string str () const override
 Returns a human readable string representation of the data present in this chunk. More...
 
- Public Member Functions inherited from inet::FieldsChunk
 FieldsChunk ()
 
 FieldsChunk (const FieldsChunk &other)
 
virtual ~FieldsChunk ()
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
virtual void handleChange () override
 
virtual ChunkType getChunkType () const override
 Returns the type of this chunk as an enum member. More...
 
virtual bool containsSameData (const Chunk &other) const override
 Returns true if the two chunks represent the same binary data. More...
 
virtual b getChunkLength () const override
 Returns the length of data represented by this chunk. More...
 
virtual void setChunkLength (b chunkLength)
 
virtual void addChunkLength (b chunkLength)
 
virtual std::ostream & printFieldsToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints an optinally formatted human readable string representation of the feilds of this chunk to the given stream. More...
 
- Public Member Functions inherited from inet::Chunk
 Chunk ()
 
 Chunk (const Chunk &other)
 
virtual const Ptr< ChunkdupShared () const
 Returns a mutable copy of this chunk in a shared pointer. More...
 
virtual void forEachChild (cVisitor *v) override
 
virtual bool isMutable () const
 
virtual bool isImmutable () const
 
virtual void markImmutable ()
 
void markMutableIfExclusivelyOwned ()
 
virtual bool isComplete () const
 
virtual bool isIncomplete () const
 
virtual void markIncomplete ()
 
virtual bool isCorrect () const
 
virtual bool isIncorrect () const
 
virtual void markIncorrect ()
 
virtual bool isProperlyRepresented () const
 
virtual bool isImproperlyRepresented () const
 
virtual void markImproperlyRepresented ()
 
virtual void moveIterator (Iterator &iterator, b length) const
 
virtual void seekIterator (Iterator &iterator, b position) const
 
virtual bool canInsertAtFront (const Ptr< const Chunk > &chunk) const
 Returns true if this chunk is capable of representing the result. More...
 
virtual bool canInsertAtBack (const Ptr< const Chunk > &chunk) const
 Returns true if this chunk is capable of representing the result. More...
 
virtual bool canInsertAt (const Ptr< const Chunk > &chunk, b offset) const
 Returns true if this chunk is capable of representing the result. More...
 
void insertAtFront (const Ptr< const Chunk > &chunk)
 Inserts the provided chunk at the beginning of this chunk. More...
 
void insertAtBack (const Ptr< const Chunk > &chunk)
 Inserts the provided chunk at the end of this chunk. More...
 
void insertAt (const Ptr< const Chunk > &chunk, b offset)
 Inserts the provided chunk into this chunk. More...
 
virtual bool canRemoveAtFront (b length) const
 Returns true if this chunk is capable of representing the result. More...
 
virtual bool canRemoveAtBack (b length) const
 Returns true if this chunk is capable of representing the result. More...
 
virtual bool canRemoveAt (b offset, b length) const
 Returns true if this chunk is capable of representing the result. More...
 
void removeAtFront (b length)
 Removes the requested part from the beginning of this chunk. More...
 
void removeAtBack (b length)
 Removes the requested part from the end of this chunk. More...
 
void removeAt (b offset, b length)
 Removes the requested part from this chunk. More...
 
int getChunkId () const
 Returns the sequentially assigned id. More...
 
virtual bool isEmpty () const
 Returns true if this chunk contains no data. More...
 
const Ptr< Chunksimplify () const
 Returns the simplified representation of this chunk eliminating all potential redundancies. More...
 
const Ptr< Chunkpeek (const Iterator &iterator, b length=unspecifiedLength, int flags=0) const
 Returns the designated part of the data represented by this chunk in its default representation. More...
 
template<typename T >
bool has (const Iterator &iterator, b length=unspecifiedLength) const
 Returns whether if the designated part of the data is available in the requested representation. More...
 
template<typename T >
const Ptr< Tpeek (const Iterator &iterator, b length=unspecifiedLength, int flags=0) const
 Returns the designated part of the data represented by this chunk in the requested representation. More...
 
virtual SharingRegionTagSetgetRegionTags () override
 Returns all region tags. More...
 
int getNumTags () const
 Returns the number of chunk tags. More...
 
const Ptr< const TagBasegetTag (int index) const
 Returns the chunk tag at the given index. More...
 
void clearTags (b offset=b(0), b length=b(-1))
 Clears the set of chunk tags in the given region. More...
 
void copyTags (const Chunk &source, b sourceOffset=b(0), b offset=b(0), b length=b(-1))
 Copies the set of chunk tags from the source region to the provided region. More...
 
template<typename T >
const Ptr< const TfindTag (b offset=b(0), b length=b(-1)) const
 Returns the chunk tag for the provided type and range, or returns nullptr if no such chunk tag is found. More...
 
template<typename T >
const Ptr< const TgetTag (b offset=b(0), b length=b(-1)) const
 Returns the chunk tag for the provided type and range, or throws an exception if no such chunk tag is found. More...
 
template<typename T >
void mapAllTags (b offset, b length, std::function< void(b, b, const Ptr< const T > &)> f) const
 Maps all tags in the provided range to to the function. More...
 
template<typename T >
void mapAllTagsForUpdate (b offset, b length, std::function< void(b, b, const Ptr< T > &)> f)
 Maps all tags in the provided range to to the function. More...
 
template<typename T >
std::vector< SharingRegionTagSet::RegionTag< const T > > getAllTags (b offset=b(0), b length=b(-1)) const
 Returns all chunk tags for the provided type and range in a detached vector of region tags. More...
 
template<typename T >
std::vector< SharingRegionTagSet::RegionTag< T > > getAllTagsForUpdate (b offset=b(0), b length=b(-1))
 Returns all chunk tags for the provided type and range in a detached vector of region tags. More...
 
template<typename T >
const Ptr< TaddTag (b offset=b(0), b length=b(-1))
 Returns a newly added chunk tag for the provided type and range, or throws an exception if such a chunk tag is already present. More...
 
template<typename T >
const Ptr< TaddTagIfAbsent (b offset=b(0), b length=b(-1))
 Returns a newly added chunk tag for the provided type and range if absent, or returns the chunk tag that is already present. More...
 
template<typename T >
std::vector< SharingRegionTagSet::RegionTag< T > > addTagsWhereAbsent (b offset=b(0), b length=b(-1))
 Returns the newly added chunk tags for the provided type and range where the tag is absent. More...
 
template<typename T >
const Ptr< TremoveTag (b offset, b length)
 Removes the chunk tag for the provided type and range, or throws an exception if no such chunk tag is found. More...
 
template<typename T >
const Ptr< TremoveTagIfPresent (b offset, b length)
 Removes the chunk tag for the provided type and range if present, or returns nullptr if no such chunk tag is found. More...
 
template<typename T >
std::vector< SharingRegionTagSet::RegionTag< T > > removeTagsWherePresent (b offset, b length)
 Removes and returns all chunk tags for the provided type and range. More...
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints an optinally formatted human readable string representation of the data present in this chunk to the given stream. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Protected Member Functions

bool operator== (const TcpHeader &)=delete
 
- Protected Member Functions inherited from inet::FieldsChunk
const std::vector< uint8_t > * getSerializedBytes () const
 
void setSerializedBytes (const std::vector< uint8_t > *bytes) const
 
virtual const Ptr< ChunkpeekUnchecked (PeekPredicate predicate, PeekConverter converter, const Iterator &iterator, b length, int flags) const override
 
- Protected Member Functions inherited from inet::Chunk
int getBinDumpNumLines () const
 
int getHexDumpNumLines () const
 
const char * getBinDumpLine (int index)
 
const char * getHexDumpLine (int index)
 
const SharingRegionTagSet::RegionTag< TagBase > & _getTag (int index) const
 
void checkMutable () const
 
virtual void doInsertAtFront (const Ptr< const Chunk > &chunk)
 
virtual void doInsertAtBack (const Ptr< const Chunk > &chunk)
 
virtual void doInsertAt (const Ptr< const Chunk > &chunk, b offset)
 
virtual void doRemoveAtFront (b length)
 
virtual void doRemoveAtBack (b length)
 
virtual void doRemoveAt (b offset, b length)
 
template<typename T >
const Ptr< TpeekConverted (const Iterator &iterator, b length, int flags) const
 
template<typename T >
const Ptr< TcheckPeekResult (const Ptr< T > &chunk, int flags) const
 

Protected Attributes

unsigned short srcPort = 0
 
unsigned short destPort = 0
 
uint32_t sequenceNo = 0
 
uint32_t ackNo = 0
 
::inet::B headerLength = TCP_MIN_HEADER_LENGTH
 
bool cwrBit = false
 
bool eceBit = false
 
bool urgBit = false
 
bool ackBit = false
 
bool pshBit = false
 
bool rstBit = false
 
bool synBit = false
 
bool finBit = false
 
uint16_t window = 0
 
uint16_t urgentPointer = 0
 
uint16_t crc = 0
 
::inet::CrcMode crcMode = CRC_MODE_UNDEFINED
 
TcpOption ** headerOption = nullptr
 
size_t headerOption_arraysize = 0
 
- Protected Attributes inherited from inet::FieldsChunk
b chunkLength
 
const std::vector< uint8_t > * serializedBytes
 The serialized representation of this chunk or nullptr if not available. More...
 
- Protected Attributes inherited from inet::Chunk
int id
 The id is automatically assigned sequentially during construction. More...
 
int flags
 The boolean chunk flags are merged into a single integer. More...
 
SharingRegionTagSet regionTags
 The set of region tags attached to the data represented by this chunk. More...
 
const typedef Ptr< Chunk >(* PeekConverter )(const Ptr< Chunk > &chunk, const Chunk::Iterator &iterator, b length, int flags)
 

Private Member Functions

void copy (const TcpHeader &other)
 

Additional Inherited Members

- Public Types inherited from inet::Chunk
enum  ChunkType {
  CT_EMPTY, CT_BITCOUNT, CT_BITS, CT_BYTECOUNT,
  CT_BYTES, CT_SLICE, CT_ENCRYPTED, CT_CPACKET,
  CT_SEQUENCE, CT_FIELDS
}
 This enum is used to avoid std::dynamic_cast and dynamicPtrCast. More...
 
enum  PeekFlag {
  PF_ALLOW_NULLPTR = (1 << 0), PF_ALLOW_EMPTY = (1 << 1), PF_ALLOW_INCOMPLETE = (1 << 2), PF_ALLOW_INCORRECT = (1 << 3),
  PF_ALLOW_IMPROPERLY_REPRESENTED = (1 << 4), PF_ALLOW_SERIALIZATION = (1 << 5), PF_ALLOW_ALL = -1
}
 This enum specifies bitmasks for the flags argument of various peek functions. More...
 
- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 
- Static Public Member Functions inherited from inet::Chunk
static void serialize (MemoryOutputStream &stream, const Ptr< const Chunk > &chunk, b offset=b(0), b length=b(-1))
 Serializes a chunk into the given stream. More...
 
static const Ptr< Chunkdeserialize (MemoryInputStream &stream, const std::type_info &typeInfo)
 Deserializes a chunk from the given stream. More...
 
- Static Public Attributes inherited from inet::Chunk
static const b unspecifiedLength = b(-std::numeric_limits<int64_t>::max())
 
static bool enableImplicitChunkSerialization = false
 Peeking some part into a chunk that requires automatic serialization will throw an exception when implicit chunk serialization is disabled. More...
 
static int nextId = 0
 
- Protected Types inherited from inet::Chunk
enum  ChunkFlag { CF_IMMUTABLE = (1 << 0), CF_INCOMPLETE = (1 << 1), CF_INCORRECT = (1 << 2), CF_IMPROPERLY_REPRESENTED = (1 << 3) }
 This enum specifies bitmasks for the flags field of Chunk. More...
 
typedef bool(* PeekPredicate) (const Ptr< Chunk > &)
 
- Static Protected Member Functions inherited from inet::FieldsChunk
static const Ptr< ChunkconvertChunk (const std::type_info &typeInfo, const Ptr< Chunk > &chunk, b offset, b length, int flags)
 
- Static Protected Member Functions inherited from inet::Chunk
static const Ptr< ChunkconvertChunk (const std::type_info &typeInfo, const Ptr< Chunk > &chunk, b offset, b length, int flags)
 Creates a new chunk of the given type that represents the designated part of the provided chunk. More...
 

Detailed Description

Class generated from inet/transportlayer/tcp_common/TcpHeader.msg:176 by opp_msgtool.

//
// Represents a TCP segment, to be used with the ~TCP module.
//
// TCP header fields not explicitly modelled: work on going
// - Data Offset (number of 32 bit words in the header): represented
//   by cMessage::length().
// - Reserved (reserved for future use)
// - Checksum (header checksum): modelled by cMessage::hasBitError()
// - Header Options: Currently only EOL, NOP, MSS, WS, SACK_PERMITTED, SACK and TS are implemented
// - Padding
//
// cMessage::getKind() may be set to an arbitrary value: TCP entities will
// ignore it and use only the header fields (synBit, ackBit, rstBit).
//
class TcpHeader extends TransportHeaderBase
{
    chunkLength = TCP_MIN_HEADER_LENGTH;
    // Source Port
    unsigned short srcPort;
    // Destination Port
    unsigned short destPort;
    // Sequence Number: first sequence number of the first data octet
    // in the respective segment (except if SYN is set; then the the
    // seq. number is the initial seq. number (ISS) and the first data
    // octet is ISS + 1)
    uint32_t sequenceNo;
    // Acknowledgement Number: if ACK flag is set, this field contains
    // the next sequence number the sender of this segment is expecting
    // to receive
    uint32_t ackNo;
    // TCP Header Length including options
    B headerLength = TCP_MIN_HEADER_LENGTH;
    bool cwrBit; // CWR: congestion window reduced bit (RFC 3168)
    bool eceBit; // ECE: ECN-echo bit (RFC 3168)
    bool urgBit; // URG: urgent pointer field significant if set
    bool ackBit; // ACK: ackNo significant if set
    bool pshBit; // PSH: push function
    bool rstBit; // RST: reset the connection
    bool synBit; // SYN: synchronize seq. numbers
    bool finBit; // FIN: finish - no more data from sender
    // Window Size: the number of data octets beginning with the one indicated
    // in the acknowledgement field which the sender of this segment is
    // willing to accept
    uint16_t window;
    // Urgent Pointer: communicates the current value of the urgent pointer
    // as a positive offset from the sequence number in this segment. The
    // urgent pointer points to the sequence number of the octet following
    // the urgent data. This field is only be interpreted in segments with
    // the URG control bit set.
    uint16_t urgentPointer;
    uint16_t crc = 0;
    CrcMode crcMode = CRC_MODE_UNDEFINED;
    // Header options (optional)
    // Currently only EOL, NOP, MSS, WS, SACK_PERMITTED, SACK and TS are implemented
    TcpOption *headerOption[] @owned;
}

Constructor & Destructor Documentation

◆ TcpHeader() [1/2]

inet::tcp::TcpHeader::TcpHeader ( )

◆ TcpHeader() [2/2]

inet::tcp::TcpHeader::TcpHeader ( const TcpHeader other)

◆ ~TcpHeader()

virtual inet::tcp::TcpHeader::~TcpHeader ( )
virtual

Member Function Documentation

◆ appendHeaderOption()

virtual void inet::tcp::TcpHeader::appendHeaderOption ( TcpOption headerOption)
virtual

◆ copy()

void inet::tcp::TcpHeader::copy ( const TcpHeader other)
private

◆ dropHeaderOption()

TcpOption* inet::tcp::TcpHeader::dropHeaderOption ( size_t  k)
inline
729 {return removeHeaderOption(k);}

◆ dropHeaderOptions()

void inet::tcp::TcpHeader::dropHeaderOptions ( )
virtual

Drops all TCP options of the TCP segment.

◆ dup()

virtual TcpHeader* inet::tcp::TcpHeader::dup ( ) const
inlineoverridevirtual

Reimplemented from inet::TransportHeaderBase.

668 {return new TcpHeader(*this);}

◆ eraseHeaderOption()

virtual void inet::tcp::TcpHeader::eraseHeaderOption ( size_t  k)
virtual

◆ getAckBit()

virtual bool inet::tcp::TcpHeader::getAckBit ( ) const
virtual

◆ getAckNo()

virtual uint32_t inet::tcp::TcpHeader::getAckNo ( ) const
virtual

◆ getCrc()

virtual uint16_t inet::tcp::TcpHeader::getCrc ( ) const
virtual

◆ getCrcMode()

virtual ::inet::CrcMode inet::tcp::TcpHeader::getCrcMode ( ) const

◆ getCwrBit()

virtual bool inet::tcp::TcpHeader::getCwrBit ( ) const
virtual

Referenced by str().

◆ getDestinationPort()

virtual unsigned int inet::tcp::TcpHeader::getDestinationPort ( ) const
inlineoverridevirtual

Implements inet::TransportHeaderBase.

754 { return getDestPort(); }

◆ getDestPort()

virtual unsigned short inet::tcp::TcpHeader::getDestPort ( ) const
virtual

Referenced by str().

◆ getEceBit()

virtual bool inet::tcp::TcpHeader::getEceBit ( ) const
virtual

Referenced by str().

◆ getFinBit()

virtual bool inet::tcp::TcpHeader::getFinBit ( ) const
virtual

Referenced by str().

◆ getHeaderLength()

virtual ::inet::B inet::tcp::TcpHeader::getHeaderLength ( ) const

◆ getHeaderOption()

virtual const TcpOption* inet::tcp::TcpHeader::getHeaderOption ( size_t  k) const
virtual

◆ getHeaderOptionArrayLength()

B inet::tcp::TcpHeader::getHeaderOptionArrayLength ( )
virtual

Calculate Length of TCP Options Array in bytes.

46 {
47  unsigned short usedLength = 0;
48 
49  for (uint i = 0; i < getHeaderOptionArraySize(); i++)
50  usedLength += getHeaderOption(i)->getLength();
51 
52  return B(usedLength);
53 }

◆ getHeaderOptionArraySize()

virtual size_t inet::tcp::TcpHeader::getHeaderOptionArraySize ( ) const
virtual

◆ getHeaderOptionForUpdate()

virtual TcpOption* inet::tcp::TcpHeader::getHeaderOptionForUpdate ( size_t  k)
inlinevirtual
726 { handleChange();return const_cast<TcpOption *>(const_cast<TcpHeader*>(this)->getHeaderOption(k));}

◆ getPshBit()

virtual bool inet::tcp::TcpHeader::getPshBit ( ) const
virtual

Referenced by str().

◆ getRstBit()

virtual bool inet::tcp::TcpHeader::getRstBit ( ) const
virtual

Referenced by str().

◆ getSequenceNo()

virtual uint32_t inet::tcp::TcpHeader::getSequenceNo ( ) const
virtual

◆ getSourcePort()

virtual unsigned int inet::tcp::TcpHeader::getSourcePort ( ) const
inlineoverridevirtual

◆ getSrcPort()

virtual unsigned short inet::tcp::TcpHeader::getSrcPort ( ) const
virtual

Referenced by str().

◆ getSynBit()

virtual bool inet::tcp::TcpHeader::getSynBit ( ) const
virtual

Referenced by str().

◆ getSynFinLen()

uint32_t inet::tcp::TcpHeader::getSynFinLen ( ) const
inline

Returns RFC 793 specified SEG.LEN: SEG.LEN = the number of octets occupied by the data in the segment (counting SYN and FIN)

743 { return (finBit ? 1 : 0) + (synBit ? 1 : 0); }

◆ getUrgBit()

virtual bool inet::tcp::TcpHeader::getUrgBit ( ) const
virtual

Referenced by str().

◆ getUrgentPointer()

virtual uint16_t inet::tcp::TcpHeader::getUrgentPointer ( ) const
virtual

Referenced by str().

◆ getWindow()

virtual uint16_t inet::tcp::TcpHeader::getWindow ( ) const
virtual

◆ insertHeaderOption() [1/2]

virtual void inet::tcp::TcpHeader::insertHeaderOption ( size_t  k,
TcpOption headerOption 
)
virtual

◆ insertHeaderOption() [2/2]

void inet::tcp::TcpHeader::insertHeaderOption ( TcpOption headerOption)
inline

◆ operator=()

TcpHeader& inet::tcp::TcpHeader::operator= ( const TcpHeader other)

◆ operator==()

bool inet::tcp::TcpHeader::operator== ( const TcpHeader )
protecteddelete

◆ parsimPack()

virtual void inet::tcp::TcpHeader::parsimPack ( omnetpp::cCommBuffer *  b) const
overridevirtual

◆ parsimUnpack()

virtual void inet::tcp::TcpHeader::parsimUnpack ( omnetpp::cCommBuffer *  b)
overridevirtual

◆ removeHeaderOption()

virtual TcpOption* inet::tcp::TcpHeader::removeHeaderOption ( size_t  k)
virtual

◆ setAckBit()

virtual void inet::tcp::TcpHeader::setAckBit ( bool  ackBit)
virtual

◆ setAckNo()

virtual void inet::tcp::TcpHeader::setAckNo ( uint32_t  ackNo)
virtual

◆ setCrc()

virtual void inet::tcp::TcpHeader::setCrc ( uint16_t  crc)
virtual

◆ setCrcMode()

virtual void inet::tcp::TcpHeader::setCrcMode ( ::inet::CrcMode  crcMode)
virtual

◆ setCwrBit()

virtual void inet::tcp::TcpHeader::setCwrBit ( bool  cwrBit)
virtual

◆ setDestinationPort()

virtual void inet::tcp::TcpHeader::setDestinationPort ( unsigned int  port)
inlineoverridevirtual

Implements inet::TransportHeaderBase.

755 { setDestPort(port); }

◆ setDestPort()

virtual void inet::tcp::TcpHeader::setDestPort ( unsigned short  destPort)
virtual

◆ setEceBit()

virtual void inet::tcp::TcpHeader::setEceBit ( bool  eceBit)
virtual

◆ setFinBit()

virtual void inet::tcp::TcpHeader::setFinBit ( bool  finBit)
virtual

◆ setHeaderLength()

virtual void inet::tcp::TcpHeader::setHeaderLength ( ::inet::B  headerLength)
virtual

Referenced by dropHeaderOptions().

◆ setHeaderOption()

virtual void inet::tcp::TcpHeader::setHeaderOption ( size_t  k,
TcpOption headerOption 
)
virtual

◆ setHeaderOptionArraySize()

virtual void inet::tcp::TcpHeader::setHeaderOptionArraySize ( size_t  size)
virtual

Referenced by dropHeaderOptions().

◆ setPshBit()

virtual void inet::tcp::TcpHeader::setPshBit ( bool  pshBit)
virtual

◆ setRstBit()

virtual void inet::tcp::TcpHeader::setRstBit ( bool  rstBit)
virtual

◆ setSequenceNo()

virtual void inet::tcp::TcpHeader::setSequenceNo ( uint32_t  sequenceNo)
virtual

◆ setSourcePort()

virtual void inet::tcp::TcpHeader::setSourcePort ( unsigned int  port)
inlineoverridevirtual

Implements inet::TransportHeaderBase.

753 { setSrcPort(port); }

◆ setSrcPort()

virtual void inet::tcp::TcpHeader::setSrcPort ( unsigned short  srcPort)
virtual

◆ setSynBit()

virtual void inet::tcp::TcpHeader::setSynBit ( bool  synBit)
virtual

◆ setUrgBit()

virtual void inet::tcp::TcpHeader::setUrgBit ( bool  urgBit)
virtual

◆ setUrgentPointer()

virtual void inet::tcp::TcpHeader::setUrgentPointer ( uint16_t  urgentPointer)
virtual

◆ setWindow()

virtual void inet::tcp::TcpHeader::setWindow ( uint16_t  window)
virtual

◆ str()

std::string inet::tcp::TcpHeader::str ( ) const
overridevirtual

Returns a human readable string representation of the data present in this chunk.

Reimplemented from inet::Chunk.

63 {
64  std::ostringstream stream;
65  static const char *flagStart = " [";
66  static const char *flagSepar = " ";
67  static const char *flagEnd = "]";
68  stream << getSrcPort() << "->" << getDestPort();
69  const char *separ = flagStart;
70  if (getCwrBit()) {
71  stream << separ << "Cwr";
72  separ = flagSepar;
73  }
74  if (getEceBit()) {
75  stream << separ << "Ece";
76  separ = flagSepar;
77  }
78  if (getUrgBit()) {
79  stream << separ << "Urg=" << getUrgentPointer();
80  separ = flagSepar;
81  }
82  if (getSynBit()) {
83  stream << separ << "Syn";
84  separ = flagSepar;
85  }
86  if (getAckBit()) {
87  stream << separ << "Ack=" << getAckNo();
88  separ = flagSepar;
89  }
90  if (getPshBit()) {
91  stream << separ << "Psh";
92  separ = flagSepar;
93  }
94  if (getRstBit()) {
95  stream << separ << "Rst";
96  separ = flagSepar;
97  }
98  if (getFinBit()) {
99  stream << separ << "Fin";
100  separ = flagSepar;
101  }
102  if (separ == flagSepar)
103  stream << flagEnd;
104 
105  stream << " Seq=" << getSequenceNo()
106  << " Win=" << getWindow()
107  << ", length = " << getChunkLength();
108 
109  // TODO show TCP Options
110 
111  return stream.str();
112 }

Member Data Documentation

◆ ackBit

bool inet::tcp::TcpHeader::ackBit = false
protected

◆ ackNo

uint32_t inet::tcp::TcpHeader::ackNo = 0
protected

◆ crc

uint16_t inet::tcp::TcpHeader::crc = 0
protected

◆ crcMode

::inet::CrcMode inet::tcp::TcpHeader::crcMode = CRC_MODE_UNDEFINED
protected

◆ cwrBit

bool inet::tcp::TcpHeader::cwrBit = false
protected

◆ destPort

unsigned short inet::tcp::TcpHeader::destPort = 0
protected

◆ eceBit

bool inet::tcp::TcpHeader::eceBit = false
protected

◆ finBit

bool inet::tcp::TcpHeader::finBit = false
protected

◆ headerLength

::inet::B inet::tcp::TcpHeader::headerLength = TCP_MIN_HEADER_LENGTH
protected

◆ headerOption

TcpOption* * inet::tcp::TcpHeader::headerOption = nullptr
protected

◆ headerOption_arraysize

size_t inet::tcp::TcpHeader::headerOption_arraysize = 0
protected

◆ pshBit

bool inet::tcp::TcpHeader::pshBit = false
protected

◆ rstBit

bool inet::tcp::TcpHeader::rstBit = false
protected

◆ sequenceNo

uint32_t inet::tcp::TcpHeader::sequenceNo = 0
protected

◆ srcPort

unsigned short inet::tcp::TcpHeader::srcPort = 0
protected

◆ synBit

bool inet::tcp::TcpHeader::synBit = false
protected

◆ urgBit

bool inet::tcp::TcpHeader::urgBit = false
protected

◆ urgentPointer

uint16_t inet::tcp::TcpHeader::urgentPointer = 0
protected

◆ window

uint16_t inet::tcp::TcpHeader::window = 0
protected

The documentation for this class was generated from the following files:
inet::tcp::TcpHeader::getAckBit
virtual bool getAckBit() const
inet::tcp::TcpHeader::setDestPort
virtual void setDestPort(unsigned short destPort)
inet::tcp::TcpHeader::TcpHeader
TcpHeader()
inet::tcp::TcpHeader::removeHeaderOption
virtual TcpOption * removeHeaderOption(size_t k)
inet::tcp::TcpHeader::setHeaderLength
virtual void setHeaderLength(::inet::B headerLength)
inet::FieldsChunk::handleChange
virtual void handleChange() override
Definition: FieldsChunk.cc:50
inet::tcp::TcpHeader::getRstBit
virtual bool getRstBit() const
inet::tcp::TcpHeader::getFinBit
virtual bool getFinBit() const
inet::tcp::TcpHeader::synBit
bool synBit
Definition: TcpHeader_m.h:648
inet::tcp::TcpHeader::getSequenceNo
virtual uint32_t getSequenceNo() const
inet::tcp::TcpHeader::getSrcPort
virtual unsigned short getSrcPort() const
inet::tcp::TcpHeader::getHeaderOptionArraySize
virtual size_t getHeaderOptionArraySize() const
inet::tcp::TcpHeader::getSynBit
virtual bool getSynBit() const
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::tcp::TcpHeader::headerOption
TcpOption ** headerOption
Definition: TcpHeader_m.h:654
inet::tcp::TcpHeader::setHeaderOptionArraySize
virtual void setHeaderOptionArraySize(size_t size)
inet::tcp::TcpOption::getLength
virtual unsigned short getLength() const
inet::FieldsChunk::setChunkLength
virtual void setChunkLength(b chunkLength)
Definition: FieldsChunk.h:68
inet::tcp::TcpHeader::getCwrBit
virtual bool getCwrBit() const
inet::tcp::TcpHeader::getHeaderOption
virtual const TcpOption * getHeaderOption(size_t k) const
inet::FieldsChunk::getChunkLength
virtual b getChunkLength() const override
Returns the length of data represented by this chunk.
Definition: FieldsChunk.h:67
inet::tcp::TcpHeader::getUrgentPointer
virtual uint16_t getUrgentPointer() const
inet::tcp::TcpHeader::getDestPort
virtual unsigned short getDestPort() const
inet::tcp::TcpHeader::appendHeaderOption
virtual void appendHeaderOption(TcpOption *headerOption)
inet::physicallayer::k
const double k
Definition: Qam1024Modulation.cc:14
inet::tcp::TcpHeader::getUrgBit
virtual bool getUrgBit() const
inet::tcp::TcpHeader::getWindow
virtual uint16_t getWindow() const
inet::tcp::TcpHeader::getAckNo
virtual uint32_t getAckNo() const
inet::tcp::TcpHeader::finBit
bool finBit
Definition: TcpHeader_m.h:649
inet::tcp::TcpHeader::setSrcPort
virtual void setSrcPort(unsigned short srcPort)
inet::uint
unsigned int uint
Definition: INETDefs.h:55
inet::tcp::TcpHeader::getPshBit
virtual bool getPshBit() const
inet::tcp::TCP_MIN_HEADER_LENGTH
const B TCP_MIN_HEADER_LENGTH
Definition: TcpHeader_m.h:63
inet::tcp::TcpHeader::getEceBit
virtual bool getEceBit() const