#include <mll-module.h>
Inheritance diagram for MLLModule:
Public Member Functions | |
MLLModule () | |
~MLLModule () | |
virtual int | crLayCommand (ClMessage *m) |
virtual int | recvAsyncClMsg (ClMessage *m) |
virtual int | command (int argc, const char *const *argv) |
virtual void | recv (Packet *p) |
virtual void | recv (Packet *p, int idSrc) |
Protected Member Functions | |
virtual void | sendDown (Packet *p) |
virtual void | sendUp (Packet *p) |
virtual void | processARP (Packet *p, int idSrc) |
virtual bool | netAddrPresent (nsaddr_t addr) |
virtual void | fillNetAddrTable () |
virtual int | getDownAddr (int downId=-1) |
virtual int | arpResolve (nsaddr_t dst, Packet *p) |
virtual void | arpRequest (nsaddr_t src, nsaddr_t dst) |
Protected Attributes | |
MARPTable * | arptable_ |
vector< nsaddr_t > | netAddr |
int | seqno_ |
int | ackno_ |
Definition at line 50 of file mll-module.h.
MLLModule::MLLModule | ( | ) |
MLLModule::~MLLModule | ( | ) |
Desctructor
Definition at line 50 of file mll-module.cc.
int MLLModule::crLayCommand | ( | ClMessage * | m | ) | [virtual] |
Receive asyncronous commands In Practive only IPModule telling us its IP-address
m | Pointer to message object |
Reimplemented from PlugIn.
Definition at line 54 of file mll-module.cc.
References PlugIn::crLayCommand(), netAddr, and ClMessage::type().
Here is the call graph for this function:
int MLLModule::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 from PlugIn.
Definition at line 67 of file mll-module.cc.
References PlugIn::crLayCommand(), netAddr, and ClMessage::type().
Here is the call graph for this function:
int MLLModule::command | ( | int | argc, | |
const char *const * | argv | |||
) | [virtual] |
TCL Command handler
Reimplemented from Module.
Definition at line 80 of file mll-module.cc.
References MARPTable::addEntry(), arptable_, MARPTable::clear(), Module::command(), MARPEntry::macaddr_, and MARPEntry::up_.
Here is the call graph for this function:
void MLLModule::recv | ( | Packet * | p | ) | [virtual] |
Retrieve packets from other modules
Implements Module.
Definition at line 104 of file mll-module.cc.
void MLLModule::recv | ( | Packet * | p, | |
int | idSrc | |||
) | [virtual] |
Retrieve packets from other modules This method is used to know which mac-module to send ARP-replies to
Reimplemented from Module.
Definition at line 109 of file mll-module.cc.
References DOWN, processARP(), sendDown(), sendUp(), and UP.
Here is the call graph for this function:
void MLLModule::sendDown | ( | Packet * | p | ) | [protected, virtual] |
Handle packet going down
Definition at line 126 of file mll-module.cc.
References arpResolve(), getDownAddr(), Module::sendDown(), and seqno_.
Referenced by recv().
Here is the call graph for this function:
void MLLModule::sendUp | ( | Packet * | p | ) | [protected, virtual] |
Handle packet going up
Definition at line 175 of file mll-module.cc.
References Module::sendUp().
Referenced by recv().
Here is the call graph for this function:
void MLLModule::processARP | ( | Packet * | p, | |
int | idSrc | |||
) | [protected, virtual] |
Process a ARP-request/-response packet
Definition at line 180 of file mll-module.cc.
References MARPTable::addEntry(), arptable_, DOWN, getDownAddr(), MARPEntry::hold_, MARPTable::lookup(), MARPEntry::macaddr_, netAddrPresent(), Module::sendDown(), and MARPEntry::up_.
Referenced by recv().
Here is the call graph for this function:
bool MLLModule::netAddrPresent | ( | nsaddr_t | addr | ) | [protected, virtual] |
Check if a given IP-address is present in our stack Sends cl-messages to upper layer requesting their IP-addresses
addr | IP address to look for |
Definition at line 256 of file mll-module.cc.
References fillNetAddrTable(), and netAddr.
Referenced by processARP().
Here is the call graph for this function:
void MLLModule::fillNetAddrTable | ( | ) | [protected, virtual] |
Fill the table of upper layer network addresses
Definition at line 263 of file mll-module.cc.
References CLBROADCASTADDR, PlugIn::getId(), netAddr, Module::sendSyncClMsgUp(), and ClMessage::setDest().
Referenced by arpResolve(), and netAddrPresent().
Here is the call graph for this function:
int MLLModule::getDownAddr | ( | int | downId = -1 |
) | [protected, virtual] |
Retrieve MAC address for lower layer
downId | id of downward module if> -1, only the module with id downId will be asked, else request is broadcasted |
Definition at line 272 of file mll-module.cc.
References BROADCAST, CLBROADCASTADDR, MacClMsgGetAddr::getAddr(), Module::sendSyncClMsgDown(), and UNICAST.
Referenced by arpRequest(), processARP(), and sendDown().
Here is the call graph for this function:
int MLLModule::arpResolve | ( | nsaddr_t | dst, | |
Packet * | p | |||
) | [protected, virtual] |
Resolve MAC address for given dst address
dst | IP destination address | |
p | packet which requested the resolv, will be cached |
Definition at line 290 of file mll-module.cc.
References MARPTable::addEntry(), arpRequest(), arptable_, MARPEntry::count_, Module::drop(), fillNetAddrTable(), MARPEntry::hold_, MARPTable::lookup(), MARPEntry::macaddr_, netAddr, and MARPEntry::up_.
Referenced by sendDown().
Here is the call graph for this function:
void MLLModule::arpRequest | ( | nsaddr_t | src, | |
nsaddr_t | dst | |||
) | [protected, virtual] |
Builds and sends an ARP request for the given dst IP address
src | Our source address | |
dst | The destination address we are looking for |
Definition at line 367 of file mll-module.cc.
References DOWN, getDownAddr(), and Module::sendDown().
Referenced by arpResolve().
Here is the call graph for this function:
MARPTable* MLLModule::arptable_ [protected] |
Pointer to an arptable
Definition at line 127 of file mll-module.h.
Referenced by arpResolve(), command(), MLLModule(), and processARP().
vector<nsaddr_t> MLLModule::netAddr [protected] |
List of IP address to our upper layers
Definition at line 130 of file mll-module.h.
Referenced by arpResolve(), crLayCommand(), fillNetAddrTable(), netAddrPresent(), and recvAsyncClMsg().
int MLLModule::seqno_ [protected] |
int MLLModule::ackno_ [protected] |
ACK received so far
Definition at line 136 of file mll-module.h.