INET Framework for OMNeT++/OMNEST
|
Class generated from inet/networklayer/contract/ipv4/IPv4ControlInfo.msg:63
by nedtool.
More...
#include <IPv4ControlInfo_m.h>
Public Member Functions | |
virtual | ~IPv4ControlInfo_Base () |
virtual IPv4ControlInfo_Base * | dup () const override |
virtual void | parsimPack (omnetpp::cCommBuffer *b) const override |
virtual void | parsimUnpack (omnetpp::cCommBuffer *b) override |
virtual IPv4Address & | getDestAddr () |
virtual const IPv4Address & | getDestAddr () const |
virtual void | setDestAddr (const IPv4Address &destAddr) |
virtual IPv4Address & | getSrcAddr () |
virtual const IPv4Address & | getSrcAddr () const |
virtual void | setSrcAddr (const IPv4Address &srcAddr) |
virtual int | getInterfaceId () const |
virtual void | setInterfaceId (int interfaceId) |
virtual bool | getMulticastLoop () const |
virtual void | setMulticastLoop (bool multicastLoop) |
virtual short | getProtocol () const |
virtual void | setProtocol (short protocol) |
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 short | getTimeToLive () const |
virtual void | setTimeToLive (short timeToLive) |
virtual bool | getDontFragment () const |
virtual void | setDontFragment (bool dontFragment) |
Protected Member Functions | |
bool | operator== (const IPv4ControlInfo_Base &) |
IPv4ControlInfo_Base () | |
IPv4ControlInfo_Base (const IPv4ControlInfo_Base &other) | |
IPv4ControlInfo_Base & | operator= (const IPv4ControlInfo_Base &other) |
Protected Attributes | |
IPv4Address | destAddr |
IPv4Address | srcAddr |
int | interfaceId |
bool | multicastLoop |
short | protocol |
unsigned char | typeOfService |
short | timeToLive |
bool | dontFragment |
Private Member Functions | |
void | copy (const IPv4ControlInfo_Base &other) |
Class generated from inet/networklayer/contract/ipv4/IPv4ControlInfo.msg:63
by nedtool.
// // Control information for sending/receiving packets over IPv4. // // To send a packet over IPv4, fill in an ~IPv4ControlInfo object, // attach it to the packet with the C++ method setControlInfo(), // the send it to the ~IPv4 module. // // When sending, the following fields are required: // - protocol: a value from ~IPProtocolId // - destAddr // // Optional fields: // - srcAddr: it will be set to the address of the outgoing interface // - typeOfService: (default: 0) // - timeToLive: default defined as module parameter // - dontFragment: default: false // // Not supported: // - options: IPv4 Options currently not used // - Identifier is currently always chosen by the IPv4 layer // // When ~IPv4 delivers a packet to higher layers, it also attaches an ~IPv4ControlInfo // to it. It fills in the following fields: // - srcAddr, destAddr, protocol, TypeOfService: values from the original datagram // - interfaceId: the interface on which the datagram arrived, or -1 if it was // created locally // // ~IPv4 also puts the original datagram object into the control info, because // it may be needed by higher layers (for example, by ~ICMP for error reporting). // class IPv4ControlInfo { @customize(true); IPv4Address destAddr; // destination IPv4 address IPv4Address srcAddr; // source IPv4 address int interfaceId = -1; // interface on which the datagram was received, or // should be sent (see ~InterfaceTable) bool multicastLoop; // if true, sent multicast datagrams will be looped back short protocol @enum(IPProtocolId); // encapsulated protocol unsigned char typeOfService; // Type of Service byte (low 6 bits: DSCP) abstract int diffServCodePoint; // maps to bits 0-5 of trafficClass abstract int explicitCongestionNotification; // maps to bits 6-7 of trafficClass short timeToLive; // maximum hop count bool dontFragment; // "don't fragment" bit }
IPv4ControlInfo_Base is only useful if it gets subclassed, and IPv4ControlInfo is derived from it. The minimum code to be written for IPv4ControlInfo is the following:
class INET_API IPv4ControlInfo : public IPv4ControlInfo_Base { private: void copy(const IPv4ControlInfo& other) { ... }
public: IPv4ControlInfo() : IPv4ControlInfo_Base() {} IPv4ControlInfo(const IPv4ControlInfo& other) : IPv4ControlInfo_Base(other) {copy(other);} IPv4ControlInfo& operator=(const IPv4ControlInfo& other) {if (this==&other) return *this; IPv4ControlInfo_Base::operator=(other); copy(other); return *this;} virtual IPv4ControlInfo *dup() const override {return new IPv4ControlInfo(*this);} // ADD CODE HERE to redefine and implement pure virtual functions from IPv4ControlInfo_Base };
The following should go into a .cc (.cpp) file:
Register_Class(IPv4ControlInfo)
|
protected |
|
protected |
|
virtual |
|
private |
|
inlineoverridevirtual |
Reimplemented in inet::IPv4ControlInfo.
|
virtual |
|
inlinevirtual |
Referenced by getDestAddr().
|
pure virtual |
Implemented in inet::IPv4ControlInfo.
|
virtual |
Referenced by inet::IPv4::encapsulate().
|
pure virtual |
Implemented in inet::IPv4ControlInfo.
|
virtual |
Reimplemented in inet::IPv4ControlInfo.
Referenced by inet::IPv4ControlInfo::getInterfaceId().
|
virtual |
Referenced by inet::IPv4::datagramLocalOut().
|
virtual |
Referenced by inet::IPv4::encapsulate(), and inet::IPv4ControlInfo::getTransportProtocol().
|
virtual |
Referenced by inet::IPv4::encapsulate(), inet::LinkStateRouting::handleMessage(), inet::PIMDM::processAssertPacket(), inet::PIMSM::processAssertPacket(), inet::ICMP::processEchoRequest(), inet::PIMDM::processGraftPacket(), inet::RSVP::processHelloMsg(), inet::PIMBase::processHelloPacket(), inet::IGMPv2::processIgmpMessage(), inet::ospf::MessageHandler::processPacket(), inet::IGMPv3::processQuery(), inet::PIMSM::processRegisterPacket(), inet::PIMDM::processStateRefreshPacket(), inet::UDP::processUDPPacket(), and inet::PIMDM::sendGraftAckPacket().
|
inlinevirtual |
Referenced by getSrcAddr().
|
virtual |
Referenced by inet::IPv4::encapsulate(), and inet::UDP::processUDPPacket().
|
virtual |
Referenced by inet::IPv4::encapsulate(), and inet::UDP::processUDPPacket().
|
protected |
Referenced by inet::IPv4ControlInfo::operator=().
|
protected |
|
overridevirtual |
|
overridevirtual |
|
virtual |
Referenced by inet::IPv4::decapsulate(), inet::PIMSM::forwardMulticastData(), inet::ICMP::processEchoRequest(), inet::UDP::sendDown(), inet::PIMBase::sendHelloPacket(), inet::ospf::MessageHandler::sendPacket(), inet::ICMP::sendToIP(), inet::LinkStateRouting::sendToIP(), inet::PIMDM::sendToIP(), inet::RSVP::sendToIP(), and inet::PIMSM::sendToIP().
|
pure virtual |
Implemented in inet::IPv4ControlInfo.
|
virtual |
|
pure virtual |
Implemented in inet::IPv4ControlInfo.
|
virtual |
Reimplemented in inet::IPv4ControlInfo.
Referenced by inet::IPv4ControlInfo::setInterfaceId().
|
virtual |
Referenced by inet::UDP::sendDown().
|
virtual |
Referenced by inet::IPv4::decapsulate(), inet::PIMSM::forwardMulticastData(), inet::UDP::sendDown(), inet::ICMP::sendEchoRequest(), inet::ICMP::sendErrorMessage(), inet::PIMBase::sendHelloPacket(), inet::ospf::MessageHandler::sendPacket(), inet::ICMP::sendToIP(), inet::LinkStateRouting::sendToIP(), inet::PIMDM::sendToIP(), inet::RSVP::sendToIP(), inet::PIMSM::sendToIP(), and inet::IPv4ControlInfo::setTransportProtocol().
|
virtual |
|
virtual |
|
virtual |
Referenced by inet::IPv4::decapsulate(), and inet::UDP::sendDown().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |