#include <plugin.h>
Inheritance diagram for PlugIn:
Public Member Functions | |
PlugIn () | |
virtual | ~PlugIn () |
virtual int | command (int argc, const char *const *argv) |
virtual int | recvAsyncClMsg (ClMessage *m) |
virtual int | recvSyncClMsg (ClMessage *m) |
void | recv (Packet *p, Handler *callback=0) |
int | getId () |
void | setId (int val) |
int | getTag (char *buf, int size) |
const char * | getTag () |
Position * | getPosition () |
void | setLayer (int val) |
int | getLayer () |
virtual int | crLayCommand (ClMessage *m) |
virtual int | crLaySynchronousCommand (ClMessage *m) |
Protected Member Functions | |
void | sendAsyncClMsg (ClMessage *m, double delay=0) |
void | sendSynchronousCl (ClMessage *m) |
void | sendSyncClMsg (ClMessage *m) |
void | drop (ClMessage *m, const char *reason="---") |
void | sendCl (ClMessage *m, double delay=0) |
Protected Attributes | |
Bin * | binPtr_ |
char | tag_ [MAX_TAG_LENGTH] |
int | uLayerId_ |
Private Attributes | |
int | uid_ |
ClSAP * | clsap_ |
Definition at line 61 of file plugin.h.
int PlugIn::command | ( | int | argc, | |
const char *const * | argv | |||
) | [virtual] |
TCL command interpreter. It implements the following OTcl methods:
Moreover it inherits all the OTcl method of NsObject
argc | number of arguments in argv | |
argv | array of strings which are the comand parameters (Note that argv[0] is the name of the object) |
Reimplemented in ChannelModule, Module, PositionDB, IPInterfaceModule, IPRoutingModule, IPModule, PortMap, PortMux, CbrModule, TcpModule, LinkChannelModule, MPhy, MMacModule, MMac, MLLModule, UmtsMacModule, RlcModule, UmtsIPInterfaceModule, UmtsPhy, UmtsPhyME, UmtsWirelessChModule, DumbWirelessChModule, WirelessChModule, WirelessPhyModule, MacModule802_11, IPAddressCodec, MrclRoutingStatic, MrclRouting, and AodvModule.
Definition at line 58 of file plugin.cc.
References binPtr_, clsap_, getId(), MAX_TAG_LENGTH, setId(), and tag_.
Referenced by Module::command(), and PositionDB::command().
Here is the call graph for this function:
int PlugIn::recvAsyncClMsg | ( | ClMessage * | m | ) | [virtual] |
Cross-Layer messages asynchronous interpreter.
It has to be properly extended in order to interpret custom cross-layer messages used by this particular plug-in. This type of communication does not necessarily need a reply.
A very importan exception to this rule are classes inheriting directly from either Plugin or Module. These classes should NOT call neither Plugin::recvAsyncClMsg() nor Module::recvAsyncClMsg() for unknown messages; instead, they should just free the memory associated with ClMessage* m
m | an instance of ClMessage that represent the message received |
Reimplemented in MLLModule.
Definition at line 153 of file plugin.cc.
References RETVAL_NOT_IMPLEMENTED.
Referenced by ClSAP::handle(), SAP::sendDown(), ClSAP::sendModule(), and SAP::sendUp().
int PlugIn::recvSyncClMsg | ( | ClMessage * | m | ) | [virtual] |
Cross-Layer messages synchronous interpreter. It has to be properly extended in order to interpret custom cross-layer messages used by this particular plug-in. This type of communication need to be directly answered in the message exchanged in order to be synchronous with the source.
m | an instance of ClMessage that represent the message received and used for the answer |
Reimplemented in PositionDB, IPModule, MPhy, MMacModule, MMac, and MrclRouting.
Definition at line 186 of file plugin.cc.
References getId(), getLayer(), getTag(), RETVAL_NOT_IMPLEMENTED, and ClMessage::type().
Referenced by MrclRouting::recvSyncClMsg(), MPhy::recvSyncClMsg(), MMac::recvSyncClMsg(), MMacModule::recvSyncClMsg(), IPModule::recvSyncClMsg(), SAP::sendSynchronousDown(), ClSAP::sendSynchronousModule(), and SAP::sendSynchronousUp().
Here is the call graph for this function:
void PlugIn::recv | ( | Packet * | p, | |
Handler * | callback = 0 | |||
) |
Method inherited from NsObject, it is not used in this level of inheritance since PlugIn Class use only cross-layer messages to communicate with the other entities in the architecture
p | pointer to the packet will be received | |
callback | pointer to a Handler class |
Reimplemented in ChannelModule, Module, CbrModule, TcpModule, LinkChannelModule, MMacModule, RlcModule, WirelessPhyModule, and MacModule802_11.
int PlugIn::getId | ( | ) |
Return the PlugIn id
Definition at line 121 of file plugin.cc.
References uid_.
Referenced by Module::addDownSAP(), PortMap::assignPort(), PortMux::command(), command(), MLLModule::fillNetAddrTable(), AodvModule::forward(), MrclRouting::getConfiguration(), SAP::getModuleDownId(), SAP::getModuleUpId(), ClSAP::getPluginId(), MrclRouting::getRoute(), MrclRouting::recv(), CbrModule::recv(), AodvModule::recvRequest(), recvSyncClMsg(), MrclRoutingStatic::resolve(), sendAsyncClMsg(), Module::sendAsyncClMsgDown(), Module::sendAsyncClMsgUp(), Module::sendDown(), CbrModule::sendPkt(), AodvModule::sendRequest(), sendSyncClMsg(), Module::sendSyncClMsgDown(), Module::sendSyncClMsgUp(), and Module::sendUp().
void PlugIn::setId | ( | int | val | ) |
int PlugIn::getTag | ( | char * | buf, | |
int | size | |||
) |
const char* PlugIn::getTag | ( | ) | [inline] |
Return a const pointer to the PlugIn tag
Definition at line 191 of file plugin.h.
References tag_.
Referenced by recvSyncClMsg(), and Module::sendUp().
Position * PlugIn::getPosition | ( | ) |
Return the pointer to the Position instance within the NodeCore
Definition at line 254 of file plugin.cc.
References clsap_, and ClSAP::getPosition().
Referenced by PositionDB::command(), AodvModule::forward(), WirelessChModule::getInfluencedNodes(), WirelessPhyModule::recv(), MPhy::recv(), AodvModule::sendRequest(), and WirelessChModule::sortChSAPList().
Here is the call graph for this function:
void PlugIn::setLayer | ( | int | val | ) |
int PlugIn::getLayer | ( | ) |
void PlugIn::sendAsyncClMsg | ( | ClMessage * | m, | |
double | delay = 0 | |||
) | [protected] |
Send an asyncronous cross-layer message, i.e., it does not require a direct answer from the target. It is possible to insert a delay before the communcation will start.
m | an instance of ClMessage to be sent | |
delay | (optional) delay [sec.] to introduce before the comunication starts |
Definition at line 212 of file plugin.cc.
References clsap_, getId(), ClSAP::sendClLayer(), and ClMessage::setSource().
Referenced by sendCl().
Here is the call graph for this function:
void PlugIn::sendSynchronousCl | ( | ClMessage * | m | ) | [protected] |
Send a syncronous cross-layer message, i.e., the target entity has to directly answer through the message exchanged
m | an instance of ClMessage to be sent (and in which will be the target answer) |
Definition at line 224 of file plugin.cc.
References PRINT_WARNING_DEPRECATED_FUNCTION, and sendSyncClMsg().
Here is the call graph for this function:
void PlugIn::drop | ( | ClMessage * | m, | |
const char * | reason = "---" | |||
) | [protected] |
Drop a cross-layer message, i.e., send it to the instance of the Bin in order to manage its tracing and deallocation
m | pointer of the cross-layer message which has to be dropped | |
reason | stores the string in which is indicated the motivation of the drop |
Definition at line 242 of file plugin.cc.
References binPtr_, and Bin::drop().
Here is the call graph for this function:
void PlugIn::sendCl | ( | ClMessage * | m, | |
double | delay = 0 | |||
) | [protected] |
m | ||
delay |
Definition at line 206 of file plugin.cc.
References PRINT_WARNING_DEPRECATED_FUNCTION, and sendAsyncClMsg().
Here is the call graph for this function:
int PlugIn::crLayCommand | ( | ClMessage * | m | ) | [virtual] |
m |
Reimplemented in CbrModule, and MLLModule.
Definition at line 168 of file plugin.cc.
References RETVAL_NOT_IMPLEMENTED.
Referenced by MLLModule::crLayCommand(), CbrModule::crLayCommand(), ClSAP::handle(), MLLModule::recvAsyncClMsg(), SAP::sendDown(), ClSAP::sendModule(), and SAP::sendUp().
int PlugIn::crLaySynchronousCommand | ( | ClMessage * | m | ) | [virtual] |
m |
Reimplemented in MMacModule.
Definition at line 199 of file plugin.cc.
References RETVAL_NOT_IMPLEMENTED.
Referenced by MMacModule::crLaySynchronousCommand(), SAP::sendSynchronousDown(), ClSAP::sendSynchronousModule(), and SAP::sendSynchronousUp().
Bin* PlugIn::binPtr_ [protected] |
char PlugIn::tag_[MAX_TAG_LENGTH] [protected] |
String identifies the plug-in in the bin-tracing
Definition at line 259 of file plugin.h.
Referenced by command(), CbrModule::command(), Module::drop(), getTag(), and PlugIn().
int PlugIn::uid_ [private] |
ClSAP* PlugIn::clsap_ [private] |
Pointer to the manager of the cross layer bus and cross layer messages
Definition at line 266 of file plugin.h.
Referenced by command(), getPosition(), sendAsyncClMsg(), and sendSyncClMsg().
int PlugIn::uLayerId_ [protected] |