dsr: doxygen updates
This commit is contained in:
@@ -209,13 +209,29 @@ public:
|
||||
* \return true if entry added
|
||||
*/
|
||||
bool Enqueue (DsrErrorBuffEntry & entry);
|
||||
/// Return first found (the earliest) entry for given destination
|
||||
/**
|
||||
* Return first found (the earliest) entry for given destination
|
||||
* \param [in] dst The destination to look for
|
||||
* \param [out] entry The entry
|
||||
* \return true if an entry is found
|
||||
*/
|
||||
bool Dequeue (Ipv4Address dst, DsrErrorBuffEntry & entry);
|
||||
/// Remove all packets with the error link
|
||||
/**
|
||||
* Remove all packets with the error link
|
||||
* \param source The source
|
||||
* \param nextHop The next hop
|
||||
*/
|
||||
void DropPacketForErrLink (Ipv4Address source, Ipv4Address nextHop);
|
||||
/// Finds whether a packet with destination dst exists in the queue
|
||||
/**
|
||||
* Finds whether a packet with destination dst exists in the queue
|
||||
* \param dst The destination
|
||||
* \return true if a packet is found.
|
||||
*/
|
||||
bool Find (Ipv4Address dst);
|
||||
/// Number of entries
|
||||
/**
|
||||
* Returns the number of entries in the queue.
|
||||
* \return the number of entries in the queue.
|
||||
*/
|
||||
uint32_t GetSize ();
|
||||
|
||||
// Fields
|
||||
@@ -265,15 +281,30 @@ private:
|
||||
std::vector<DsrErrorBuffEntry> m_errorBuffer;
|
||||
/// Remove all expired entries
|
||||
void Purge ();
|
||||
/// Notify that packet is dropped from queue by timeout
|
||||
/**
|
||||
* Notify that packet is dropped from queue by timeout
|
||||
* \param en Error Buffer Entry
|
||||
* \param reason Drop reason.
|
||||
*/
|
||||
///
|
||||
void Drop (DsrErrorBuffEntry en, std::string reason);
|
||||
/// Notify that packet is dropped from queue by timeout
|
||||
/**
|
||||
* Notify that packet is dropped from queue by link error
|
||||
* \param en Error Buffer Entry
|
||||
* \param reason Drop reason.
|
||||
*/
|
||||
void DropLink (DsrErrorBuffEntry en, std::string reason);
|
||||
/// The maximum number of packets that we allow a routing protocol to buffer.
|
||||
uint32_t m_maxLen;
|
||||
/// The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
|
||||
Time m_errorBufferTimeout;
|
||||
/// Check if the send buffer entry is the same or not
|
||||
/**
|
||||
* Check if the send buffer entry is the same or not
|
||||
* \param en Buffer Entry
|
||||
* \param link Link description.
|
||||
* \return true if the entry is compatible with the link description (source and next hop)
|
||||
*/
|
||||
///
|
||||
static bool LinkEqual (DsrErrorBuffEntry en, const std::vector<Ipv4Address> link)
|
||||
{
|
||||
return ((en.GetSource () == link[0]) && (en.GetNextHop () == link[1]));
|
||||
|
||||
@@ -56,7 +56,7 @@ struct GraReplyEntry
|
||||
*
|
||||
* \param t IPv4 address to reply to
|
||||
* \param f IPv4 address to hear from
|
||||
* \param h gratitious hold off time
|
||||
* \param h gratuitous hold off time
|
||||
*/
|
||||
GraReplyEntry (Ipv4Address t, Ipv4Address f, Time h)
|
||||
: m_replyTo (t),
|
||||
@@ -82,18 +82,26 @@ public:
|
||||
virtual ~DsrGraReply ();
|
||||
|
||||
/// Set the gratuitous reply table size
|
||||
/// \param g The gratuitous reply table size
|
||||
void SetGraTableSize (uint32_t g)
|
||||
{
|
||||
GraReplyTableSize = g;
|
||||
}
|
||||
/// Get the gratuitous reply table size
|
||||
/// \returns The gratuitous reply table size
|
||||
uint32_t GetGraTableSize () const
|
||||
{
|
||||
return GraReplyTableSize;
|
||||
}
|
||||
/// Add a new gratuitous reply entry
|
||||
/// \param graTableEntry The gratuitous reply entry
|
||||
/// \return true on success
|
||||
bool AddEntry (GraReplyEntry & graTableEntry);
|
||||
/// Update the route entry if found, create a new one if not
|
||||
/// Update the route entry if found
|
||||
/// \param replyTo Entry directed to
|
||||
/// \param replyFrom Entry heard from
|
||||
/// \param gratReplyHoldoff New gratuitous reply holdoff time
|
||||
/// \return true on success
|
||||
bool FindAndUpdate (Ipv4Address replyTo, Ipv4Address replyFrom, Time gratReplyHoldoff);
|
||||
/// Remove all expired entries
|
||||
void Purge ();
|
||||
|
||||
@@ -401,14 +401,23 @@ public:
|
||||
{
|
||||
}
|
||||
/// Push entry in queue, if there is no entry with the same packet and destination address in queue.
|
||||
/// \param entry Maintain Buffer Entry
|
||||
/// \return true on success adding the Entry.
|
||||
bool Enqueue (DsrMaintainBuffEntry & entry);
|
||||
/// Return first found (the earliest) entry for given destination
|
||||
/// \param [in] dst Entry destination
|
||||
/// \param [out] entry The Entry found (if any).
|
||||
/// \return true on success
|
||||
bool Dequeue (Ipv4Address dst, DsrMaintainBuffEntry & entry);
|
||||
/// Remove all packets with destination IP address dst
|
||||
/// Remove all packets with next hop IP address dst
|
||||
/// \param nextHop Next hop in the route.
|
||||
void DropPacketWithNextHop (Ipv4Address nextHop);
|
||||
/// Finds whether a packet with destination dst exists in the queue
|
||||
/// Finds whether a packet with next hop dst exists in the queue
|
||||
/// \param nextHop Next hop in the route.
|
||||
/// \return true if there is a packet directed to the next hop.
|
||||
bool Find (Ipv4Address nextHop);
|
||||
/// Number of entries
|
||||
/// \return The number of entries.
|
||||
uint32_t GetSize ();
|
||||
|
||||
// Fields
|
||||
@@ -444,13 +453,23 @@ public:
|
||||
{
|
||||
m_maintainBufferTimeout = t;
|
||||
}
|
||||
/// Verify if all the elements in the maintainence buffer entry is the same
|
||||
/// Verify if all the elements in the maintenance buffer entry is the same
|
||||
/// \note For real this function checks if at most one entry is equal. If it is,
|
||||
/// that entry is removed. Further entries are NOT checked. This could be a bug.
|
||||
/// \param entry The Entry to check
|
||||
/// \return true if an Entry was found and removed.
|
||||
bool AllEqual (DsrMaintainBuffEntry & entry);
|
||||
/// Verify if the maintain buffer entry is the same in every field for link ack
|
||||
/// \param entry The Entry to check
|
||||
/// \return true if an Entry was found and removed.
|
||||
bool LinkEqual (DsrMaintainBuffEntry & entry);
|
||||
/// Verify if the maintain buffer entry is the same in every field for network ack
|
||||
/// \param entry The Entry to check
|
||||
/// \return true if an Entry was found and removed.
|
||||
bool NetworkEqual (DsrMaintainBuffEntry & entry);
|
||||
/// Verify if the maintain buffer entry is the same in every field for promiscuous ack
|
||||
/// \param entry The Entry to check
|
||||
/// \return true if an Entry was found and removed.
|
||||
bool PromiscEqual (DsrMaintainBuffEntry & entry);
|
||||
|
||||
private:
|
||||
@@ -465,6 +484,9 @@ private:
|
||||
/// The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
|
||||
Time m_maintainBufferTimeout;
|
||||
/// Verify if the maintain buffer is equal or not
|
||||
/// \param en The Entry to check
|
||||
/// \param nextHop The next hop to check
|
||||
/// \return true if an Entry next hop is equal to the function second parameter
|
||||
static bool IsEqual (DsrMaintainBuffEntry en, const Ipv4Address nextHop)
|
||||
{
|
||||
return (en.GetNextHop () == nextHop);
|
||||
|
||||
@@ -774,6 +774,7 @@ public:
|
||||
virtual Ipv4Address GetErrorSrc () const;
|
||||
/**
|
||||
* \brief Set the salvage value of the packet
|
||||
* \param salvage The salvage value of the packet
|
||||
*/
|
||||
virtual void SetSalvage (uint8_t salvage);
|
||||
/**
|
||||
@@ -909,6 +910,7 @@ public:
|
||||
virtual Ipv4Address GetErrorSrc () const;
|
||||
/**
|
||||
* \brief Set the salvage value of the packet
|
||||
* \param salvage The salvage value of the packet
|
||||
*/
|
||||
virtual void SetSalvage (uint8_t salvage);
|
||||
/**
|
||||
|
||||
@@ -161,6 +161,7 @@ public:
|
||||
Ipv4Address ReverseSearchNextTwoHop (Ipv4Address ipv4Address, std::vector<Ipv4Address>& vec);
|
||||
/**
|
||||
* \brief Print out the elements in the route vector
|
||||
* \param vec The route vector to print.
|
||||
*/
|
||||
void PrintVector (std::vector<Ipv4Address>& vec);
|
||||
/**
|
||||
|
||||
@@ -268,14 +268,26 @@ public:
|
||||
virtual ~DsrPassiveBuffer ();
|
||||
|
||||
/// Push entry in queue, if there is no entry with the same packet and destination address in queue.
|
||||
/// \param entry Buffer Entry
|
||||
/// \return true on success adding the Entry.
|
||||
bool Enqueue (DsrPassiveBuffEntry & entry);
|
||||
/// Return first found (the earliest) entry for given destination
|
||||
/// \param [in] dst Entry destination
|
||||
/// \param [out] entry The Entry found (if any).
|
||||
/// \return true on success
|
||||
bool Dequeue (Ipv4Address dst, DsrPassiveBuffEntry & entry);
|
||||
/// Finds whether a packet with destination dst exists in the queue
|
||||
bool Find (Ipv4Address dst);
|
||||
/// \param dst Destination.
|
||||
/// \return true if there is a packet.
|
||||
bool Find (Ipv4Address dst);
|
||||
/// Check if all the entries in passive buffer entry is all equal or not
|
||||
/// \note For real this function checks if at most one entry is equal. If it is,
|
||||
/// that entry is removed. Further entries are NOT checked. This could be a bug.
|
||||
/// \param entry The Entry to check
|
||||
/// \return true if an Entry was found and removed.
|
||||
bool AllEqual (DsrPassiveBuffEntry & entry);
|
||||
/// Number of entries
|
||||
/// \return The number of entries.
|
||||
uint32_t GetSize ();
|
||||
|
||||
// Fields
|
||||
@@ -318,14 +330,21 @@ private:
|
||||
/// Remove all expired entries
|
||||
void Purge ();
|
||||
/// Notify that packet is dropped from queue by timeout
|
||||
/// \param en BuffEntry Buffer entry
|
||||
/// \param reason Drop reason
|
||||
void Drop (DsrPassiveBuffEntry en, std::string reason);
|
||||
/// Notify that packet is dropped from queue by timeout
|
||||
/// \param en BuffEntry Buffer entry
|
||||
/// \param reason Drop reason
|
||||
void DropLink (DsrPassiveBuffEntry en, std::string reason);
|
||||
/// The maximum number of packets that we allow a routing protocol to buffer.
|
||||
uint32_t m_maxLen;
|
||||
/// The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
|
||||
Time m_passiveBufferTimeout;
|
||||
/// Check if the send buffer entry is the same or not
|
||||
/// \param en The Entry to check
|
||||
/// \param link The link to check
|
||||
/// \return true if an Entry source and Next hop are equal to the Link parameters
|
||||
static bool LinkEqual (DsrPassiveBuffEntry en, const std::vector<Ipv4Address> link)
|
||||
{
|
||||
return ((en.GetSource () == link[0]) && (en.GetNextHop () == link[1]));
|
||||
|
||||
@@ -140,6 +140,7 @@ class DsrLinkStab
|
||||
public:
|
||||
/**
|
||||
* \brief Constructor
|
||||
* \param linkStab duration of the link stability
|
||||
*/
|
||||
DsrLinkStab (Time linkStab = Simulator::Now ());
|
||||
/**
|
||||
@@ -231,6 +232,7 @@ public:
|
||||
virtual ~DsrRouteCacheEntry ();
|
||||
|
||||
/// Mark entry as "down" (i.e. disable it)
|
||||
/// \param badLinkLifetime Time before purging the link for real.
|
||||
void Invalidate (Time badLinkLifetime);
|
||||
|
||||
// Fields
|
||||
@@ -317,6 +319,7 @@ public:
|
||||
|
||||
/**
|
||||
* \brief Print necessary fields
|
||||
* \param os the output stream
|
||||
*/
|
||||
void Print (std::ostream & os) const;
|
||||
/**
|
||||
@@ -386,6 +389,7 @@ public:
|
||||
|
||||
/**
|
||||
* \brief Remove the aged route cache entries when the route cache is full
|
||||
* \param rtVector the route cache to scan.
|
||||
*/
|
||||
void RemoveLastEntry (std::list<DsrRouteCacheEntry> & rtVector);
|
||||
/**
|
||||
@@ -614,6 +618,7 @@ public:
|
||||
/// Delete all outdated entries and invalidate valid entry if Lifetime is expired
|
||||
void Purge ();
|
||||
/// Print route cache
|
||||
/// \param os the output stream
|
||||
void Print (std::ostream &os);
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
@@ -715,6 +720,7 @@ public:
|
||||
}
|
||||
|
||||
/// Handle link failure callback
|
||||
/// \param cb the callback to be set
|
||||
void SetCallback (Callback<void, Ipv4Address, uint8_t > cb)
|
||||
{
|
||||
m_handleLinkFailure = cb;
|
||||
@@ -727,14 +733,15 @@ public:
|
||||
|
||||
private:
|
||||
/**
|
||||
* \brief assignment operator
|
||||
* \brief assignment operator - defined but not implemented to avoid misuse.
|
||||
* \return
|
||||
*/
|
||||
DsrRouteCache & operator= (DsrRouteCache const &);
|
||||
DsrRouteCacheEntry::IP_VECTOR m_vector; ///< The route vector to save the ip addresses for intermediate nodes.
|
||||
uint32_t m_maxCacheLen; ///< The maximum number of packets that we allow a routing protocol to buffer.
|
||||
Time RouteCacheTimeout; ///< The maximum period of time that dsr is allowed to for an unused route.
|
||||
Time m_badLinkLifetime; ///< The time for which the neighboring node is put into the blacklist.
|
||||
/**
|
||||
/*
|
||||
* Define the parameters for link cache type
|
||||
*/
|
||||
uint32_t m_stabilityDecrFactor; ///< stability decrease factor
|
||||
@@ -777,7 +784,7 @@ private:
|
||||
* \brief used by LookupRoute when LinkCache
|
||||
* \param id the ip address we are looking for
|
||||
* \param rt the route cache entry to store the found one
|
||||
* \return true if route rute found
|
||||
* \return true if route route found
|
||||
*/
|
||||
bool LookupRoute_Link (Ipv4Address id, DsrRouteCacheEntry & rt);
|
||||
/**
|
||||
@@ -851,9 +858,14 @@ public:
|
||||
|
||||
Time m_delay; ///< This timeout deals with the passive ack
|
||||
|
||||
Mac48Address LookupMacAddress (Ipv4Address); ///< Find MAC address by IP using list of ARP caches
|
||||
/// Find MAC address by IP using list of ARP caches
|
||||
/// \param addr the IPv4 address to look for
|
||||
/// \return The MAC address
|
||||
Mac48Address LookupMacAddress (Ipv4Address addr);
|
||||
|
||||
void ProcessTxError (WifiMacHeader const &); ///< Process layer 2 TX error notification
|
||||
/// Process layer 2 TX error notification
|
||||
/// \param hdr Wi-Fi Mac Header
|
||||
void ProcessTxError (WifiMacHeader const &hdr);
|
||||
};
|
||||
} // namespace dsr
|
||||
} // namespace ns3
|
||||
|
||||
@@ -203,6 +203,7 @@ public:
|
||||
Ptr<Node> GetNodeWithAddress (Ipv4Address ipv4Address);
|
||||
/**
|
||||
* \brief Print the route vector.
|
||||
* \param vec the vector to print.
|
||||
*/
|
||||
void PrintVector (std::vector<Ipv4Address>& vec);
|
||||
/**
|
||||
@@ -394,21 +395,21 @@ public:
|
||||
void SalvagePacket (Ptr<const Packet> packet, Ipv4Address source, Ipv4Address dst, uint8_t protocol);
|
||||
/**
|
||||
* \brief Schedule the packet retransmission based on link-layer acknowledgment
|
||||
* \param mb maintainenace buffer entry
|
||||
* \param mb maintenance buffer entry
|
||||
* \param protocol the protocol number
|
||||
*/
|
||||
void ScheduleLinkPacketRetry (DsrMaintainBuffEntry & mb,
|
||||
uint8_t protocol);
|
||||
/**
|
||||
* \brief Schedule the packet retransmission based on passive acknowledgment
|
||||
* \param mb maintainenace buffer entry
|
||||
* \param mb maintenance buffer entry
|
||||
* \param protocol the protocol number
|
||||
*/
|
||||
void SchedulePassivePacketRetry (DsrMaintainBuffEntry & mb,
|
||||
uint8_t protocol);
|
||||
/**
|
||||
* \brief Schedule the packet retransmission based on network layer acknowledgment
|
||||
* \param mb maintainenace buffer entry
|
||||
* \param mb maintenance buffer entry
|
||||
* \param isFirst see if this is the first packet retry or not
|
||||
* \param protocol the protocol number
|
||||
*/
|
||||
@@ -417,21 +418,35 @@ public:
|
||||
uint8_t protocol);
|
||||
/**
|
||||
* \brief This function deals with packet retransmission timer expire using link acknowledgment
|
||||
* \param mb maintenance buffer entry
|
||||
* \param protocol the protocol number
|
||||
*/
|
||||
void LinkScheduleTimerExpire (DsrMaintainBuffEntry & mb,
|
||||
uint8_t protocol);
|
||||
/**
|
||||
* \brief This function deals with packet retransmission timer expire using network acknowledgment
|
||||
* \param mb maintenance buffer entry
|
||||
* \param protocol the protocol number
|
||||
*/
|
||||
void NetworkScheduleTimerExpire (DsrMaintainBuffEntry & mb,
|
||||
uint8_t protocol);
|
||||
/**
|
||||
* \brief This function deals with packet retransmission timer expire using passive acknowledgment
|
||||
* \param mb maintenance buffer entry
|
||||
* \param protocol the protocol number
|
||||
*/
|
||||
void PassiveScheduleTimerExpire (DsrMaintainBuffEntry & mb,
|
||||
uint8_t protocol);
|
||||
/**
|
||||
* \brief Forward the packet using the route saved in the source route option header
|
||||
* \param packet The packet
|
||||
* \param sourceRoute Source route saved in option header
|
||||
* \param ipv4Header IPv4 Header
|
||||
* \param source source address
|
||||
* \param destination destination address
|
||||
* \param targetAddress target address
|
||||
* \param protocol protocol number
|
||||
* \param route route
|
||||
*/
|
||||
void ForwardPacket (Ptr<const Packet> packet,
|
||||
DsrOptionSRHeader &sourceRoute,
|
||||
@@ -443,6 +458,9 @@ public:
|
||||
Ptr<Ipv4Route> route);
|
||||
/**
|
||||
* \brief Broadcast the route request packet in subnet
|
||||
* \param source source address
|
||||
* \param destination destination address
|
||||
* \param protocol protocol number
|
||||
*/
|
||||
void SendInitialRequest (Ipv4Address source,
|
||||
Ipv4Address destination,
|
||||
@@ -640,6 +658,8 @@ private:
|
||||
void Start ();
|
||||
/**
|
||||
* \brief Send the route error message when the link breaks to the next hop.
|
||||
* \param nextHop next hop address
|
||||
* \param protocol protocol number
|
||||
*/
|
||||
void SendRerrWhenBreaksLinkToNextHop (Ipv4Address nextHop, uint8_t protocol);
|
||||
/**
|
||||
|
||||
@@ -63,13 +63,13 @@ DsrRreqTable::~DsrRreqTable ()
|
||||
}
|
||||
|
||||
void
|
||||
DsrRreqTable::RemoveLeastExpire (std::map<Ipv4Address, RreqTableEntry > & rreqDstMap)
|
||||
DsrRreqTable::RemoveLeastExpire ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
Ipv4Address firstExpire;
|
||||
Time max = Seconds (0.0);
|
||||
for (std::map<Ipv4Address, RreqTableEntry >::const_iterator i =
|
||||
rreqDstMap.begin (); i != rreqDstMap.end (); ++i)
|
||||
m_rreqDstMap.begin (); i != m_rreqDstMap.end (); ++i)
|
||||
{
|
||||
Ipv4Address dst = i->first;
|
||||
RreqTableEntry rreqTableEntry = i->second;
|
||||
@@ -79,7 +79,7 @@ DsrRreqTable::RemoveLeastExpire (std::map<Ipv4Address, RreqTableEntry > & rreqDs
|
||||
firstExpire = dst;
|
||||
}
|
||||
}
|
||||
rreqDstMap.erase (firstExpire);
|
||||
m_rreqDstMap.erase (firstExpire);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -96,7 +96,7 @@ DsrRreqTable::FindAndUpdate (Ipv4Address dst)
|
||||
*/
|
||||
if (m_rreqDstMap.size () >= m_requestTableSize)
|
||||
{
|
||||
RemoveLeastExpire (m_rreqDstMap);
|
||||
RemoveLeastExpire ();
|
||||
NS_LOG_INFO ("The request table size after erase " << (uint32_t)m_rreqDstMap.size ());
|
||||
}
|
||||
RreqTableEntry rreqTableEntry;
|
||||
|
||||
@@ -288,12 +288,16 @@ public:
|
||||
}
|
||||
|
||||
/// Remove the least used entry
|
||||
void RemoveLeastExpire (std::map<Ipv4Address, RreqTableEntry > & rreqDstMap);
|
||||
void RemoveLeastExpire ();
|
||||
/// Find the entry in the route request queue to see if already exists
|
||||
/// \param dst Destination IP
|
||||
void FindAndUpdate (Ipv4Address dst);
|
||||
/// Remove route request entry for dst
|
||||
/// \param dst Destination IP
|
||||
void RemoveRreqEntry (Ipv4Address dst);
|
||||
/// Get the request count number for one destination address
|
||||
/// \param dst Destination IP
|
||||
/// \return the route request counter
|
||||
uint32_t GetRreqCnt (Ipv4Address dst);
|
||||
|
||||
/**
|
||||
|
||||
@@ -251,7 +251,12 @@ public:
|
||||
private:
|
||||
std::vector<DsrSendBuffEntry> m_sendBuffer; ///< The send buffer to cache unsent packet
|
||||
void Purge (); ///< Remove all expired entries
|
||||
void Drop (DsrSendBuffEntry en, std::string reason); ///< Notify that packet is dropped from queue by timeout
|
||||
|
||||
/// Notify that packet is dropped from queue by timeout
|
||||
/// \param en BuffEntry Buffer entry
|
||||
/// \param reason Drop reason
|
||||
void Drop (DsrSendBuffEntry en, std::string reason);
|
||||
|
||||
uint32_t m_maxLen; ///< The maximum number of packets that we allow a routing protocol to buffer.
|
||||
Time m_sendBufferTimeout; ///< The maximum period of time that a routing protocol is allowed to buffer a packet for, seconds.
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,7 @@ using namespace dsr;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* \ingroup dsr-test
|
||||
* \ingroup dsr
|
||||
* \defgroup dsr-test DSR routing module tests
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user