Class shared between wsn nodes used to track how the onion is transiting in the WSN The class uses two counters m_onionSeq and m_hopCount to identify when an onion neeeds to be aborted.
More...
#include "onionvalidator.h"
Inheritance diagram for ns3::OnionValidator:
Collaboration diagram for ns3::OnionValidator:Public Member Functions | |
| OnionValidator () | |
| Default constructor. More... | |
| ~OnionValidator () | |
| Default destructor. More... | |
| bool | CheckOnionReceived (int hop) |
Called by the sensor nodes when the m_onionTimeout elapses IF m_hopCount is equal to hop then the onion was not received by the next hop Therefore abort the onion. More... | |
| int | GetOnionSeq (void) |
| Return the current onion sequence number (the onionId) More... | |
| int | OnionHopCount (void) |
| Return the current hop sequence number. More... | |
| void | OnionReceived (void) |
| The onion was correctly received, increment the hop count. More... | |
| bool | OnionStatus (void) |
| Called by the sink node to check if the onion is still running or is aborted. More... | |
| void | StartOnion (int seq_n) |
Called by the sink node, set up the m_onionSeq to the onionId value for keeping track of the onion. More... | |
Static Public Member Functions | |
| static TypeId | GetTypeId (void) |
Public Attributes | |
| int | m_hopCount |
| a sequence number incremented each time a node correctly receives an onion message More... | |
| int | m_onionSeq = 0 |
| the onionId of the onion currently transiting the network More... | |
Class shared between wsn nodes used to track how the onion is transiting in the WSN The class uses two counters m_onionSeq and m_hopCount to identify when an onion neeeds to be aborted.
Definition at line 55 of file onionvalidator.h.
| ns3::OnionValidator::OnionValidator | ( | ) |
Default constructor.
Definition at line 41 of file onionvalidator.cc.
| ns3::OnionValidator::~OnionValidator | ( | ) |
Default destructor.
Definition at line 45 of file onionvalidator.cc.
| bool ns3::OnionValidator::CheckOnionReceived | ( | int | hop | ) |
Called by the sensor nodes when the m_onionTimeout elapses IF m_hopCount is equal to hop then the onion was not received by the next hop Therefore abort the onion.
| [in] | hop | the m_hopCount number set when the onion was forwarded to the next node |
Definition at line 78 of file onionvalidator.cc.
References m_hopCount, and m_onionSeq.
| int ns3::OnionValidator::GetOnionSeq | ( | void | ) |
Return the current onion sequence number (the onionId)
Definition at line 99 of file onionvalidator.cc.
References m_onionSeq.
|
static |
Definition at line 34 of file onionvalidator.cc.
| int ns3::OnionValidator::OnionHopCount | ( | void | ) |
Return the current hop sequence number.
Definition at line 92 of file onionvalidator.cc.
References m_hopCount.
| void ns3::OnionValidator::OnionReceived | ( | void | ) |
The onion was correctly received, increment the hop count.
Definition at line 106 of file onionvalidator.cc.
References m_hopCount.
| bool ns3::OnionValidator::OnionStatus | ( | void | ) |
Called by the sink node to check if the onion is still running or is aborted.
Definition at line 59 of file onionvalidator.cc.
References m_onionSeq.
| void ns3::OnionValidator::StartOnion | ( | int | seq_n | ) |
Called by the sink node, set up the m_onionSeq to the onionId value for keeping track of the onion.
| [in] | seq_n | the onion ID |
Definition at line 52 of file onionvalidator.cc.
References m_onionSeq.
| int ns3::OnionValidator::m_hopCount |
a sequence number incremented each time a node correctly receives an onion message
Definition at line 133 of file onionvalidator.h.
Referenced by CheckOnionReceived(), OnionHopCount(), and OnionReceived().
| int ns3::OnionValidator::m_onionSeq = 0 |
the onionId of the onion currently transiting the network
Definition at line 131 of file onionvalidator.h.
Referenced by CheckOnionReceived(), GetOnionSeq(), OnionStatus(), and StartOnion().