DESERT 3.5.1
Loading...
Searching...
No Matches
UwMultiDestination Class Reference

#include <uwmulti-destination.h>

Inheritance diagram for UwMultiDestination:
Collaboration diagram for UwMultiDestination:

Public Member Functions

 UwMultiDestination ()
 
virtual ~UwMultiDestination ()
 
virtual int command (int, const char *const *)
 
virtual bool addLayer (IP_range range, int id)
 
virtual void recv (Packet *p)
 

Static Public Attributes

static int const layer_not_exist = -1
 

Protected Types

enum  Mode { UW_MANUAL_SWITCH = 0 , UW_AUTOMATIC_SWITCH }
 

Protected Member Functions

virtual void recvFromUpperLayers (Packet *p)
 
virtual int getDestinationLayer (Packet *p)
 
virtual bool checkNotOverlap (IP_range range)
 

Protected Attributes

int debug_
 
double min_delay_
 
Mode switch_mode_
 
int lower_id_active_
 
std::list< layer_IPrangelayer_list
 
int default_lower_id
 

Detailed Description

Class used to represents the UwMultiDestination layer of a node.

Definition at line 103 of file uwmulti-destination.h.

Member Enumeration Documentation

◆ Mode

enum UwMultiDestination::Mode
protected

< Switch modes >

Enumerator
UW_MANUAL_SWITCH 

State to switch-mode manually.

UW_AUTOMATIC_SWITCH 

State to switch-mode automatically.

Definition at line 156 of file uwmulti-destination.h.

Constructor & Destructor Documentation

◆ UwMultiDestination()

UwMultiDestination::UwMultiDestination ( )

Constructor of UwMultiDestination class.

Definition at line 65 of file uwmulti-destination.cpp.

◆ ~UwMultiDestination()

virtual UwMultiDestination::~UwMultiDestination ( )
inlinevirtual

Destructor of UwMultiDestination class.

Definition at line 119 of file uwmulti-destination.h.

Member Function Documentation

◆ addLayer()

bool UwMultiDestination::addLayer ( IP_range  range,
int  id 
)
virtual

Add a layer in the layer map if the IP range is valide, i.e., if the range doesn't overlap with an existing one.

Parameters
rangeIP range
ididentifier of the lower layer return false if the range overlaps with an existing one, true otherwise

Definition at line 144 of file uwmulti-destination.cpp.

◆ checkNotOverlap()

bool UwMultiDestination::checkNotOverlap ( IP_range  range)
protectedvirtual

return true if there is not overlap between the new range and the previous rnage in the list

Parameters
rangethat has to be inserted in the list
Returns
true if there is not overlap, false otherwise

Definition at line 201 of file uwmulti-destination.cpp.

◆ command()

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

TCL command interpreter.

It implements the following OTcl methods:

Parameters
argcNumber of arguments in argv.
argvArray of strings which are the command parameters (Note that argv[0] is the name of the object).
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.

Definition at line 81 of file uwmulti-destination.cpp.

◆ getDestinationLayer()

int UwMultiDestination::getDestinationLayer ( Packet *  p)
protectedvirtual

Return the best layer to forward the packet when the system works in AUTOMATIC_MODE.

Parameters
ppointer to the packet
Returns
id of the module representing the best layer.

Definition at line 185 of file uwmulti-destination.cpp.

◆ recv()

void UwMultiDestination::recv ( Packet *  p)
virtual

recv method.

It is called when a packet is received from the other layers

Parameters
Packet*Pointer to the packet that are going to be received

Definition at line 162 of file uwmulti-destination.cpp.

◆ recvFromUpperLayers()

void UwMultiDestination::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Default lower id to use if dest adress is not found in the considered IP ranges.

Handle a packet coming from upper layers

Parameters
ppointer to the packet

Definition at line 174 of file uwmulti-destination.cpp.

Member Data Documentation

◆ debug_

int UwMultiDestination::debug_
protected

Flag to activate debug verbosity.

Definition at line 161 of file uwmulti-destination.h.

◆ default_lower_id

int UwMultiDestination::default_lower_id
protected

Maps a layer id into an IP_range.

Definition at line 169 of file uwmulti-destination.h.

◆ layer_list

std::list<layer_IPrange> UwMultiDestination::layer_list
protected

Definition at line 167 of file uwmulti-destination.h.

◆ layer_not_exist

const int UwMultiDestination::layer_not_exist = -1
static

This constant is returned when a searched layer does not exist>

Definition at line 108 of file uwmulti-destination.h.

◆ lower_id_active_

int UwMultiDestination::lower_id_active_
protected

Id of the current lower layer active.

It is used only in MANUAL MODE.

Definition at line 164 of file uwmulti-destination.h.

◆ min_delay_

double UwMultiDestination::min_delay_
protected

Definition at line 162 of file uwmulti-destination.h.

◆ switch_mode_

Mode UwMultiDestination::switch_mode_
protected

Current switch mode (either AUTOMATIC or MANUAL).

Definition at line 163 of file uwmulti-destination.h.


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