INET Framework for OMNeT++/OMNEST
|
Class generated from inet/networklayer/ipv4/IPv4Datagram.msg:174
by nedtool.
More...
#include <IPv4Datagram_m.h>
Public Member Functions | |
virtual | ~IPv4Datagram_Base () |
virtual IPv4Datagram_Base * | dup () const override |
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 int | getTransportProtocol () const |
virtual void | setTransportProtocol (int transportProtocol) |
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 int | getTotalLengthField () const |
virtual void | setTotalLengthField (int totalLengthField) |
virtual unsigned char | getTypeOfService () const |
virtual void | setTypeOfService (unsigned char typeOfService) |
virtual int | getDiffServCodePoint () const =0 |
virtual void | setDiffServCodePoint (int diffServCodePoint)=0 |
virtual int | getExplicitCongestionNotification () const =0 |
virtual void | setExplicitCongestionNotification (int explicitCongestionNotification)=0 |
virtual TLVOptions & | getOptions () |
virtual const TLVOptions & | getOptions () const |
virtual void | setOptions (const TLVOptions &options) |
Protected Member Functions | |
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 | |
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 |
Private Member Functions | |
void | copy (const IPv4Datagram_Base &other) |
Class generated from inet/networklayer/ipv4/IPv4Datagram.msg:174
by nedtool.
// // Represents an IPv4 datagram. // // Uses the following cPacket fields: // - getByteLength() / setByteLength() to represent total datagram length // - hasBitError() / setBitError() to represent datagram correctness // - getTimestamp() / setTimestamp (simtime) used in timestamp option // // Additional length fields defined in this class are in bytes. // // Only one of the option fields can exist at a time. // packet IPv4Datagram { @customize(true);
short version = 4; short headerLength = IP_HEADER_BYTES;
IPv4Address srcAddress; IPv4Address destAddress;
int transportProtocol @enum(IPProtocolId) = IP_PROT_NONE; short timeToLive; int identification; bool moreFragments; bool dontFragment; int fragmentOffset; // bytes, must be multiple of 8 int totalLengthField = -1; // -1 means: getTotalLengthField() uses getByteLength() unsigned char typeOfService; // ToS byte abstract int diffServCodePoint; // maps to bits 0-5 of ToS abstract int explicitCongestionNotification; // maps to bits 6-7 of ToS
TLVOptions options; // array of option pointers, option pointers owned by datagram }
IPv4Datagram_Base is only useful if it gets subclassed, and IPv4Datagram is derived from it. The minimum code to be written for IPv4Datagram is the following:
class INET_API IPv4Datagram : public IPv4Datagram_Base { private: void copy(const IPv4Datagram& other) { ... }
public: IPv4Datagram(const char *name=nullptr, short kind=0) : IPv4Datagram_Base(name,kind) {} IPv4Datagram(const IPv4Datagram& other) : IPv4Datagram_Base(other) {copy(other);} IPv4Datagram& operator=(const IPv4Datagram& other) {if (this==&other) return *this; IPv4Datagram_Base::operator=(other); copy(other); return *this;} virtual IPv4Datagram *dup() const override {return new IPv4Datagram(*this);} // ADD CODE HERE to redefine and implement pure virtual functions from IPv4Datagram_Base };
The following should go into a .cc (.cpp) file:
Register_Class(IPv4Datagram)
|
protected |
|
protected |
|
virtual |
|
private |
|
inlineoverridevirtual |
Reimplemented in inet::IPv4Datagram.
|
virtual |
Referenced by inet::IPv4FragBuf::addFragment(), inet::PacketDrillApp::compareDatagram(), inet::sctp::SCTPNatHook::datagramForwardHook(), inet::IPv4::datagramLocalOut(), inet::sctp::SCTPNatHook::datagramPreRoutingHook(), inet::IPv4::decapsulate(), inet::IPv4::determineOutgoingInterfaceForMulticastDatagram(), inet::PacketDump::dumpIPv4(), inet::IPv4::encapsulate(), inet::PIMSM::forwardMulticastData(), inet::IPv4::forwardMulticastPacket(), inet::IPv4::handleIncomingDatagram(), inet::ExtInterface::handleMessage(), inet::SimpleClassifier::lookupLabel(), inet::LDP::lookupLabel(), inet::MultiFieldClassifier::Filter::matches(), inet::PIMSM::multicastPacketForwarded(), inet::IPv4::preroutingFinish(), inet::UDP::processICMPError(), inet::PIMSM::processRegisterPacket(), inet::PIMDM::receiveSignal(), inet::PIMSM::receiveSignal(), inet::IPv4::routeUnicastPacket(), inet::sctp::SCTPNatHook::sendBackError(), inet::IPv4::sendDatagramToOutput(), inet::ICMP::sendErrorMessage(), and inet::serializer::IPv4Serializer::serialize().
|
inlinevirtual |
Referenced by getDestAddress().
|
pure virtual |
Implemented in inet::IPv4Datagram.
|
virtual |
|
pure virtual |
Implemented in inet::IPv4Datagram.
|
virtual |
Referenced by inet::IPv4FragBuf::addFragment(), inet::PacketDrillApp::compareDatagram(), inet::PacketDump::dumpIPv4(), inet::IPv4::fragmentAndSend(), inet::InetPacketPrinter::printMessage(), inet::InetPacketPrinter2::printMessage(), inet::UDP::processICMPError(), inet::IPv4::reassembleAndDeliver(), and inet::serializer::IPv4Serializer::serialize().
|
virtual |
Referenced by inet::IPv4FragBuf::addFragment(), inet::PacketDrillApp::compareDatagram(), inet::IPv4::fragmentAndSend(), inet::IPv4::handleIncomingDatagram(), inet::ICMP::sendErrorMessage(), inet::serializer::IPv4Serializer::serialize(), inet::serializer::IPv4Serializer::serializeOptions(), and inet::GPSR::setGpsrOptionOnNetworkDatagram().
|
virtual |
|
virtual |
|
virtual |
|
inlinevirtual |
Referenced by getOptions().
|
virtual |
Referenced by inet::IPv4FragBuf::addFragment(), inet::PacketDrillApp::compareDatagram(), inet::sctp::SCTPNatHook::datagramForwardHook(), inet::sctp::SCTPNatHook::datagramPreRoutingHook(), inet::IPv4::decapsulate(), inet::IPv4::determineOutgoingInterfaceForMulticastDatagram(), inet::PacketDump::dumpIPv4(), inet::IPv4::forwardMulticastPacket(), inet::IPv4::fragmentAndSend(), inet::IPv4::getShortestPathInterfaceToSource(), inet::ExtInterface::handleMessage(), inet::SimpleClassifier::lookupLabel(), inet::MultiFieldClassifier::Filter::matches(), inet::PIMSM::multicastPacketForwarded(), inet::UDP::processICMPError(), inet::PIMSM::processRegisterPacket(), inet::PIMDM::receiveSignal(), inet::PIMSM::receiveSignal(), inet::sctp::SCTPNatHook::sendBackError(), inet::ICMP::sendErrorMessage(), and inet::serializer::IPv4Serializer::serialize().
|
inlinevirtual |
Referenced by getSrcAddress().
|
virtual |
Referenced by inet::PacketDrillApp::compareDatagram(), inet::IPv4::decapsulate(), inet::IPv4::forwardMulticastPacket(), inet::IPv4::fragmentAndSend(), inet::IPv4::handleIncomingDatagram(), inet::IPv4::preroutingFinish(), inet::PIMDM::receiveSignal(), and inet::serializer::IPv4Serializer::serialize().
|
virtual |
Reimplemented in inet::IPv4Datagram.
|
virtual |
Reimplemented in inet::IPv4Datagram.
Referenced by inet::IPv4Datagram::getTransportProtocol().
|
virtual |
|
virtual |
Referenced by inet::serializer::IPv4Serializer::serialize().
|
protected |
Referenced by inet::IPv4Datagram::operator=().
|
protected |
|
overridevirtual |
|
overridevirtual |
|
virtual |
|
pure virtual |
Implemented in inet::IPv4Datagram.
|
virtual |
Referenced by inet::PacketDrillApp::closeAllSockets(), inet::IPv4::encapsulate(), and PacketDrill::makeIPPacket().
|
pure virtual |
Implemented in inet::IPv4Datagram.
|
virtual |
|
virtual |
|
virtual |
Referenced by inet::PacketDrillApp::closeAllSockets(), inet::IPv4::encapsulate(), and PacketDrill::makeIPPacket().
|
virtual |
|
virtual |
|
virtual |
Referenced by inet::PacketDrillApp::closeAllSockets(), inet::sctp::SCTPNatHook::datagramForwardHook(), inet::sctp::SCTPNatHook::datagramPreRoutingHook(), inet::IPv4::encapsulate(), inet::IPv4::fragmentAndSend(), PacketDrill::makeIPPacket(), inet::sctp::SCTPNatHook::sendBackError(), and inet::PIMSM::sendPIMRegisterNull().
|
virtual |
|
virtual |
Referenced by inet::GPSR::setGpsrOptionOnNetworkDatagram().
|
virtual |
Reimplemented in inet::IPv4Datagram.
Referenced by inet::IPv4Datagram::setTransportProtocol().
|
virtual |
Referenced by inet::PacketDrillApp::closeAllSockets(), inet::IPv4::encapsulate(), and PacketDrill::makeIPPacket().
|
virtual |
Referenced by inet::PacketDrillApp::closeAllSockets(), and PacketDrill::makeIPPacket().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by inet::IPv4Datagram::getTotalLengthField().
|
protected |
|
protected |
|
protected |