A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::dsr::DsrOptionRerr Class Reference

Dsr Option Route Error. More...

#include "dsr-options.h"

+ Inheritance diagram for ns3::dsr::DsrOptionRerr:
+ Collaboration diagram for ns3::dsr::DsrOptionRerr:

Public Member Functions

 DsrOptionRerr ()
 
 ~DsrOptionRerr () override
 
uint8_t DoSendError (Ptr< Packet > p, DsrOptionRerrUnreachHeader &rerr, uint32_t rerrSize, Ipv4Address ipv4Address, uint8_t protocol)
 Do Send error message.
 
TypeId GetInstanceTypeId () const override
 Get the instance type ID.
 
uint8_t GetOptionNumber () const override
 Get the option number.
 
uint8_t Process (Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, const Ipv4Header &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource) override
 Process method.
 
- Public Member Functions inherited from ns3::dsr::DsrOptions
 DsrOptions ()
 Constructor.
 
 ~DsrOptions () override
 Destructor.
 
bool CheckDuplicates (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Check if the route already contains the node ip address.
 
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.
 
uint32_t GetIDfromIP (Ipv4Address address)
 Get the node id with Ipv4Address.
 
Ptr< NodeGetNode () const
 Get the node.
 
Ptr< NodeGetNodeWithAddress (Ipv4Address ipv4Address)
 Get the node object with Ipv4Address.
 
bool IfDuplicates (std::vector< Ipv4Address > &vec, std::vector< Ipv4Address > &vec2)
 Check if the two vectors contain duplicate or not.
 
void PrintVector (std::vector< Ipv4Address > &vec)
 Print out the elements in the route vector.
 
void RemoveDuplicates (std::vector< Ipv4Address > &vec)
 Remove the duplicates from the route.
 
bool ReverseRoutes (std::vector< Ipv4Address > &vec)
 Reverse the routes.
 
Ipv4Address ReverseSearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Reverse search for the next hop in the route.
 
Ipv4Address ReverseSearchNextTwoHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Reverse search for the next two hop in the route.
 
void ScheduleReply (Ptr< Packet > &packet, std::vector< Ipv4Address > &nodeList, Ipv4Address &source, Ipv4Address &destination)
 Schedule the intermediate node route request broadcast.
 
Ipv4Address SearchNextHop (Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
 Search for the next hop in the route.
 
void SetNode (Ptr< Node > node)
 Set the node.
 
virtual Ptr< Ipv4RouteSetRoute (Ipv4Address nextHop, Ipv4Address srcAddress)
 Set the route to use for data packets, used by the option headers when sending data/control packets.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::dsr::DsrOptions
static TypeId GetTypeId ()
 Get the type identificator.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Static Public Attributes

static const uint8_t OPT_NUMBER = 3
 Dsr Route Error option number.
 

Private Attributes

Ptr< Ipv4m_ipv4
 The ipv4 layer 3.
 
Ptr< dsr::DsrRouteCachem_routeCache
 The route cache.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 
- Protected Attributes inherited from ns3::dsr::DsrOptions
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::DsrRouteCachem_routeCache
 The route cache table.
 
Ptr< dsr::DsrRreqTablem_rreqTable
 The route request table.
 
TracedCallback< const DsrOptionSRHeader & > m_rxPacketTrace
 The receive trace back, only triggered when final destination receive data packet.
 

Detailed Description

Dsr Option Route Error.

Introspection did not find any typical Config paths.


No Attributes are defined for this type.

Attributes defined in parent class ns3::dsr::DsrOptions

  • OptionNumber: The Dsr option number.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Flags: read
    • Support level: SUPPORTED

No TraceSources are defined for this type.

TraceSources defined in parent class ns3::dsr::DsrOptions

Group: Dsr

Size of this type is 224 bytes (on a 64-bit architecture).

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

Constructor & Destructor Documentation

◆ DsrOptionRerr()

ns3::dsr::DsrOptionRerr::DsrOptionRerr ( )

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

References NS_LOG_FUNCTION_NOARGS.

◆ ~DsrOptionRerr()

ns3::dsr::DsrOptionRerr::~DsrOptionRerr ( )
override

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

References NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

◆ DoSendError()

uint8_t ns3::dsr::DsrOptionRerr::DoSendError ( Ptr< Packet > p,
DsrOptionRerrUnreachHeader & rerr,
uint32_t rerrSize,
Ipv4Address ipv4Address,
uint8_t protocol )

Do Send error message.

Parameters
pthe packet
rerrthe DsrOptionRerrUnreachHeader header
rerrSizethe route error header size
ipv4Addressipv4 address of our own
protocolthe protocol number of the up layer
Returns
the processed size

to test if the next address is multicast or not

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

References ns3::dsr::DsrOptionHeader::GetLength(), ns3::dsr::DsrOptionSRHeader::GetNodeAddress(), ns3::dsr::DsrOptionSRHeader::GetNodesAddress(), ns3::dsr::DsrOptions::GetNodeWithAddress(), ns3::dsr::DsrOptionSRHeader::GetSalvage(), ns3::dsr::DsrOptionSRHeader::GetSegmentsLeft(), ns3::dsr::DsrOptionSRHeader::GetSerializedSize(), ns3::Ipv4Address::IsMulticast(), ns3::dsr::DsrOptions::m_dropTrace, ns3::dsr::DsrOptions::m_ipv4Route, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_INFO, NS_LOG_LOGIC, ns3::dsr::DsrOptionSRHeader::SetNodesAddress(), ns3::dsr::DsrOptionSRHeader::SetNumberAddress(), ns3::dsr::DsrOptions::SetRoute(), ns3::dsr::DsrOptionSRHeader::SetSalvage(), and ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft().

Referenced by Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::dsr::DsrOptionRerr::GetInstanceTypeId ( ) const
overridevirtual

Get the instance type ID.

Returns
instance type ID

Implements ns3::ObjectBase.

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

References GetTypeId().

+ Here is the call graph for this function:

◆ GetOptionNumber()

uint8_t ns3::dsr::DsrOptionRerr::GetOptionNumber ( ) const
overridevirtual

Get the option number.

Returns
option number

Implements ns3::dsr::DsrOptions.

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

References NS_LOG_FUNCTION_NOARGS, and OPT_NUMBER.

◆ GetTypeId()

TypeId ns3::dsr::DsrOptionRerr::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

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

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Process()

uint8_t ns3::dsr::DsrOptionRerr::Process ( Ptr< Packet > packet,
Ptr< Packet > dsrP,
Ipv4Address ipv4Address,
Ipv4Address source,
const Ipv4Header & ipv4Header,
uint8_t protocol,
bool & isPromisc,
Ipv4Address promiscSource )
overridevirtual

Process method.

Called from DsrRouting::Receive.

Parameters
packetthe packet
dsrPthe clean packet with payload
ipv4Addressthe IPv4 address
sourceIPv4 address of the source
ipv4Headerthe IPv4 header of packet received
protocolthe protocol number of the up layer
isPromiscif the packet must be dropped
promiscSourceIPv4 address
Returns
the processed size
Todo
This is for the other two error options, not supporting for now

Implements ns3::dsr::DsrOptions.

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

References data, DoSendError(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst(), ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc(), ns3::dsr::DsrOptions::GetNodeWithAddress(), ns3::dsr::DsrOptionRerrUnreachHeader::GetSerializedSize(), ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode(), NS_LOG_DEBUG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_ipv4

Ptr<Ipv4> ns3::dsr::DsrOptionRerr::m_ipv4
private

The ipv4 layer 3.

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

◆ m_routeCache

Ptr<dsr::DsrRouteCache> ns3::dsr::DsrOptionRerr::m_routeCache
private

The route cache.

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

◆ OPT_NUMBER

const uint8_t ns3::dsr::DsrOptionRerr::OPT_NUMBER = 3
static

Dsr Route Error option number.

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

Referenced by GetOptionNumber().


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