INET Framework for OMNeT++/OMNEST
|
Implements a generic network protocol that routes generic datagrams through the network. More...
#include <GenericNetworkProtocol.h>
Classes | |
struct | QueuedDatagramForHook |
Represents an GenericDatagram, queued by a Hook. More... | |
Public Member Functions | |
GenericNetworkProtocol () | |
~GenericNetworkProtocol () | |
virtual void | registerHook (int priority, IHook *hook) override |
Adds the provided hook to the list of registered hooks that will be called by the network layer when it processes datagrams. More... | |
virtual void | unregisterHook (int priority, IHook *hook) override |
Removes the provided hook from the list of registered hooks. More... | |
virtual void | dropQueuedDatagram (const INetworkDatagram *datagram) override |
Requests the network layer to drop the datagram, because it's no longer needed. More... | |
virtual void | reinjectQueuedDatagram (const INetworkDatagram *datagram) override |
Requests the network layer to restart the processing of the datagram. 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::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 void | refreshDisplay () const override |
virtual void | handlePacketFromNetwork (GenericDatagram *datagram) |
Handle GenericDatagram messages arriving from lower layer. More... | |
virtual void | handleMessageFromHL (cPacket *packet) |
Handle messages (typically packets to be send in Generic) from transport or ICMP. More... | |
virtual void | routePacket (GenericDatagram *datagram, const InterfaceEntry *destIE, const L3Address &nextHop, bool fromHL) |
Performs routing. More... | |
virtual void | routeMulticastPacket (GenericDatagram *datagram, const InterfaceEntry *destIE, const InterfaceEntry *fromIE) |
Forwards packets to all multicast destinations, using sendDatagramToOutput(). More... | |
virtual GenericDatagram * | encapsulate (cPacket *transportPacket, const InterfaceEntry *&destIE) |
Encapsulate packet coming from higher layers into GenericDatagram, using the control info attached to the packet. More... | |
virtual cPacket * | decapsulate (GenericDatagram *datagram) |
Decapsulate and return encapsulated packet after attaching GenericNetworkProtocolControlInfo. More... | |
virtual void | sendDatagramToHL (GenericDatagram *datagram) |
Send datagrams up to the higher layers. More... | |
virtual void | sendDatagramToOutput (GenericDatagram *datagram, const InterfaceEntry *ie, L3Address nextHop) |
Last TTL check, then send datagram on the given interface. More... | |
virtual void | datagramPreRouting (GenericDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *destIE, const L3Address &nextHop) |
virtual void | datagramLocalIn (GenericDatagram *datagram, const InterfaceEntry *inIE) |
virtual void | datagramLocalOut (GenericDatagram *datagram, const InterfaceEntry *destIE, const L3Address &nextHop) |
virtual IHook::Result | datagramPreRoutingHook (GenericDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *&outIE, L3Address &nextHop) |
virtual IHook::Result | datagramForwardHook (GenericDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *&outIE, L3Address &nextHop) |
virtual IHook::Result | datagramPostRoutingHook (GenericDatagram *datagram, const InterfaceEntry *inIE, const InterfaceEntry *&outIE, L3Address &nextHop) |
virtual IHook::Result | datagramLocalInHook (GenericDatagram *datagram, const InterfaceEntry *inIE) |
virtual IHook::Result | datagramLocalOutHook (GenericDatagram *datagram, const InterfaceEntry *&outIE, L3Address &nextHop) |
virtual void | initialize () override |
Initialization. More... | |
virtual void | handleMessage (cMessage *message) override |
Handle message. More... | |
virtual void | endService (cPacket *packet) override |
Processing of generic datagrams. More... | |
Protected Member Functions inherited from inet::QueueBase | |
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 | |
IInterfaceTable * | interfaceTable |
GenericRoutingTable * | routingTable |
IARP * | arp |
int | queueOutBaseGateId |
int | defaultHopLimit |
ProtocolMapping | mapping |
HookList | hooks |
DatagramQueueForHooks | queuedDatagramsForHooks |
int | numLocalDeliver |
int | numDropped |
int | numUnroutable |
int | numForwarded |
Protected Attributes inherited from inet::QueueBase | |
simtime_t | delay |
Protected Attributes inherited from inet::AbstractQueue | |
cPacketQueue | queue |
The queue. More... | |
Implements a generic network protocol that routes generic datagrams through the network.
Routing decisions are based on a generic routing table, but it also supports the netfilter interface to allow routing protocols to kick in. It doesn't provide datagram fragmentation and reassembling.
|
protected |
|
protected |
inet::GenericNetworkProtocol::GenericNetworkProtocol | ( | ) |
inet::GenericNetworkProtocol::~GenericNetworkProtocol | ( | ) |
|
protectedvirtual |
|
protectedvirtual |
Referenced by reinjectQueuedDatagram().
|
protectedvirtual |
Referenced by routePacket().
|
protectedvirtual |
Referenced by handleMessageFromHL(), and reinjectQueuedDatagram().
|
protectedvirtual |
Referenced by handleMessageFromHL().
|
protectedvirtual |
|
protectedvirtual |
Referenced by handlePacketFromNetwork(), and reinjectQueuedDatagram().
|
protectedvirtual |
Referenced by handlePacketFromNetwork().
|
protectedvirtual |
Decapsulate and return encapsulated packet after attaching GenericNetworkProtocolControlInfo.
Referenced by sendDatagramToHL().
|
overridevirtual |
Requests the network layer to drop the datagram, because it's no longer needed.
This function may be used by a reactive routing protocol when it cancels the route discovery process.
Implements inet::INetfilter.
|
protectedvirtual |
Encapsulate packet coming from higher layers into GenericDatagram, using the control info attached to the packet.
Referenced by handleMessageFromHL().
|
overrideprotectedvirtual |
Processing of generic datagrams.
Called when a datagram reaches the front of the queue.
Implements inet::AbstractQueue.
|
protectedvirtual |
Referenced by decapsulate(), handlePacketFromNetwork(), and routePacket().
|
overrideprotectedvirtual |
Handle message.
Reimplemented from inet::AbstractQueue.
|
protectedvirtual |
Handle messages (typically packets to be send in Generic) from transport or ICMP.
Invokes encapsulate(), then routePacket().
Referenced by endService().
|
protectedvirtual |
Handle GenericDatagram messages arriving from lower layer.
Decrements TTL, then invokes routePacket().
Referenced by endService().
|
overrideprotectedvirtual |
Initialization.
Reimplemented from inet::QueueBase.
|
overrideprotectedvirtual |
|
overridevirtual |
Adds the provided hook to the list of registered hooks that will be called by the network layer when it processes datagrams.
Implements inet::INetfilter.
|
overridevirtual |
Requests the network layer to restart the processing of the datagram.
This function may be used by a reactive routing protocol when it completes the route discovery process.
Implements inet::INetfilter.
|
protectedvirtual |
Forwards packets to all multicast destinations, using sendDatagramToOutput().
Referenced by datagramLocalOut(), and datagramPreRouting().
|
protectedvirtual |
Performs routing.
Based on the routing decision, it dispatches to sendDatagramToHL() for local packets, to sendDatagramToOutput() for forwarded packets, to handleMulticastPacket() for multicast packets, or drops the packet if it's unroutable or forwarding is off.
Referenced by datagramLocalOut(), and datagramPreRouting().
|
protectedvirtual |
Send datagrams up to the higher layers.
Referenced by datagramLocalIn(), routeMulticastPacket(), and routePacket().
|
protectedvirtual |
Last TTL check, then send datagram on the given interface.
Referenced by routeMulticastPacket(), and routePacket().
|
overridevirtual |
|
protected |
Referenced by initialize(), and sendDatagramToOutput().
|
protected |
Referenced by encapsulate(), and initialize().
|
protected |
|
protected |
Referenced by encapsulate(), getSourceInterfaceFrom(), handleMessageFromHL(), initialize(), and routeMulticastPacket().
|
protected |
Referenced by handleMessage(), and sendDatagramToHL().
|
protected |
Referenced by initialize(), refreshDisplay(), and routePacket().
|
protected |
Referenced by initialize(), refreshDisplay(), and routePacket().
|
protected |
Referenced by initialize(), refreshDisplay(), and routePacket().
|
protected |
Referenced by initialize(), refreshDisplay(), and routePacket().
|
protected |
|
protected |
Referenced by initialize(), and sendDatagramToOutput().
|
protected |
Referenced by encapsulate(), initialize(), routeMulticastPacket(), and routePacket().