A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::dsr::DsrOptions Class Referenceabstract

#include <introspected-doxygen.h>

+ Inheritance diagram for ns3::dsr::DsrOptions:

Public Member Functions

 DsrOptions ()
 Constructor.
 
virtual ~DsrOptions ()
 Destructor.
 
bool CheckDuplicates (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Check if the route already contains the node ip address. More...
 
bool ContainAddressAfter (Ipv4Address ipv4Address, Ipv4Address destAddress, std::vector< Ipv4Address > &nodeList)
 Search for the ipv4 address in the node list. More...
 
std::vector< Ipv4AddressCutRoute (Ipv4Address ipv4Address, std::vector< Ipv4Address > &nodeList)
 Cut the route from ipv4Address to the end of the route vector. More...
 
uint32_t GetIDfromIP (Ipv4Address address)
 Get the node id with Ipv4Address. More...
 
Ptr< NodeGetNode () const
 Get the node. More...
 
Ptr< NodeGetNodeWithAddress (Ipv4Address ipv4Address)
 Get the node object with Ipv4Address. More...
 
virtual uint8_t GetOptionNumber () const =0
 Get the option number. More...
 
bool IfDuplicates (std::vector< Ipv4Address > &vec, std::vector< Ipv4Address > &vec2)
 Check if the two vectors contain duplicate or not. More...
 
void PrintVector (std::vector< Ipv4Address > &vec)
 Print out the elements in the route vector.
 
virtual uint8_t Process (Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)=0
 Process method. More...
 
void RemoveDuplicates (std::vector< Ipv4Address > &vec)
 
bool ReverseRoutes (std::vector< Ipv4Address > &vec)
 Reverse the routes. More...
 
Ipv4Address ReverseSearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Reverse search for the next hop in the route. More...
 
Ipv4Address ReverseSearchNextTwoHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Reverse search for the next two hop in the route. More...
 
void ScheduleReply (Ptr< Packet > &packet, std::vector< Ipv4Address > &nodeList, Ipv4Address &source, Ipv4Address &destination)
 Schedule the intermediate node route request broadcast. More...
 
Ipv4Address SearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Search for the next hop in the route. More...
 
void SetNode (Ptr< Node > node)
 Set the node. More...
 
virtual Ptr< Ipv4RouteSetRoute (Ipv4Address nextHop, Ipv4Address srcAddress)
 Set the route to use for data packets. More...
 
- Public Member Functions inherited from ns3::Object
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 
- Public Member Functions inherited from ns3::ObjectBase
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
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 (void)
 Get the type identificator. More...
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 

Protected Attributes

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

Private Attributes

Ptr< Nodem_node
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 
virtual void DoInitialize (void)
 
virtual void NotifyNewAggregate (void)
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 

Detailed Description

Doxygen introspection did not find any typical Config paths.

Attributes

TraceSources

  • Rx: Receive DSR packet.

Definition at line 74 of file dsr-options.h.

Member Function Documentation

bool ns3::dsr::DsrOptions::CheckDuplicates ( Ipv4Address  ipv4Address,
std::vector< Ipv4Address > &  vec 
)

Check if the route already contains the node ip address.

Returns
true if it already exists

Definition at line 279 of file dsr-options.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRreq::Process().

bool ns3::dsr::DsrOptions::ContainAddressAfter ( Ipv4Address  ipv4Address,
Ipv4Address  destAddress,
std::vector< Ipv4Address > &  nodeList 
)

Search for the ipv4 address in the node list.

Returns
true if contain ip address

Definition at line 106 of file dsr-options.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionSR::Process().

std::vector< Ipv4Address > ns3::dsr::DsrOptions::CutRoute ( Ipv4Address  ipv4Address,
std::vector< Ipv4Address > &  nodeList 
)

Cut the route from ipv4Address to the end of the route vector.

Returns
the vector after the route cut

Definition at line 122 of file dsr-options.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRrep::Process().

uint32_t ns3::dsr::DsrOptions::GetIDfromIP ( Ipv4Address  address)

Get the node id with Ipv4Address.

Returns
the id of the node

Definition at line 341 of file dsr-options.cc.

References ns3::NodeList::GetNNodes(), ns3::NodeList::GetNode(), ns3::Object::GetObject(), and NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRreq::Process(), and ns3::dsr::DsrOptionRrep::Process().

Ptr< Node > ns3::dsr::DsrOptions::GetNode ( void  ) const

Get the node.

Returns
the node

Definition at line 100 of file dsr-options.cc.

References NS_LOG_FUNCTION_NOARGS.

virtual uint8_t ns3::dsr::DsrOptions::GetOptionNumber ( ) const
pure virtual
TypeId ns3::dsr::DsrOptions::GetTypeId ( void  )
static

Get the type identificator.

Returns
type identificator

Definition at line 70 of file dsr-options.cc.

References GetOptionNumber(), m_rxPacketTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().

bool ns3::dsr::DsrOptions::IfDuplicates ( std::vector< Ipv4Address > &  vec,
std::vector< Ipv4Address > &  vec2 
)

Check if the two vectors contain duplicate or not.

Returns
true if contains duplicate

Definition at line 259 of file dsr-options.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRreq::Process().

virtual uint8_t ns3::dsr::DsrOptions::Process ( Ptr< Packet packet,
Ptr< Packet dsrP,
Ipv4Address  ipv4Address,
Ipv4Address  source,
Ipv4Header const &  ipv4Header,
uint8_t  protocol,
bool &  isPromisc,
Ipv4Address  promiscSource 
)
pure 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

Implemented in ns3::dsr::DsrOptionAck, ns3::dsr::DsrOptionAckReq, ns3::dsr::DsrOptionRerr, ns3::dsr::DsrOptionSR, ns3::dsr::DsrOptionRrep, ns3::dsr::DsrOptionRreq, ns3::dsr::DsrOptionPadn, and ns3::dsr::DsrOptionPad1.

bool ns3::dsr::DsrOptions::ReverseRoutes ( std::vector< Ipv4Address > &  vec)

Reverse the routes.

Returns
true if successfully reversed

Definition at line 144 of file dsr-options.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRreq::Process().

Ipv4Address ns3::dsr::DsrOptions::ReverseSearchNextHop ( Ipv4Address  ipv4Address,
std::vector< Ipv4Address > &  vec 
)

Reverse search for the next hop in the route.

Returns
the previous next hop address if found

Definition at line 194 of file dsr-options.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRreq::Process(), and ns3::dsr::DsrOptionRrep::Process().

Ipv4Address ns3::dsr::DsrOptions::ReverseSearchNextTwoHop ( Ipv4Address  ipv4Address,
std::vector< Ipv4Address > &  vec 
)

Reverse search for the next two hop in the route.

Returns
the previous next two hop address if found

Definition at line 220 of file dsr-options.cc.

References NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.

void ns3::dsr::DsrOptions::ScheduleReply ( Ptr< Packet > &  packet,
std::vector< Ipv4Address > &  nodeList,
Ipv4Address source,
Ipv4Address destination 
)

Schedule the intermediate node route request broadcast.

Parameters
theoriginal packet
rrepHeaderThe rrep header
sourceaddress
destinationaddress
Ipv4Address ns3::dsr::DsrOptions::SearchNextHop ( Ipv4Address  ipv4Address,
std::vector< Ipv4Address > &  vec 
)

Search for the next hop in the route.

Returns
the next hop address if found

Definition at line 162 of file dsr-options.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Referenced by ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionRrep::Process(), and ns3::dsr::DsrOptionSR::Process().

void ns3::dsr::DsrOptions::SetNode ( Ptr< Node node)

Set the node.

Parameters
nodethe node to set

Definition at line 94 of file dsr-options.cc.

References NS_LOG_FUNCTION.

Ptr< Ipv4Route > ns3::dsr::DsrOptions::SetRoute ( Ipv4Address  nextHop,
Ipv4Address  srcAddress 
)
virtual

Set the route to use for data packets.

Returns
the route by the option headers when sending data/control packets

Definition at line 134 of file dsr-options.cc.

References m_ipv4Route, NS_LOG_FUNCTION, ns3::Ipv4Route::SetDestination(), ns3::Ipv4Route::SetGateway(), and ns3::Ipv4Route::SetSource().

Referenced by ns3::dsr::DsrOptionRerr::DoSendError(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionRrep::Process(), and ns3::dsr::DsrOptionSR::Process().

Member Data Documentation

TracedCallback<const DsrOptionSRHeader &> ns3::dsr::DsrOptions::m_rxPacketTrace
protected

The receive trace back, only triggered when final destination receive data packet

Definition at line 231 of file dsr-options.h.

Referenced by GetTypeId().


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