INET Framework for OMNeT++/OMNEST
|
Represents a TCP segment. More...
#include <TCPSegment.h>
Public Member Functions | |
TCPSegment (const char *name=nullptr, int kind=0) | |
TCPSegment (const TCPSegment &other) | |
~TCPSegment () | |
TCPSegment & | operator= (const TCPSegment &other) |
virtual TCPSegment * | dup () const override |
virtual void | parsimPack (cCommBuffer *b) const override |
virtual void | parsimUnpack (cCommBuffer *b) override |
virtual void | setPayloadArraySize (unsigned int size) override |
Generated but unused method, should not be called. More... | |
virtual void | setPayload (unsigned int k, const TCPPayloadMessage &payload_var) override |
Generated but unused method, should not be called. More... | |
virtual unsigned int | getPayloadArraySize () const override |
Returns the number of payload messages in this TCP segment. More... | |
virtual TCPPayloadMessage & | getPayload (unsigned int k) override |
Returns the kth payload message in this TCP segment. More... | |
virtual void | addPayloadMessage (cPacket *msg, uint32 endSequenceNo) |
Adds a message object to the TCP segment. More... | |
virtual cPacket * | removeFirstPayloadMessage (uint32 &outEndSequenceNo) |
Removes and returns the first message object in this TCP segment. More... | |
virtual uint32_t | getSegLen () |
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 void | truncateSegment (uint32 firstSeqNo, uint32 endSeqNo) |
Truncate segment. More... | |
virtual unsigned short | getHeaderOptionArrayLength () |
Calculate Length of TCP Options Array in bytes. More... | |
virtual void | setHeaderOptionArraySize (unsigned int size) override |
Generated but unused method, should not be called. More... | |
virtual unsigned int | getHeaderOptionArraySize () const override |
Returns the number of TCP options in this TCP segment. More... | |
virtual TCPOptionPtr & | getHeaderOption (unsigned int k) override |
Returns the kth TCP options in this TCP segment. More... | |
virtual const TCPOptionPtr & | getHeaderOption (unsigned int k) const override |
virtual void | setHeaderOption (unsigned int k, const TCPOptionPtr &headerOption) override |
Generated but unused method, should not be called. More... | |
virtual void | addHeaderOption (TCPOption *headerOption) |
Adds a TCP option to the TCP segment. 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 |
Public Member Functions inherited from inet::tcp::TCPSegment_Base | |
virtual | ~TCPSegment_Base () |
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 unsigned int | getSequenceNo () const |
virtual void | setSequenceNo (unsigned int sequenceNo) |
virtual unsigned int | getAckNo () const |
virtual void | setAckNo (unsigned int ackNo) |
virtual unsigned short | getHeaderLength () const |
virtual void | setHeaderLength (unsigned short headerLength) |
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 unsigned short | getWindow () const |
virtual void | setWindow (unsigned short window) |
virtual unsigned short | getUrgentPointer () const |
virtual void | setUrgentPointer (unsigned short urgentPointer) |
virtual unsigned long | getPayloadLength () const |
virtual void | setPayloadLength (unsigned long payloadLength) |
virtual const TCPPayloadMessage & | getPayload (unsigned int k) const |
virtual ByteArray & | getByteArray () |
virtual const ByteArray & | getByteArray () const |
virtual void | setByteArray (const ByteArray &byteArray) |
Public Member Functions inherited from inet::ITransportPacket | |
virtual | ~ITransportPacket () |
Protected Types | |
typedef std::list< TCPPayloadMessage > | PayloadList |
typedef std::vector< TCPOption * > | OptionList |
Protected Member Functions | |
virtual void | truncateData (unsigned int truncleft, unsigned int truncright) |
Truncate segment data. More... | |
Protected Member Functions inherited from inet::tcp::TCPSegment_Base | |
bool | operator== (const TCPSegment_Base &) |
TCPSegment_Base (const char *name=nullptr, short kind=0) | |
TCPSegment_Base (const TCPSegment_Base &other) | |
TCPSegment_Base & | operator= (const TCPSegment_Base &other) |
Protected Attributes | |
PayloadList | payloadList |
OptionList | headerOptionList |
Protected Attributes inherited from inet::tcp::TCPSegment_Base | |
unsigned short | srcPort |
unsigned short | destPort |
unsigned int | sequenceNo |
unsigned int | ackNo |
unsigned short | headerLength |
bool | urgBit |
bool | ackBit |
bool | pshBit |
bool | rstBit |
bool | synBit |
bool | finBit |
unsigned short | window |
unsigned short | urgentPointer |
unsigned long | payloadLength |
ByteArray | byteArray |
Private Member Functions | |
void | copy (const TCPSegment &other) |
void | clean () |
Represents a TCP segment.
More info in the TCPSegment.msg file (and the documentation generated from it).
|
protected |
|
protected |
|
inline |
|
inline |
inet::tcp::TCPSegment::~TCPSegment | ( | ) |
|
virtual |
Adds a TCP option to the TCP segment.
Referenced by inet::tcp::TCPConnection::addSacks(), PacketDrill::buildTCPPacket(), inet::serializer::TCPSerializer::deserialize(), inet::tcp::TCPConnection::sendSegment(), and inet::tcp::TCPConnection::writeHeaderOptions().
|
virtual |
Adds a message object to the TCP segment.
The sequence number + 1 of the last byte of the message should be passed as 2nd argument
Referenced by inet::tcp::TCPMsgBasedSendQueue::createSegmentWithBytes(), and inet::tcp::TcpLwipMsgBasedSendQueue::createSegmentWithBytes().
|
private |
|
private |
|
virtual |
Drops all TCP options of the TCP segment.
Referenced by inet::tcp::TCPConnection::writeHeaderOptions().
|
inlineoverridevirtual |
Reimplemented from inet::tcp::TCPSegment_Base.
|
inlineoverridevirtual |
Implements inet::ITransportPacket.
Referenced by inet::ExampleQoSClassifier::getUserPriority().
|
overridevirtual |
Returns the kth TCP options in this TCP segment.
Implements inet::tcp::TCPSegment_Base.
Referenced by inet::PacketDrillApp::compareTcpPacket(), inet::tcp::TCPConnection::getTSecr(), inet::tcp::TCPConnection::getTSval(), inet::tcp::TCP_NSC::handleIpInputMessage(), inet::tcp::TCPConnection::printSegmentBrief(), inet::tcp::TCPConnection::readHeaderOptions(), inet::PacketDrillApp::runEvent(), inet::tcp::TCPConnection::sendSegment(), and inet::PacketDump::tcpDump().
|
inlineoverridevirtual |
Reimplemented from inet::tcp::TCPSegment_Base.
Referenced by getHeaderOption().
|
virtual |
Calculate Length of TCP Options Array in bytes.
Referenced by inet::tcp::TCPConnection::addSacks(), and inet::tcp::TCPConnection::writeHeaderOptions().
|
overridevirtual |
Returns the number of TCP options in this TCP segment.
Implements inet::tcp::TCPSegment_Base.
Referenced by inet::tcp::TCPConnection::addSacks(), inet::PacketDrillApp::compareTcpPacket(), inet::tcp::TCPConnection::getTSecr(), inet::tcp::TCPConnection::getTSval(), inet::tcp::TCP_NSC::handleIpInputMessage(), inet::tcp::TCPConnection::printSegmentBrief(), inet::tcp::TCPConnection::readHeaderOptions(), inet::PacketDrillApp::runEvent(), inet::tcp::TCPConnection::sendSegment(), inet::PacketDump::tcpDump(), and inet::tcp::TCPConnection::writeHeaderOptions().
|
overridevirtual |
|
overridevirtual |
Returns the number of payload messages in this TCP segment.
Implements inet::tcp::TCPSegment_Base.
Referenced by inet::tcp::TCPMsgBasedSendQueue::createSegmentWithBytes(), and inet::tcp::TcpLwipMsgBasedSendQueue::createSegmentWithBytes().
|
virtual |
Returns RFC 793 specified SEG.LEN: SEG.LEN = the number of octets occupied by the data in the segment (counting SYN and FIN)
Referenced by inet::tcp::TCPConnection::segmentArrivalWhileClosed().
|
inlineoverridevirtual |
Implements inet::ITransportPacket.
Referenced by inet::ExampleQoSClassifier::getUserPriority().
TCPSegment & inet::tcp::TCPSegment::operator= | ( | const TCPSegment & | other | ) |
|
overridevirtual |
|
overridevirtual |
|
virtual |
Removes and returns the first message object in this TCP segment.
It also returns the sequence number + 1 of its last octet in outEndSequenceNo.
Referenced by inet::tcp::TCPMsgBasedRcvQueue::insertBytesFromSegment(), and inet::tcp::TcpLwipMsgBasedReceiveQueue::notifyAboutIncomingSegmentProcessing().
|
inlineoverridevirtual |
Implements inet::ITransportPacket.
|
overridevirtual |
Generated but unused method, should not be called.
Implements inet::tcp::TCPSegment_Base.
Referenced by inet::PacketDrillApp::runEvent().
|
overridevirtual |
Generated but unused method, should not be called.
Implements inet::tcp::TCPSegment_Base.
|
overridevirtual |
Generated but unused method, should not be called.
Implements inet::tcp::TCPSegment_Base.
|
overridevirtual |
Generated but unused method, should not be called.
Implements inet::tcp::TCPSegment_Base.
|
inlineoverridevirtual |
Implements inet::ITransportPacket.
|
protectedvirtual |
Truncate segment data.
Called from truncateSegment().
truncleft | number of bytes for truncate from begin of data |
truncright | number of bytes for truncate from end of data |
Truncate segment.
firstSeqNo | sequence no of new first byte |
endSeqNo | sequence no of new last byte + 1 |
Referenced by inet::tcp::TCPConnection::processSegment1stThru8th().
|
protected |
Referenced by copy().
|
protected |
Referenced by copy().