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

#include <uwmulti-traffic-control.h>

Inheritance diagram for UwMultiTrafficControl:
Collaboration diagram for UwMultiTrafficControl:

Public Member Functions

 UwMultiTrafficControl ()
 
virtual ~UwMultiTrafficControl ()
 
virtual int command (int, const char *const *)
 
virtual void recv (Packet *p)
 

Protected Member Functions

virtual void recvFromUpperLayers (Packet *p)
 
virtual void manageBuffer (int traffic)
 
virtual void insertInBuffer (Packet *p, int traffic)
 
virtual Packet * removeFromBuffer (int traffic)
 
virtual Packet * getFromBuffer (int traffic)
 
void insertTraffic2UpLayer (int traffic, int upper_layer_id)
 
void insertTraffic2LowerLayer (int traffic, int lower_layer_stack, int lower_layer_id, int behavior)
 
virtual int getBestLowerLayer (int traffic, Packet *p=NULL)
 
virtual int getUpperLayer (int traffic)
 
virtual void eraseTraffic2LowerLayer (int traffic, int lower_layer_stack)
 
virtual void eraseTraffic2Low (int traffic)
 
virtual void eraseTraffic2Up (int traffic)
 
virtual void addUpLayerFromTag (int traffic_id, std::string tag)
 
virtual void addLowLayerFromTag (int traffic_id, std::string tag, int behavior)
 
void setBufferFeature (int traffic_id, int max_size, bool is_circular, double send_down_delay=0)
 
virtual void incrPktLoss (int traffic_id)
 
virtual uint getDiscardedPacket (int traffic_id) const
 

Protected Attributes

int debug_
 
UpTrafficMap up_map
 
DownTrafficMap down_map
 
DownTrafficBuffer down_buffer
 
BufferTrafficFeature buffer_feature_map
 

Detailed Description

Class used to represents the UwMultiTrafficControl layer of a node.

Definition at line 102 of file uwmulti-traffic-control.h.

Constructor & Destructor Documentation

◆ UwMultiTrafficControl()

UwMultiTrafficControl::UwMultiTrafficControl ( )

Constructor of UwMultiPhy class.

Definition at line 63 of file uwmulti-traffic-control.cc.

◆ ~UwMultiTrafficControl()

virtual UwMultiTrafficControl::~UwMultiTrafficControl ( )
inlinevirtual

Destructor of UwMultiPhy class.

Definition at line 115 of file uwmulti-traffic-control.h.

Member Function Documentation

◆ addLowLayerFromTag()

void UwMultiTrafficControl::addLowLayerFromTag ( int  traffic_id,
std::string  tag,
int  behavior 
)
protectedvirtual

add a lower layer from the tag name in the map

Parameters
trafficapplication traffic id
tagtag of the lower module
behaviorbehavior of the layer

Definition at line 141 of file uwmulti-traffic-control.cc.

◆ addUpLayerFromTag()

void UwMultiTrafficControl::addUpLayerFromTag ( int  traffic_id,
std::string  tag 
)
protectedvirtual

add an upper layer from the tag name in the map

Parameters
trafficapplication traffic id
tagtag of the upper module

Definition at line 124 of file uwmulti-traffic-control.cc.

◆ command()

int UwMultiTrafficControl::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.

Reimplemented in UwMultiTrafficRangeCtr.

Definition at line 75 of file uwmulti-traffic-control.cc.

◆ eraseTraffic2Low()

void UwMultiTrafficControl::eraseTraffic2Low ( int  traffic)
protectedvirtual

remove the traffic from the lower layers matrix

Parameters
trafficapplication traffic id

Definition at line 327 of file uwmulti-traffic-control.cc.

◆ eraseTraffic2LowerLayer()

void UwMultiTrafficControl::eraseTraffic2LowerLayer ( int  traffic,
int  lower_layer_stack 
)
protectedvirtual

remove the behavior from the traffic lower layers matrix

Parameters
trafficapplication traffic id
lower_layer_stacklower layer stack id

Definition at line 314 of file uwmulti-traffic-control.cc.

◆ eraseTraffic2Up()

void UwMultiTrafficControl::eraseTraffic2Up ( int  traffic)
protectedvirtual

remove the traffic from the upper layers matrix

Parameters
trafficapplication traffic id

Definition at line 335 of file uwmulti-traffic-control.cc.

◆ getBestLowerLayer()

int UwMultiTrafficControl::getBestLowerLayer ( int  traffic,
Packet *  p = NULL 
)
protectedvirtual

return the Best Lower Layer id where to forward the packet of traffic type

Parameters
trafficapplication traffic id
Returns
the layer id

Reimplemented in UwMultiTrafficRangeCtr.

Definition at line 281 of file uwmulti-traffic-control.cc.

◆ getDiscardedPacket()

