#include <uwflooding-sec.h>
|
| static nsaddr_t | str2addr (const char *) |
| |
| static string | printIP (const nsaddr_t &) |
| |
UwFloodingSec class is used to represent the routing layer of a node.
◆ map_forwarded_packets
Typedef for a map of the packet forwarded (saddr, map_packets).
◆ map_packets
Typedef for a packet id: (serial_number, timestamp).
◆ neighbor_map
Typdef for a map of the neighbor with the number of packets received from him.
◆ neighbor_timer_map
Typedef for the forwardig timer of the neigbors.
◆ UwFloodingSec() [1/2]
| UwFloodingSec::UwFloodingSec |
( |
| ) |
|
◆ ~UwFloodingSec()
| UwFloodingSec::~UwFloodingSec |
( |
| ) |
|
|
virtual |
◆ UwFloodingSec() [2/2]
Copy constructor declared as private. It is not possible to create a new UwFloodingSec object passing to its constructor another UwFloodingSec object.
- Parameters
-
◆ addToNeighbor()
| void UwFloodingSec::addToNeighbor |
( |
uint8_t |
neighbor_addr | ) |
|
|
protected |
◆ checkUnconfirmedPkt()
| bool UwFloodingSec::checkUnconfirmedPkt |
( |
uint8_t |
neighbor_addr, |
|
|
int |
uid |
|
) |
| |
|
protected |
Check if the received packets is an unconfirmed one.
- Parameters
-
| neighbor_addr | IP address of the neighbor |
| uid | uinique id of the received packet |
- Returns
- true if the packets was between the unchecked, false otherwise
References neighbor_tmr.
Referenced by recvSyncClMsg().
◆ command()
| int UwFloodingSec::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
protectedvirtual |
TCL command interpreter. It implements the following OTcl methods:
- Parameters
-
| argc | Number of arguments in argv. |
| argv | Array 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.
References ipAddr_, packets_forwarded_, printNeighbor(), reputation, stats_phy_id, trace_file_path_, trace_file_path_name_, trace_path_, ttl_traffic_map, use_reputation, and valid_phy_id.
◆ getTTL()
| uint8_t UwFloodingSec::getTTL |
( |
Packet * |
p | ) |
const |
|
private |
◆ printIP()
| string UwFloodingSec::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
-
- Returns
- String that contains a printable IP in the classic form "x.x.x.x"
◆ printNeighbor()
| void UwFloodingSec::printNeighbor |
( |
| ) |
|
|
protected |
◆ recv()
| void UwFloodingSec::recv |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Performs the reception of packets from upper and lower layers.
- Parameters
-
| Packet* | Pointer to the packet will be received. |
References addToNeighbor(), hdr_uwip::daddr(), getTTL(), ipAddr_, maximum_cache_time_, my_forwarded_packets_, optimize_, packets_forwarded_, prev_hop_temp, hdr_uwip::saddr(), sendDown(), trace_path_, hdr_uwflooding::ttl(), use_reputation, and writePathInTrace().
◆ recvAsyncClMsg()
| int UwFloodingSec::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.
◆ recvSyncClMsg()
| int UwFloodingSec::recvSyncClMsg |
( |
ClMessage * |
m | ) |
|
|
protectedvirtual |
◆ retrieveInstantNoise()
| void UwFloodingSec::retrieveInstantNoise |
( |
int |
neighbor_addr | ) |
|
|
protected |
◆ sendDown()
| void UwFloodingSec::sendDown |
( |
Packet * |
p, |
|
|
double |
delay = 0 |
|
) |
| |
|
protected |
◆ sendStatsClMsg()
| void UwFloodingSec::sendStatsClMsg |
( |
int |
neighbor_addr | ) |
|
|
protectedvirtual |
Send ClMsgStats message when triggered by the reception of an overherd packets. The ClMsg is sent in unicast only to the module which sent the trigger message
- Parameters
-
| neighbor_addr | IP address of the neighbor |
References addToNeighbor(), UwPhysicalStats::has_error, ipAddr_, UwPhysicalStats::last_interf_power, UwPhysicalStats::last_noise_power, UwPhysicalStats::last_rx_power, neighbor_tmr, stats_phy_id, StatsEnum::STATS_PHY_LAYER, use_reputation, and valid_phy_id.
Referenced by recvSyncClMsg().
◆ str2addr()
| static nsaddr_t UwFloodingSec::str2addr |
( |
const char * |
| ) |
|
|
staticprotected |
Returns a nsaddr_t address from an IP written as a string in the form "x.x.x.x".
- Parameters
-
- Returns
- nsaddr_t that contains the IP converter from the input string
◆ writePathInTrace()
| void UwFloodingSec::writePathInTrace |
( |
const Packet * |
p, |
|
|
const string & |
_info |
|
) |
| |
|
protectedvirtual |
◆ NeighborReputationHandler
◆ alpha_snr
| double UwFloodingSec::alpha_snr |
|
private |
◆ fwd_to
| double UwFloodingSec::fwd_to |
|
private |
◆ ipAddr_
| uint8_t UwFloodingSec::ipAddr_ |
|
private |
◆ maximum_cache_time_
| double UwFloodingSec::maximum_cache_time_ |
|
private |
◆ my_forwarded_packets_
Map of the packet forwarded.
Referenced by recv().
◆ neighbor
◆ neighbor_tmr
◆ optimize_
| int UwFloodingSec::optimize_ |
|
private |
Flag used to enable the mechanism to drop packets processed twice.
Referenced by recv(), and UwFloodingSec().
◆ osstream_
| ostringstream UwFloodingSec::osstream_ |
|
private |
◆ packets_forwarded_
| long UwFloodingSec::packets_forwarded_ |
|
private |
Number of packets forwarded by this module.
Referenced by command(), and recv().
◆ prev_hop_temp
| uint8_t UwFloodingSec::prev_hop_temp |
|
private |
Previous hop IP address of the last received packet.
Referenced by recv(), and sendDown().
◆ reputation
| UwReputationInterface* UwFloodingSec::reputation |
|
private |
◆ stats_phy_id
| int UwFloodingSec::stats_phy_id |
|
private |
◆ trace_file_path_
| ofstream UwFloodingSec::trace_file_path_ |
|
private |
◆ trace_file_path_name_
| char* UwFloodingSec::trace_file_path_name_ |
|
private |
◆ trace_path_
| bool UwFloodingSec::trace_path_ |
|
private |
Flag used to enable or disable the path trace file for nodes,
Referenced by command(), and recv().
◆ ttl_
◆ ttl_traffic_map
| std::map<uint16_t, uint8_t> UwFloodingSec::ttl_traffic_map |
|
private |
◆ use_reputation
| bool UwFloodingSec::use_reputation |
|
private |
◆ valid_phy_id
| bool UwFloodingSec::valid_phy_id |
|
private |
The documentation for this class was generated from the following files: