INET Framework for OMNeT++/OMNEST
|
Represents an IPv4 datagram. More...
#include <IPv4Datagram.h>
Public Member Functions | |
IPv4Datagram (const char *name=nullptr, int kind=0) | |
IPv4Datagram (const IPv4Datagram &other) | |
IPv4Datagram & | operator= (const IPv4Datagram &other) |
virtual IPv4Datagram * | dup () const override |
int | getTotalLengthField () const override |
getter/setter for totalLength field in datagram if set to -1, then getter returns getByteLength() More... | |
virtual int | getDiffServCodePoint () const override |
Returns bits 0-5 of the Type of Service field, a value in the 0..63 range. More... | |
virtual void | setDiffServCodePoint (int dscp) override |
Sets bits 0-5 of the Type of Service field; expects a value in the 0..63 range. More... | |
virtual int | getExplicitCongestionNotification () const override |
Returns bits 6-7 of the Type of Service field, a value in the range 0..3. More... | |
virtual void | setExplicitCongestionNotification (int ecn) override |
Sets bits 6-7 of the Type of Service; expects a value in the 0..3 range. More... | |
virtual unsigned int | getOptionArraySize () const |
Returns the number of extension headers in this datagram. More... | |
virtual TLVOptionBase & | getOption (unsigned int k) |
Returns the kth extension header in this datagram. More... | |
virtual const TLVOptionBase & | getOption (unsigned int k) const |
virtual TLVOptionBase * | findOptionByType (short int optionType, int index=0) |
Returns the TLVOptionBase of the specified type, or nullptr. More... | |
virtual void | addOption (TLVOptionBase *opt, int atPos=-1) |
Adds an TLVOptionBase to the datagram. More... | |
virtual int | calculateHeaderByteLength () const |
Calculates the length of the IPv6 header plus the extension headers. More... | |
virtual L3Address | getSourceAddress () const override |
virtual void | setSourceAddress (const L3Address &address) override |
virtual L3Address | getDestinationAddress () const override |
virtual void | setDestinationAddress (const L3Address &address) override |
virtual int | getTransportProtocol () const override |
virtual void | setTransportProtocol (int protocol) override |
Public Member Functions inherited from inet::IPv4Datagram_Base | |
virtual | ~IPv4Datagram_Base () |
virtual void | parsimPack (omnetpp::cCommBuffer *b) const override |
virtual void | parsimUnpack (omnetpp::cCommBuffer *b) override |
virtual short | getVersion () const |
virtual void | setVersion (short version) |
virtual short | getHeaderLength () const |
virtual void | setHeaderLength (short headerLength) |
virtual IPv4Address & | getSrcAddress () |
virtual const IPv4Address & | getSrcAddress () const |
virtual void | setSrcAddress (const IPv4Address &srcAddress) |
virtual IPv4Address & | getDestAddress () |
virtual const IPv4Address & | getDestAddress () const |
virtual void | setDestAddress (const IPv4Address &destAddress) |
virtual short | getTimeToLive () const |
virtual void | setTimeToLive (short timeToLive) |
virtual int | getIdentification () const |
virtual void | setIdentification (int identification) |
virtual bool | getMoreFragments () const |
virtual void | setMoreFragments (bool moreFragments) |
virtual bool | getDontFragment () const |
virtual void | setDontFragment (bool dontFragment) |
virtual int | getFragmentOffset () const |
virtual void | setFragmentOffset (int fragmentOffset) |
virtual void | setTotalLengthField (int totalLengthField) |
virtual unsigned char | getTypeOfService () const |
virtual void | setTypeOfService (unsigned char typeOfService) |
virtual TLVOptions & | getOptions () |
virtual const TLVOptions & | getOptions () const |
virtual void | setOptions (const TLVOptions &options) |
Public Member Functions inherited from inet::INetworkDatagram | |
virtual | ~INetworkDatagram () |
Private Member Functions | |
void | copy (const IPv4Datagram &other) |
void | clean () |
Additional Inherited Members | |
Protected Member Functions inherited from inet::IPv4Datagram_Base | |
bool | operator== (const IPv4Datagram_Base &) |
IPv4Datagram_Base (const char *name=nullptr, short kind=0) | |
IPv4Datagram_Base (const IPv4Datagram_Base &other) | |
IPv4Datagram_Base & | operator= (const IPv4Datagram_Base &other) |
Protected Attributes inherited from inet::IPv4Datagram_Base | |
short | version |
short | headerLength |
IPv4Address | srcAddress |
IPv4Address | destAddress |
int | transportProtocol |
short | timeToLive |
int | identification |
bool | moreFragments |
bool | dontFragment |
int | fragmentOffset |
int | totalLengthField |
unsigned char | typeOfService |
TLVOptions | options |
Represents an IPv4 datagram.
More info in the IPv4Datagram.msg file (and the documentation generated from it).
|
inline |
|
inline |
|
virtual |
Adds an TLVOptionBase to the datagram.
default atPos means add to the end.
Referenced by inet::serializer::IPv4Serializer::deserializeOptions(), and inet::GPSR::setGpsrOptionOnNetworkDatagram().
|
virtual |
Calculates the length of the IPv6 header plus the extension headers.
Referenced by inet::GPSR::setGpsrOptionOnNetworkDatagram().
|
private |
|
private |
|
inlineoverridevirtual |
Reimplemented from inet::IPv4Datagram_Base.
Referenced by PacketDrill::buildSCTPPacket(), PacketDrill::buildTCPPacket(), PacketDrill::buildUDPPacket(), inet::IPv4ControlInfo::copy(), inet::IPv4::datagramLocalOut(), inet::IPv4::forwardMulticastPacket(), inet::IPv4::fragmentAndSend(), inet::IPv4::preroutingFinish(), inet::PIMSM::processRegisterPacket(), inet::IPv4::routeLocalBroadcastPacket(), inet::sctp::SCTPNatHook::sendBackError(), and inet::PIMSM::sendPIMRegister().
|
virtual |
Returns the TLVOptionBase of the specified type, or nullptr.
If index is 0, then the first, if 1 then the second option is returned.
Referenced by inet::GPSR::findGpsrOptionInNetworkDatagram().
|
inlineoverridevirtual |
Implements inet::INetworkDatagram.
|
inlineoverridevirtual |
Returns bits 0-5 of the Type of Service field, a value in the 0..63 range.
Implements inet::IPv4Datagram_Base.
Referenced by inet::BehaviorAggregateClassifier::getDscpFromPacket().
|
inlineoverridevirtual |
Returns bits 6-7 of the Type of Service field, a value in the range 0..3.
Implements inet::IPv4Datagram_Base.
|
inlinevirtual |
Returns the kth extension header in this datagram.
Referenced by findOptionByType(), and inet::serializer::IPv4Serializer::serializeOptions().
|
inlinevirtual |
Referenced by getOption().
|
inlinevirtual |
Returns the number of extension headers in this datagram.
Referenced by inet::serializer::IPv4Serializer::serializeOptions().
|
inlineoverridevirtual |
Implements inet::INetworkDatagram.
|
overridevirtual |
getter/setter for totalLength field in datagram if set to -1, then getter returns getByteLength()
Reimplemented from inet::IPv4Datagram_Base.
Referenced by inet::serializer::IPv4Serializer::serialize(), and inet::GPSR::setGpsrOptionOnNetworkDatagram().
|
inlineoverridevirtual |
Implements inet::INetworkDatagram.
Referenced by inet::IPv4FragBuf::addFragment(), inet::PacketDrillApp::compareDatagram(), inet::IPv4::decapsulate(), inet::PIMSM::forwardMulticastData(), inet::IPv4::handleIncomingICMP(), inet::ExtInterface::handleMessage(), inet::SimpleClassifier::lookupLabel(), inet::LDP::lookupLabel(), inet::MultiFieldClassifier::Filter::matches(), inet::IPv4::preroutingFinish(), inet::MPLS::processPacketFromL3(), inet::IPv4::reassembleAndDeliverFinish(), inet::ICMP::sendErrorMessage(), and inet::serializer::IPv4Serializer::serialize().
|
inline |
|
inlineoverridevirtual |
Implements inet::INetworkDatagram.
|
inlineoverridevirtual |
Sets bits 0-5 of the Type of Service field; expects a value in the 0..63 range.
Implements inet::IPv4Datagram_Base.
Referenced by inet::DSCPMarker::markPacket().
|
inlineoverridevirtual |
Sets bits 6-7 of the Type of Service; expects a value in the 0..3 range.
Implements inet::IPv4Datagram_Base.
|
inlineoverridevirtual |
Implements inet::INetworkDatagram.
|
inlineoverridevirtual |
Implements inet::INetworkDatagram.
Referenced by inet::PacketDrillApp::closeAllSockets(), inet::IPv4::encapsulate(), PacketDrill::makeIPPacket(), inet::sctp::SCTPNatHook::sendBackError(), and inet::PIMSM::sendPIMRegisterNull().