uint UwMultiTrafficControl::getDiscardedPacket ( int  traffic_id) const
protectedvirtual

get discarded packets

Parameters
traffic_idapplication traffic id
Returns
number of discarded packets for the given traffic id buffer)

Definition at line 369 of file uwmulti-traffic-control.cc.

◆ getFromBuffer()

Packet * UwMultiTrafficControl::getFromBuffer ( int  traffic)
protectedvirtual

get a packet of a certain type from the buffer and return it

Parameters
trafficapplication traffic id
Returns
the pointer of the removed packet

Definition at line 268 of file uwmulti-traffic-control.cc.

◆ getUpperLayer()

int UwMultiTrafficControl::getUpperLayer ( int  traffic)
protectedvirtual

return the Upper Layer id where to forward the received packet of traffic type

Parameters
trafficapplication traffic id
Returns
the layer id

Definition at line 302 of file uwmulti-traffic-control.cc.

◆ incrPktLoss()

void UwMultiTrafficControl::incrPktLoss ( int  traffic_id)
protectedvirtual

Increment by 1 the number of lost packets for the given traffic.

Parameters
traffic_idapplication traffic id

Definition at line 357 of file uwmulti-traffic-control.cc.

◆ insertInBuffer()

void UwMultiTrafficControl::insertInBuffer ( Packet *  p,
int  traffic 
)
protectedvirtual

insert a packet of a certain type in the buffer

Parameters
ppointer of the packet
trafficapplication traffic id

Definition at line 190 of file uwmulti-traffic-control.cc.

◆ insertTraffic2LowerLayer()

void UwMultiTrafficControl::insertTraffic2LowerLayer ( int  traffic,
int  lower_layer_stack,
int  lower_layer_id,
int  behavior 
)
inlineprotected

Set to which upper layer forward a specific kind of traffic received from the lower layers.

Parameters
applicationtraffic id
lower_layer_stackunique identifier of the lower layer stack
check_rangeif TRUE follows the CHECK_RANGE behavior, else the ROBUST one

Definition at line 201 of file uwmulti-traffic-control.h.

◆ insertTraffic2UpLayer()

void UwMultiTrafficControl::insertTraffic2UpLayer ( int  traffic,
int  upper_layer_id 
)
inlineprotected

Set to which upper layer forward a specific kind of traffic received from the lower layers.

Parameters
trafficapplication traffic id
upper_layer_idunique identifier of the upper layer id

Definition at line 190 of file uwmulti-traffic-control.h.

◆ manageBuffer()

void UwMultiTrafficControl::manageBuffer ( int  traffic)
protectedvirtual

manage to tx a packet of traffic type

Parameters
trafficapplication traffic id

Reimplemented in UwMultiTrafficRangeCtr.

Definition at line 237 of file uwmulti-traffic-control.cc.

◆ recv()

void UwMultiTrafficControl::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 160 of file uwmulti-traffic-control.cc.

◆ recvFromUpperLayers()

void UwMultiTrafficControl::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Handle a packet coming from upper layers.

Parameters
ppointer to the packet

Definition at line 177 of file uwmulti-traffic-control.cc.

◆ removeFromBuffer()

Packet * UwMultiTrafficControl::removeFromBuffer ( int  traffic)
protectedvirtual

remove a packet of a certain type from the buffer and return it

Parameters
trafficapplication traffic id
Returns
the pointer of the removed packet

Definition at line 254 of file uwmulti-traffic-control.cc.

◆ setBufferFeature()

void UwMultiTrafficControl::setBufferFeature ( int  traffic_id,
int  max_size,
bool  is_circular,
double  send_down_delay = 0 
)
protected

set buffer features for the given traffic type

Parameters
traffic_idapplication traffic id
max_sizemaximum buffer size
is_circulartrue if buffer is circular, false otherwise (discard new) buffer)
send_down_delaydelay used to send down packets

Definition at line 343 of file uwmulti-traffic-control.cc.

Member Data Documentation

◆ buffer_feature_map

BufferTrafficFeature UwMultiTrafficControl::buffer_feature_map
protected

Map with features of each buffer.

Definition at line 141 of file uwmulti-traffic-control.h.

◆ debug_

int UwMultiTrafficControl::debug_
protected

Flag to activate debug verbosity.

Definition at line 137 of file uwmulti-traffic-control.h.

◆ down_buffer

DownTrafficBuffer UwMultiTrafficControl::down_buffer
protected

Map of buffer per traffic types.

Definition at line 140 of file uwmulti-traffic-control.h.

◆ down_map

DownTrafficMap UwMultiTrafficControl::down_map
protected

Map of lower layers.

Definition at line 139 of file uwmulti-traffic-control.h.

◆ up_map

UpTrafficMap UwMultiTrafficControl::up_map
protected

Map of upper layers.

Definition at line 138 of file uwmulti-traffic-control.h.


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