DESERT 4.0.0
UWMllModule Class Reference

#include <uwmll-module.h>

Inheritance diagram for UWMllModule:
Inheritance graph
Collaboration diagram for UWMllModule:
Collaboration graph

Public Member Functions

 UWMllModule ()
 
 ~UWMllModule ()
 
virtual int crLayCommand (ClMessage *m)
 
virtual int recvAsyncClMsg (ClMessage *m)
 
virtual int recvSyncClMsg (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 int getDownAddr (int downId=-1)
 
virtual int arpResolve (nsaddr_t dst, Packet *p)
 
void incrArpPktDrop ()
 
int getArpPktDropped ()
 

Protected Attributes

UWARPTablearptable_
 
vector< nsaddr_t > netAddr
 
int seqno_
 
int n_arp_pkt_drop
 
int enable_addr_copy
 

Detailed Description

Module for ARP-resolve. Should live between one or more IPModule and one MMacModule NOTE: You should only use one MMacModule below this module, else behavior is undef

Constructor & Destructor Documentation

◆ UWMllModule()

UWMllModule::UWMllModule ( )

Constructor

References arptable_, and enable_addr_copy.

◆ ~UWMllModule()

UWMllModule::~UWMllModule ( )

Desctructor

Member Function Documentation

◆ arpResolve()

int UWMllModule::arpResolve ( nsaddr_t  dst,
Packet *  p 
)
protectedvirtual

Resolve MAC address for given dst address

Parameters
dstIP destination address
ppacket which requested the resolv, will be cached
Returns
0 if ARP request successfully sent, otherwise some error number

References arptable_, UWARPTable::lookup(), UWARPEntry::macaddr_, and UWARPEntry::up_.

Referenced by sendDown().

Here is the call graph for this function:

◆ command()

int UWMllModule::command ( int  argc,
const char *const *  argv 
)
virtual

TCL Command handler

References UWARPTable::addEntry(), arptable_, UWARPTable::clear(), getArpPktDropped(), UWARPEntry::macaddr_, and UWARPEntry::up_.

Here is the call graph for this function:

◆ crLayCommand()

int UWMllModule::crLayCommand ( ClMessage *  m)
virtual

Receive asyncronous commands In Practive only IPModule telling us its IP-address

Parameters
mPointer to message object
Returns
1 on success

◆ getArpPktDropped()

int UWMllModule::getArpPktDropped ( )
inlineprotected

References n_arp_pkt_drop.

Referenced by command().

◆ getDownAddr()

int UWMllModule::getDownAddr ( int  downId = -1)
protectedvirtual

Retrieve MAC address for lower layer

Parameters
downIdid of downward module if> -1, only the module with id downId will be asked, else request is broadcasted
Returns
the MAC address of lower layer

Referenced by sendDown().

◆ incrArpPktDrop()

void UWMllModule::incrArpPktDrop ( )
inlineprotected

References n_arp_pkt_drop.

◆ recv() [1/2]

void UWMllModule::recv ( Packet *  p)
virtual

Retrieve packets from other modules

References recv().

Referenced by recv().

Here is the call graph for this function:

◆ recv() [2/2]

void UWMllModule::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

References sendDown(), and sendUp().

Here is the call graph for this function:

◆ recvAsyncClMsg()

int UWMllModule::recvAsyncClMsg ( ClMessage *  m)
virtual

◆ recvSyncClMsg()

int UWMllModule::recvSyncClMsg ( ClMessage *  m)
virtual

◆ sendDown()

void UWMllModule::sendDown ( Packet *  p)
protectedvirtual

Handle packet going down

References arpResolve(), hdr_uwip::daddr(), enable_addr_copy, getDownAddr(), and seqno_.

Referenced by recv().

Here is the call graph for this function:

◆ sendUp()

void UWMllModule::sendUp ( Packet *  p)
protectedvirtual

Handle packet going up

Referenced by recv().

Member Data Documentation

◆ arptable_

UWARPTable* UWMllModule::arptable_
protected

Pointer to an arptable

Referenced by arpResolve(), command(), and UWMllModule().

◆ enable_addr_copy

int UWMllModule::enable_addr_copy
protected

Referenced by sendDown(), and UWMllModule().

◆ n_arp_pkt_drop

int UWMllModule::n_arp_pkt_drop
protected

Referenced by getArpPktDropped(), and incrArpPktDrop().

◆ netAddr

vector<nsaddr_t> UWMllModule::netAddr
protected

List of IP address to our upper layers

◆ seqno_

int UWMllModule::seqno_
protected

Link layer sequence number

Referenced by sendDown().


The documentation for this class was generated from the following files: