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

#include <uwudp-module.h>

Inheritance diagram for UwUdp:
Collaboration diagram for UwUdp:

Public Member Functions

 UwUdp ()
 
virtual ~UwUdp ()
 
virtual void recv (Packet *)
 
virtual void recv (Packet *, int)
 
virtual int command (int, const char *const *)
 
virtual int assignPort (Module *)
 
void printIdsPkts () const
 

Protected Types

typedef std::map< uint8_t, std::set< int > > map_packets_el
 

Static Protected Member Functions

static int getUdpHeaderSize ()
 

Protected Attributes

uint16_t portcounter
 
map< int, int > port_map
 
map< int, int > id_map
 
std::map< uint16_t, map_packets_elmap_packets
 
int drop_duplicated_packets_
 
int debug_
 

Detailed Description

UwUdp class is used to manage UWUDP packets, and flows to and from upper modules.

Definition at line 107 of file uwudp-module.h.

Member Typedef Documentation

◆ map_packets_el

typedef std::map<uint8_t, std::set<int> > UwUdp::map_packets_el
protected

Definition at line 170 of file uwudp-module.h.

Constructor & Destructor Documentation

◆ UwUdp()

UwUdp::UwUdp ( )

Constructor of UwUdp class.

Definition at line 82 of file uwudp-module.cpp.

◆ ~UwUdp()

UwUdp::~UwUdp ( )
virtual

Destructor of UwUdp class.

Definition at line 91 of file uwudp-module.cpp.

Member Function Documentation

◆ assignPort()

int UwUdp::assignPort ( Module *  m)
virtual

Associates a module with a port.

Parameters
Module*Module to which associate a port.
Returns
Id of the port associated to the module.

Definition at line 227 of file uwudp-module.cpp.

◆ command()

int UwUdp::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 96 of file uwudp-module.cpp.

◆ getUdpHeaderSize()

static int UwUdp::getUdpHeaderSize ( )
inlinestaticprotected

Returns the size in byte of a hdr_uwudp packet header.

Returns
The size of a hdr_uwudp packet header.

Definition at line 189 of file uwudp-module.h.

◆ printIdsPkts()

void UwUdp::printIdsPkts ( ) const
inline

Prints the IDs of the packet's headers defined by UWUDP.

Definition at line 159 of file uwudp-module.h.

◆ recv() [1/2]

void UwUdp::recv ( Packet *  p)
virtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

Definition at line 122 of file uwudp-module.cpp.

◆ recv() [2/2]

void UwUdp::recv ( Packet *  p,
int  idSrc 
)
virtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.
Handler*Handler.

Definition at line 131 of file uwudp-module.cpp.

Member Data Documentation

◆ debug_

int UwUdp::debug_
protected

Flag to enable or disable dirrefent levels of debug.

Definition at line 181 of file uwudp-module.h.

◆ drop_duplicated_packets_

int UwUdp::drop_duplicated_packets_
protected

Flat to enable or disable the drop of duplicated packets.

Definition at line 179 of file uwudp-module.h.

◆ id_map

map<int, int> UwUdp::id_map
protected

Map: value = id; key = port.

Definition at line 168 of file uwudp-module.h.

◆ map_packets

std:: map<uint16_t, map_packets_el> UwUdp::map_packets
protected

Map used to keep track of the packets received by each port.

The key is the port number. The second element contains the saddr IP and a vector used as bucketlist.

Definition at line 173 of file uwudp-module.h.

◆ port_map

map<int, int> UwUdp::port_map
protected

Map: value = port; key = id.

Definition at line 167 of file uwudp-module.h.

◆ portcounter

uint16_t UwUdp::portcounter
protected

Counter used to generate new port numbers.

Definition at line 166 of file uwudp-module.h.


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