A class to convert integer layer addresses. More...
#include <BaseArp.h>
Inherits ArpInterface, AddressingInterface, and BaseModule.
Public Member Functions | |
virtual void | initialize (int stage) |
Basic initialization for all modules. | |
virtual void | handleMessage (cMessage *) |
should not be called, instead direct calls to the radio methods should be used. | |
virtual int | getMacAddr (const int netwAddr) |
returns a L2 address to a given L3 address. | |
virtual int | myMacAddr (cModule *mac) |
Returns the L2 address for the passed mac. | |
virtual int | myNetwAddr (cModule *netw) |
Returns the L3 address for the passed net. | |
Private Attributes | |
bool | coreDebug |
Is core debugging enabled? |
A class to convert integer layer addresses.
This class takes the network layer module id as the network layer address and the NIC module id as the mac layer address
ARP implementations are divers, it does not make sense to start from a common class. Their main purpose is to translate layer 2 into layer 3 addresses. However, these addresses can be very different. Here, simple integers are sufficient, but for hardware-in-the-loop simulations more complex ones are appropriate.
In contrast to this ARP, others may want to cache entries.
Since this simplified ARP relies on a certain addressing scheme it implements the AddressingInterface to be able to define the addresses for each network and mac layer.
Definition at line 51 of file BaseArp.h.
void BaseArp::initialize | ( | int | stage | ) | [virtual] |
Basic initialization for all modules.
Subscription to Blackboard should be in stage==0, and firing notifications in stage==1 or later.
NOTE: You have to call this in the initialize() function of the inherited class!
Reimplemented from BaseModule.
Definition at line 24 of file BaseArp.cc.
References coreDebug.
{ BaseModule::initialize(stage); if(stage==0) { hasPar("coreDebug") ? coreDebug = par("coreDebug").boolValue() : coreDebug = false; } }