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

#include <uwflooding.h>

Inheritance diagram for UwFlooding:
Collaboration diagram for UwFlooding:

Public Member Functions

 UwFlooding ()
 
virtual ~UwFlooding ()
 

Protected Member Functions

virtual int command (int, const char *const *)
 
virtual void recv (Packet *)
 
virtual int recvSyncClMsg (ClMessage *)
 
virtual int recvAsyncClMsg (ClMessage *)
 
virtual void writePathInTrace (const Packet *, const string &)
 

Static Protected Member Functions

static nsaddr_t str2addr (const char *)
 
static string printIP (const nsaddr_t &)
 

Private Types

typedef std::map< uint16_t, doublemap_packets
 
typedef std::map< uint8_t, map_packetsmap_forwarded_packets
 

Private Member Functions

 UwFlooding (const UwFlooding &)
 
uint8_t getTTL (Packet *p) const
 

Private Attributes

uint8_t ipAddr_
 
int ttl_
 
double maximum_cache_time_
 
int optimize_
 
long packets_forwarded_
 
bool trace_path_
 
chartrace_file_path_name_
 
ofstream trace_file_path_
 
ostringstream osstream_
 
map_forwarded_packets my_forwarded_packets_
 
std::map< uint16_t, uint8_tttl_traffic_map
 

Detailed Description

UwFlooding class is used to represent the routing layer of a node.

Definition at line 74 of file uwflooding.h.

Member Typedef Documentation

◆ map_forwarded_packets

Typedef for a map of the packet forwarded (saddr, map_packets).

Definition at line 178 of file uwflooding.h.

◆ map_packets

Typedef for a packet id: (serial_number, timestamp).

Definition at line 174 of file uwflooding.h.

Constructor & Destructor Documentation

◆ UwFlooding() [1/2]

UwFlooding::UwFlooding ( )

Constructor of UwFlooding class.

Definition at line 78 of file uwflooding.cpp.

◆ ~UwFlooding()

UwFlooding::~UwFlooding ( )
virtual

Destructor of UwFlooding class.

Definition at line 93 of file uwflooding.cpp.

◆ UwFlooding() [2/2]

UwFlooding::UwFlooding ( const UwFlooding )
private

Copy constructor declared as private.

It is not possible to create a new UwFlooding object passing to its constructor another UwFlooding object.

Parameters
UwFlooding&UwFlooding object.

Member Function Documentation

◆ command()

int UwFlooding::command ( int  argc,
const char *const argv 
)
protectedvirtual

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 110 of file uwflooding.cpp.

◆ getTTL()

uint8_t UwFlooding::getTTL ( Packet p) const
private

Get the value of the TTL.

Parameters
ppointer to the packet for which the ttl has to be computed.
Returns
the ttl for that packet

Definition at line 378 of file uwflooding.cpp.

◆ printIP()

string UwFlooding::printIP ( const nsaddr_t ip_)
staticprotected

Return a string with an IP in the classic form "x.x.x.x" converting an ns2 nsaddr_t address.

Parameters
nsaddr_t&ns2 address
Returns
String that contains a printable IP in the classic form "x.x.x.x"

Definition at line 422 of file uwflooding.cpp.

◆ recv()

void UwFlooding::recv ( Packet p)
protectedvirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

Definition at line 155 of file uwflooding.cpp.

◆ recvAsyncClMsg()

int UwFlooding::recvAsyncClMsg ( ClMessage *  m)
protectedvirtual

Cross-Layer messages asynchronous interpreter.

Used to retrive the IP od the current node from the IP module.

Parameters
ClMessage*an instance of ClMessage that represent the message received and used for the answer.
Returns
0 if successful.

Definition at line 104 of file uwflooding.cpp.

◆ recvSyncClMsg()

int UwFlooding::recvSyncClMsg ( ClMessage *  m)
protectedvirtual

Cross-Layer messages synchronous interpreter.

Parameters
ClMessage*an instance of ClMessage that represent the message received
Returns
0 if successful.

Definition at line 98 of file uwflooding.cpp.

◆ str2addr()

static nsaddr_t UwFlooding::str2addr ( const char )
staticprotected

Returns a nsaddr_t address from an IP written as a string in the form "x.x.x.x".

Parameters
char*IP in string form
Returns
nsaddr_t that contains the IP converter from the input string

◆ writePathInTrace()

void UwFlooding::writePathInTrace ( const Packet p,
const string _info 
)
protectedvirtual

Writes in the Path Trace file the path contained in the Packet.

Parameters
Packetto analyze.

Definition at line 389 of file uwflooding.cpp.

Member Data Documentation

◆ ipAddr_

uint8_t UwFlooding::ipAddr_
private

Definition at line 158 of file uwflooding.h.

◆ maximum_cache_time_

double UwFlooding::maximum_cache_time_
private

Validity time of a packet entry.

Definition at line 160 of file uwflooding.h.

◆ my_forwarded_packets_

map_forwarded_packets UwFlooding::my_forwarded_packets_
private

Map of the packet forwarded.

Definition at line 181 of file uwflooding.h.

◆ optimize_

int UwFlooding::optimize_
private

Flag used to enable the mechanism to drop packets processed twice.

Definition at line 161 of file uwflooding.h.

◆ osstream_

ostringstream UwFlooding::osstream_
private

Used to convert to string.

Definition at line 172 of file uwflooding.h.

◆ packets_forwarded_

long UwFlooding::packets_forwarded_
private

Number of packets forwarded by this module.

Definition at line 163 of file uwflooding.h.

◆ trace_file_path_

ofstream UwFlooding::trace_file_path_
private

Ofstream used to write the path trace file in the disk.

Definition at line 170 of file uwflooding.h.

◆ trace_file_path_name_

char* UwFlooding::trace_file_path_name_
private

Name of the trace file that contains the list of paths of the data packets received.

Definition at line 167 of file uwflooding.h.

◆ trace_path_

bool UwFlooding::trace_path_
private

Flag used to enable or disable the path trace file for nodes,.

Definition at line 164 of file uwflooding.h.

◆ ttl_

int UwFlooding::ttl_
private

Time to leave of the UWFLOODING packets.

Definition at line 159 of file uwflooding.h.

◆ ttl_traffic_map

std::map<uint16_t,uint8_t> UwFlooding::ttl_traffic_map
private

Map with ttl per traffic.

Definition at line 183 of file uwflooding.h.


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