ns-3
ns3::dsr::DsrOptionRrep Class Reference

Dsr Option Route Reply. More...

#include <dsr-options.h>

Inheritance diagram for ns3::dsr::DsrOptionRrep:
Collaboration diagram for ns3::dsr::DsrOptionRrep:

List of all members.

Public Member Functions

virtual TypeId GetInstanceTypeId () const
 Get the instance type ID.
 DsrOptionRrep ()
 Constructor.
virtual ~DsrOptionRrep ()
 Destructor.
virtual uint8_t GetOptionNumber () const
 Get the option number.
virtual uint8_t Process (Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc)
 Process method.
- Public Member Functions inherited from ns3::dsr::DsrOptions
 DsrOptions ()
 Constructor.
virtual ~DsrOptions ()
 Destructor.
void SetNode (Ptr< Node > node)
 Set the node.
Ptr< NodeGetNode () const
 Get the node.
bool ContainAddressAfter (Ipv4Address ipv4Address, Ipv4Address destAddress, std::vector< Ipv4Address > &nodeList)
 Search for the ipv4 address in the node list.
std::vector< Ipv4AddressCutRoute (Ipv4Address ipv4Address, std::vector< Ipv4Address > &nodeList)
 Cut the route from ipv4Address to the end of the route vector.
virtual Ptr< Ipv4RouteSetRoute (Ipv4Address nextHop, Ipv4Address srcAddress)
bool ReverseRoutes (std::vector< Ipv4Address > &vec)
 Reverse the routes.
Ipv4Address SearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Ipv4Address ReverseSearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
void PrintVector (std::vector< Ipv4Address > &vec)
bool IfDuplicates (std::vector< Ipv4Address > &vec, std::vector< Ipv4Address > &vec2)
bool CheckDuplicates (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
void RemoveDuplicates (std::vector< Ipv4Address > &vec)
void ScheduleReply (Ptr< Packet > &packet, std::vector< Ipv4Address > &nodeList, Ipv4Address &source, Ipv4Address &destination)
uint32_t GetIDfromIP (Ipv4Address address)
Ptr< NodeGetNodeWithAddress (Ipv4Address ipv4Address)
- Public Member Functions inherited from ns3::Object
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type identificator.

Static Public Attributes

static const uint8_t OPT_NUMBER = 2
 Router alert option number.

Additional Inherited Members

- Protected Attributes inherited from ns3::dsr::DsrOptions
TracedCallback< Ptr< const
Packet > > 
m_dropTrace
 Drop trace callback.
Ipv4Address Broadcast
 The broadcast IP address.
Ptr< dsr::RreqTablem_rreqTable
 The route request table.
Ptr< Ipv4Routem_ipv4Route
 The ipv4 route.
std::vector< Ipv4Addressm_ipv4Address
 The vector of Ipv4 address.
std::vector< Ipv4Addressm_finalRoute
 The vector of final Ipv4 address.
Time ActiveRouteTimeout
 The active route timeout value.
TracedCallback< const
DsrOptionSRHeader & > 
m_rxPacketTrace

Detailed Description

Dsr Option Route Reply.


Member Function Documentation

TypeId ns3::dsr::DsrOptionRrep::GetInstanceTypeId ( void  ) const
virtual

Get the instance type ID.

Returns:
instance type ID

Reimplemented from ns3::Object.

References GetTypeId().

uint8_t ns3::dsr::DsrOptionRrep::GetOptionNumber ( ) const
virtual

Get the option number.

Returns:
option number

Implements ns3::dsr::DsrOptions.

References NS_LOG_FUNCTION_NOARGS, and OPT_NUMBER.

TypeId ns3::dsr::DsrOptionRrep::GetTypeId ( void  )
static

Get the type identificator.

This method returns the TypeId associated to ns3::dsr::DsrOptionRrep.

Returns:
type identificator

No Attributes defined for this type.
Attributes defined in parent class ns3::dsr::DsrOptions:

No TraceSources defined for this type.
TraceSources defined in parent class ns3::dsr::DsrOptions:

  • Rx: Receive DSR packet.

Reimplemented from ns3::dsr::DsrOptions.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

uint8_t ns3::dsr::DsrOptionRrep::Process ( Ptr< Packet packet,
Ptr< Packet dsrP,
Ipv4Address  ipv4Address,
Ipv4Address  source,
Ipv4Header const &  ipv4Header,
uint8_t  protocol,
bool &  isPromisc 
)
virtual

Process method.

Called from DsrRouting::Receive.

Parameters:
packetthe packet
dsrPthe clean packet with payload
ipv4Headerthe IPv4 header of packet received
protocolthe protocol number of the up layer
isPromiscif the packet must be dropped
Returns:
the processed size

Get the destination address, which is the last element in the nodeList

Get the destination address for the data packet, which is the last element in the nodeList

Add the newly found route to the route cache The route looks like: \ "srcAddress" + "intermediate node address" + "targetAddress"

Found a route the dst, construct the source route option header

Schedule the packet retry

Implements ns3::dsr::DsrOptions.

References ns3::dsr::DsrOptions::ActiveRouteTimeout, ns3::dsr::DsrOptionField::AddDsrOption(), ns3::Packet::AddHeader(), ns3::Packet::Copy(), ns3::Packet::CopyData(), ns3::dsr::DsrOptions::CutRoute(), ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrOptionRrepHeader::GetNodesAddress(), ns3::Object::GetObject(), ns3::dsr::DsrOptionRrepHeader::GetSerializedSize(), ns3::dsr::DsrOptions::m_dropTrace, ns3::dsr::DsrOptions::m_ipv4Route, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::RemoveHeader(), ns3::dsr::DsrFsHeader::SetDestId(), ns3::dsr::DsrFsHeader::SetMessageType(), ns3::dsr::DsrFsHeader::SetNextHeader(), ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionRrepHeader::SetNumberAddress(), ns3::dsr::DsrFsHeader::SetPayloadLength(), and ns3::dsr::DsrFsHeader::SetSourceId().


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