INET Framework for OMNeT++/OMNEST
|
Implements the IPv4 protocol. More...
#include <IPv4.h>
Classes | |
class | QueuedDatagramForHook |
Represents an IPv4Datagram, queued by a Hook. More... | |
Public Types | |
typedef std::map< IPv4Address, cPacketQueue > | PendingPackets |
Public Member Functions | |
IPv4 () | |
virtual | ~IPv4 () |
virtual void | registerHook (int priority, IHook *hook) override |
registers a Hook to be executed during datagram processing More... | |
virtual void | unregisterHook (int priority, IHook *hook) override |
unregisters a Hook to be executed during datagram processing More... | |
void | dropQueuedDatagram (const INetworkDatagram *datagram) override |
drop a previously queued datagram More... | |
void | reinjectQueuedDatagram (const INetworkDatagram *datagram) override |
re-injects a previously queued datagram More... | |
void | sendOnTransportOutGateByProtocolId (cPacket *packet, int protocolId) |
send packet on transportOut gate specified by protocolId More... | |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
ILifecycle method. More... | |
virtual void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
cListener method More... | |
Public Member Functions inherited from inet::QueueBase | |
QueueBase () | |
Public Member Functions inherited from inet::AbstractQueue | |
AbstractQueue () | |
virtual | ~AbstractQueue () |
Public Member Functions inherited from inet::INetfilter | |
virtual | ~INetfilter () |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Public Member Functions inherited from inet::INetworkProtocol | |
virtual | ~INetworkProtocol () |
Protected Types | |
typedef std::multimap< int, IHook * > | HookList |
typedef std::list< QueuedDatagramForHook > | DatagramQueueForHooks |
Protected Member Functions | |
virtual const InterfaceEntry * | getSourceInterfaceFrom (cPacket *packet) |
virtual const InterfaceEntry * | getShortestPathInterfaceToSource (IPv4Datagram *datagram) |
virtual void | refreshDisplay () const override |
void | arpResolutionCompleted (IARP::Notification *entry) |
void | arpResolutionTimedOut (IARP::Notification *entry) |
virtual IPv4Datagram * | encapsulate (cPacket *transportPacket, IPv4ControlInfo *controlInfo) |
Encapsulate packet coming from higher layers into IPv4Datagram, using the given control info. More... | |
virtual IPv4Datagram * | createIPv4Datagram (const char *name) |
Creates a blank IPv4 datagram. More... | |
virtual void | handleIncomingDatagram (IPv4Datagram *datagram, const InterfaceEntry *fromIE) |
Handle IPv4Datagram messages arriving from lower layer. More... | |
virtual void | preroutingFinish (IPv4Datagram *datagram, const InterfaceEntry *fromIE, const InterfaceEntry *destIE, IPv4Address nextHopAddr) |
virtual void | handlePacketFromHL (cPacket *packet) |
Handle messages (typically packets to be send in IPv4) from transport or ICMP. More... | |
virtual void | handlePacketFromARP (cPacket *packet) |
TODO. More... | |
virtual void | datagramLocalOut (IPv4Datagram *datagram, const InterfaceEntry *destIE, IPv4Address nextHopAddr) |
Routes and sends datagram received from higher layers. More... | |
virtual void | handleIncomingARPPacket (ARPPacket *packet, const InterfaceEntry *fromIE) |
Handle incoming ARP packets by sending them over to ARP. More... | |
virtual void | handleIncomingICMP (ICMPMessage *packet) |
Handle incoming ICMP messages. More... | |
virtual void | routeUnicastPacket (IPv4Datagram *datagram, const InterfaceEntry *fromIE, const InterfaceEntry *destIE, IPv4Address requestedNextHopAddress) |
Performs unicast routing. More... | |
void | routeUnicastPacketFinish (IPv4Datagram *datagram, const InterfaceEntry *fromIE, const InterfaceEntry *destIE, IPv4Address nextHopAddr) |
virtual void | routeLocalBroadcastPacket (IPv4Datagram *datagram, const InterfaceEntry *destIE) |
Broadcasts the datagram on the specified interface. More... | |
virtual const InterfaceEntry * | determineOutgoingInterfaceForMulticastDatagram (IPv4Datagram *datagram, const InterfaceEntry *multicastIFOption) |
Determines the output interface for the given multicast datagram. More... | |
virtual void | forwardMulticastPacket (IPv4Datagram *datagram, const InterfaceEntry *fromIE) |
Forwards packets to all multicast destinations, using fragmentAndSend(). More... | |
virtual void | reassembleAndDeliver (IPv4Datagram *datagram) |
Perform reassembly of fragmented datagrams, then send them up to the higher layers using sendToHL(). More... | |
virtual void | reassembleAndDeliverFinish (IPv4Datagram *datagram) |
virtual cPacket * | decapsulate (IPv4Datagram *datagram) |
Decapsulate and return encapsulated packet after attaching IPv4ControlInfo. More... | |
virtual void | fragmentPostRouting (IPv4Datagram *datagram, const InterfaceEntry *ie, IPv4Address nextHopAddr) |
Call PostRouting Hook and continue with fragmentAndSend() if accepted. More... | |
virtual void | fragmentAndSend (IPv4Datagram *datagram, const InterfaceEntry *ie, IPv4Address nextHopAddr) |
Fragment packet if needed, then send it to the selected interface using sendDatagramToOutput(). More... | |
virtual void | sendDatagramToOutput (IPv4Datagram *datagram, const InterfaceEntry *ie, IPv4Address nextHopAddr) |
Send datagram on the given interface. More... | |
virtual MACAddress | resolveNextHopMacAddress (cPacket *packet, IPv4Address nextHopAddr, const InterfaceEntry *destIE) |
virtual void | sendPacketToIeee802NIC (cPacket *packet, const InterfaceEntry *ie, const MACAddress &macAddress, int etherType) |
virtual void | sendPacketToNIC (cPacket *packet, const InterfaceEntry *ie) |
virtual int | numInitStages () const override |
virtual void | initialize (int stage) override |
virtual void | handleMessage (cMessage *msg) override |
virtual void | endService (cPacket *packet) override |
Processing of IPv4 datagrams. More... | |
IHook::Result | datagramPreRoutingHook (INetworkDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *&outIE, L3Address &nextHopAddr) |
called before a packet arriving from the network is routed More... | |
IHook::Result | datagramForwardHook (INetworkDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *&outIE, L3Address &nextHopAddr) |
called before a packet arriving from the network is delivered via the network More... | |
IHook::Result | datagramPostRoutingHook (INetworkDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *&outIE, L3Address &nextHopAddr) |
called before a packet is delivered via the network More... | |
IHook::Result | datagramLocalInHook (INetworkDatagram *datagram, const InterfaceEntry *inIE) |
called before a packet arriving from the network is delivered locally More... | |
IHook::Result | datagramLocalOutHook (INetworkDatagram *datagram, const InterfaceEntry *&outIE, L3Address &nextHopAddr) |
called before a packet arriving locally is delivered More... | |
virtual bool | isNodeUp () |
virtual void | stop () |
virtual void | start () |
virtual void | flush () |
Protected Member Functions inherited from inet::QueueBase | |
virtual void | initialize () override |
virtual void | arrival (cPacket *msg) override |
Functions to (re)define behaviour. More... | |
virtual cPacket * | arrivalWhenIdle (cPacket *msg) override |
Called when a message arrives at the module when the queue is empty. More... | |
virtual simtime_t | startService (cPacket *msg) override |
Called when a message starts service, and should return the service time. More... | |
Protected Member Functions inherited from inet::AbstractQueue | |
virtual cPacket * | cancelService () |
If a message is under service, aborts its service and returns the message. More... | |
Protected Attributes | |
IIPv4RoutingTable * | rt = nullptr |
IInterfaceTable * | ift = nullptr |
IARP * | arp = nullptr |
ICMP * | icmp = nullptr |
cGate * | arpInGate = nullptr |
cGate * | arpOutGate = nullptr |
int | transportInGateBaseId = -1 |
int | queueOutGateBaseId = -1 |
int | defaultTimeToLive = -1 |
int | defaultMCTimeToLive = -1 |
simtime_t | fragmentTimeoutTime |
bool | forceBroadcast = false |
bool | useProxyARP = false |
bool | isUp = false |
long | curFragmentId = -1 |
IPv4FragBuf | fragbuf |
simtime_t | lastCheckTime |
ProtocolMapping | mapping |
PendingPackets | pendingPackets |
int | numMulticast = 0 |
int | numLocalDeliver = 0 |
int | numDropped = 0 |
int | numUnroutable = 0 |
int | numForwarded = 0 |
HookList | hooks |
DatagramQueueForHooks | queuedDatagramsForHooks |
Protected Attributes inherited from inet::QueueBase | |
simtime_t | delay |
Protected Attributes inherited from inet::AbstractQueue | |
cPacketQueue | queue |
The queue. More... | |
Implements the IPv4 protocol.
|
protected |
|
protected |
typedef std::map<IPv4Address, cPacketQueue> inet::IPv4::PendingPackets |
inet::IPv4::IPv4 | ( | ) |
|
virtual |
|
protected |
Referenced by receiveSignal().
|
protected |
Referenced by receiveSignal().
|
protectedvirtual |
Creates a blank IPv4 datagram.
Override when subclassing IPv4Datagram is needed
Referenced by encapsulate().
|
protected |
called before a packet arriving from the network is delivered via the network
Referenced by routeUnicastPacket().
|
protected |
called before a packet arriving from the network is delivered locally
Referenced by reassembleAndDeliver().
|
protectedvirtual |
Routes and sends datagram received from higher layers.
Invokes datagramLocalOutHook(), then routePacket().
Referenced by handlePacketFromHL(), and reinjectQueuedDatagram().
|
protected |
called before a packet arriving locally is delivered
Referenced by handlePacketFromHL().
|
protected |
called before a packet is delivered via the network
Referenced by fragmentPostRouting().
|
protected |
called before a packet arriving from the network is routed
Referenced by handleIncomingDatagram().
|
protectedvirtual |
Decapsulate and return encapsulated packet after attaching IPv4ControlInfo.
Referenced by reassembleAndDeliverFinish().
|
protectedvirtual |
Determines the output interface for the given multicast datagram.
Referenced by datagramLocalOut().
|
overridevirtual |
drop a previously queued datagram
Implements inet::INetfilter.
|
protectedvirtual |
Encapsulate packet coming from higher layers into IPv4Datagram, using the given control info.
Override if you subclassed controlInfo and/or want to add options etc to the datagram.
Referenced by handlePacketFromHL().
|
overrideprotectedvirtual |
Processing of IPv4 datagrams.
Called when a datagram reaches the front of the queue.
Implements inet::AbstractQueue.
Referenced by handleMessage().
|
protectedvirtual |
|
protectedvirtual |
Forwards packets to all multicast destinations, using fragmentAndSend().
Referenced by preroutingFinish().
|
protectedvirtual |
Fragment packet if needed, then send it to the selected interface using sendDatagramToOutput().
Referenced by fragmentPostRouting(), and reinjectQueuedDatagram().
|
protectedvirtual |
Call PostRouting Hook and continue with fragmentAndSend() if accepted.
Referenced by datagramLocalOut(), forwardMulticastPacket(), preroutingFinish(), routeLocalBroadcastPacket(), and routeUnicastPacketFinish().
|
protectedvirtual |
Referenced by forwardMulticastPacket().
|
protectedvirtual |
Referenced by decapsulate(), endService(), fragmentPostRouting(), reassembleAndDeliver(), and reassembleAndDeliverFinish().
|
protectedvirtual |
Handle incoming ARP packets by sending them over to ARP.
Referenced by endService().
|
protectedvirtual |
Handle IPv4Datagram messages arriving from lower layer.
Decrements TTL, then invokes routePacket().
Referenced by endService().
|
protectedvirtual |
Handle incoming ICMP messages.
Referenced by reassembleAndDeliverFinish().
|
overrideprotectedvirtual |
Reimplemented from inet::AbstractQueue.
|
overridevirtual |
ILifecycle method.
Implements inet::ILifecycle.
|
protectedvirtual |
TODO.
Referenced by endService().
|
protectedvirtual |
Handle messages (typically packets to be send in IPv4) from transport or ICMP.
Invokes encapsulate(), then routePacket().
Referenced by endService().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by initialize().
|
inlineoverrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleIncomingDatagram(), and reinjectQueuedDatagram().
|
protectedvirtual |
Perform reassembly of fragmented datagrams, then send them up to the higher layers using sendToHL().
Referenced by preroutingFinish().
|
protectedvirtual |
Referenced by reassembleAndDeliver(), and reinjectQueuedDatagram().
|
overridevirtual |
cListener method
|
overrideprotectedvirtual |
|
overridevirtual |
registers a Hook to be executed during datagram processing
Implements inet::INetfilter.
Referenced by inet::CloudDelayerBase::initialize().
|
overridevirtual |
re-injects a previously queued datagram
Implements inet::INetfilter.
Referenced by inet::CloudDelayerBase::handleMessage().
|
protectedvirtual |
Referenced by sendDatagramToOutput().
|
protectedvirtual |
Broadcasts the datagram on the specified interface.
When destIE is nullptr, the datagram is broadcasted on each interface.
Referenced by datagramLocalOut().
|
protectedvirtual |
Performs unicast routing.
Based on the routing decision, it sends the datagram through the outgoing interface.
Referenced by datagramLocalOut(), and preroutingFinish().
|
protected |
Referenced by reinjectQueuedDatagram(), and routeUnicastPacket().
|
protectedvirtual |
Send datagram on the given interface.
Referenced by fragmentAndSend().
void inet::IPv4::sendOnTransportOutGateByProtocolId | ( | cPacket * | packet, |
int | protocolId | ||
) |
send packet on transportOut gate specified by protocolId
|
protectedvirtual |
Referenced by arpResolutionCompleted(), and sendDatagramToOutput().
|
protectedvirtual |
Referenced by handlePacketFromARP(), sendDatagramToOutput(), and sendPacketToIeee802NIC().
|
protectedvirtual |
Referenced by handleOperationStage().
|
protectedvirtual |
Referenced by handleOperationStage().
|
overridevirtual |
unregisters a Hook to be executed during datagram processing
Implements inet::INetfilter.
Referenced by inet::sctp::SCTPNatHook::finish(), inet::CloudDelayerBase::finish(), inet::CloudDelayerBase::~CloudDelayerBase(), and inet::sctp::SCTPNatHook::~SCTPNatHook().
|
protected |
Referenced by initialize(), and resolveNextHopMacAddress().
|
protected |
Referenced by endService(), and initialize().
|
protected |
Referenced by handleIncomingARPPacket(), and initialize().
|
protected |
Referenced by encapsulate(), and initialize().
|
protected |
Referenced by encapsulate(), and initialize().
|
protected |
Referenced by encapsulate(), and initialize().
|
protected |
Referenced by initialize(), and routeLocalBroadcastPacket().
|
protected |
Referenced by initialize(), and reassembleAndDeliver().
|
protected |
Referenced by initialize(), and reassembleAndDeliver().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by endService(), initialize(), start(), and stop().
|
protected |
Referenced by initialize(), and reassembleAndDeliver().
|
protected |
Referenced by handleIncomingICMP(), handleMessage(), reassembleAndDeliverFinish(), and sendOnTransportOutGateByProtocolId().
|
protected |
|
protected |
Referenced by forwardMulticastPacket(), initialize(), refreshDisplay(), and routeUnicastPacketFinish().
|
protected |
Referenced by initialize(), reassembleAndDeliverFinish(), and refreshDisplay().
|
protected |
Referenced by datagramLocalOut(), forwardMulticastPacket(), initialize(), and refreshDisplay().
|
protected |
Referenced by datagramLocalOut(), forwardMulticastPacket(), initialize(), refreshDisplay(), and routeUnicastPacket().
|
protected |
Referenced by arpResolutionCompleted(), arpResolutionTimedOut(), flush(), initialize(), and sendDatagramToOutput().
|
protected |
|
protected |
Referenced by initialize(), and sendPacketToNIC().
|
protected |
|
protected |
Referenced by initialize().
|
protected |
Referenced by initialize(), and sendDatagramToOutput().