32 #define NS_LOG_APPEND_CONTEXT                                   \    33   if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; }    40 #include "ns3/assert.h"    41 #include "ns3/fatal-error.h"    43 #include "ns3/uinteger.h"    44 #include "ns3/trace-source-accessor.h"    45 #include "ns3/udp-header.h"    46 #include "ns3/pointer.h"    47 #include "ns3/node-list.h"    48 #include "ns3/object-vector.h"    49 #include "ns3/ipv4-l3-protocol.h"    50 #include "ns3/ipv4-interface.h"    51 #include "ns3/ipv4-header.h"    52 #include "ns3/ipv4-address.h"    53 #include "ns3/ipv4-route.h"    54 #include "ns3/icmpv4-l4-protocol.h"    55 #include "ns3/ip-l4-protocol.h"    73     .AddAttribute (
"OptionNumber", 
"The Dsr option number.",
    76                    MakeUintegerChecker<uint8_t> ())
    77     .AddTraceSource (
"Drop",
    80                      "ns3::Packet::TracedCallback")
    81     .AddTraceSource (
"Rx",
    82                      "Receive DSR packet.",
    84                      "ns3::dsr::DsrOptionSRHeader::TracedCallback")
   114   std::vector<Ipv4Address>::iterator it = find (nodeList.begin (), nodeList.end (), destAddress);
   116   for (std::vector<Ipv4Address>::iterator i = it; i != nodeList.end (); ++i)
   118       if ((ipv4Address == (*i)) && ((*i) != nodeList.back ()))
   126 std::vector<Ipv4Address>
   130   std::vector<Ipv4Address>::iterator it = find (nodeList.begin (), nodeList.end (), ipv4Address);
   131   std::vector<Ipv4Address> cutRoute;
   132   for (std::vector<Ipv4Address>::iterator i = it; i != nodeList.end (); ++i)
   134       cutRoute.push_back (*i);
   152   std::vector<Ipv4Address> vec2 (vec);
   154   for (std::vector<Ipv4Address>::reverse_iterator ri = vec2.rbegin (); ri
   155        != vec2.rend (); ++ri)
   160   if ((vec.size () == vec2.size ()) && (vec.front () == vec2.back ()))
   172   if (vec.size () == 2)
   180       if (ipv4Address == vec.back ())
   182           NS_LOG_DEBUG (
"We have reached to the final destination " << ipv4Address << 
" " << vec.back ());
   185       for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
   187           if (ipv4Address == (*i))
   194   NS_LOG_DEBUG (
"next hop address not found, route corrupted");
   203   if (vec.size () == 2)
   211       for (std::vector<Ipv4Address>::reverse_iterator ri = vec.rbegin (); ri != vec.rend (); ++ri)
   213           if (ipv4Address == (*ri))
   220   NS_LOG_DEBUG (
"next hop address not found, route corrupted");
   231   for (std::vector<Ipv4Address>::reverse_iterator ri = vec.rbegin (); ri != vec.rend (); ++ri)
   233       if (ipv4Address == (*ri))
   235           nextTwoHop = *(ri + 2);
   257       for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
   267   for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
   269       for (std::vector<Ipv4Address>::const_iterator j = vec2.begin (); j != vec2.end (); ++j)
   287   for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
   289       if ((*i) == ipv4Address)
   305   std::vector<Ipv4Address> vec2 (vec); 
   308   for (std::vector<Ipv4Address>::const_iterator i = vec2.begin (); i != vec2.end (); ++i)
   317           for (std::vector<Ipv4Address>::iterator j = vec.begin (); j != vec.end (); ++j)
   321                   if ((j + 1) != vec.end ())
   323                       vec.erase (j + 1, vec.end ());   
   331               else if (j == (vec.end () - 1))
   350   for (int32_t i = 0; i < nNodes; ++i)
   354       if (ipv4->GetAddress (1, 0).GetLocal () == 
address)
   366   for (int32_t i = 0; i < nNodes; ++i)
   370       int32_t ifIndex = ipv4->GetInterfaceForAddress (ipv4Address);
   385     .SetGroupName (
"Dsr")
   410   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
   426     .SetGroupName (
"Dsr")
   450   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
   467     .SetGroupName (
"Dsr")
   497   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
   504   if (source == ipv4Address)
   506       NS_LOG_DEBUG (
"Discard the packet since it was originated from same source address");
   523   uint8_t numberAddress = (buf[1] - 6) / 4;
   524   NS_LOG_DEBUG (
"The number of Ip addresses " << (uint32_t)numberAddress);
   525   if (numberAddress >= 255)
   527       NS_LOG_DEBUG (
"Discard the packet, malformed header since two many ip addresses in route");
   541   p->RemoveHeader (rreq);
   551   uint16_t requestId = rreq.
GetId ();
   556   std::vector<Ipv4Address> nodeList (mainVector);
   574   uint8_t ttl = ipv4Header.
GetTtl ();
   575   bool dupRequest = 
false;  
   580       dupRequest = dsr->FindSourceEntry (sourceAddress, targetAddress, requestId);
   603       NS_LOG_DEBUG (
"Our node address is already seen in the route, drop the request");
   610       bool isRouteInCache = dsr->LookupRoute (targetAddress,
   614       std::vector<Ipv4Address> saveRoute (nodeList);
   629       NS_LOG_DEBUG (
"The target address over here " << targetAddress << 
" and the ip address " << ipv4Address << 
" and the source address " << mainVector[0]);
   630       if (targetAddress == ipv4Address)
   633           if (nodeList.size () == 1)
   640               nextHop = srcAddress;
   644               std::vector<Ipv4Address> changeRoute (nodeList);
   645               changeRoute.push_back (ipv4Address);    
   647               for (std::vector<Ipv4Address>::iterator i = changeRoute.begin (); i != changeRoute.end (); ++i)
   675           dsr->ScheduleInitialReply (newPacket, ipv4Address, nextHop, 
m_ipv4Route);
   684               bool addRoute = 
false;
   685               if (numberAddress > 0)
   689                   if (dsr->IsLinkCache ())
   691                       addRoute = dsr->AddRoute_Link (
m_finalRoute, ipv4Address);
   695                       addRoute = dsr->AddRoute (toSource);
   726                   if (nextHop == 
"0.0.0.0")
   728                       dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
   735                   dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
   737                   dsr->CancelRreqTimer (dst, 
true);
   761       else if (isRouteInCache && !areThereDuplicates)
   767           for (std::vector<Ipv4Address>::iterator i = saveRoute.begin (); i != saveRoute.end (); ++i)
   774           for (std::vector<Ipv4Address>::iterator j = ip.begin (); j != ip.end (); ++j)
   781           bool addRoute = 
false;
   786               saveRoute.push_back (ipv4Address);
   793               NS_ASSERT (saveRoute.front () == ipv4Address);
   795               if (dsr->IsLinkCache ())
   797                   addRoute = dsr->AddRoute_Link (saveRoute, ipv4Address);
   801                   addRoute = dsr->AddRoute (toSource);
   806                   NS_LOG_LOGIC (
"We have added the route and search send buffer for packet with destination " << dst);
   824                   if (nextHop == 
"0.0.0.0")
   826                       dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
   833                   dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
   835                   dsr->CancelRreqTimer (dst, 
true);
   872           dsrRoutingHeader.SetMessageType (1);
   873           dsrRoutingHeader.SetSourceId (
GetIDfromIP (realSource));
   874           dsrRoutingHeader.SetDestId (255);
   877           dsrRoutingHeader.SetPayloadLength (length + 2);
   878           dsrRoutingHeader.AddDsrOption (rrep);
   881           dsr->ScheduleCachedReply (newPacket, ipv4Address, nextHop, 
m_ipv4Route, hops);
   890           mainVector.push_back (ipv4Address);
   891           NS_ASSERT (mainVector.front () == source);
   901               p->RemoveHeader (rerr);
   906               if ((errorSrc == srcAddress) && (unreachNode == ipv4Address))
   916                   dsr->DeleteAllRoutesIncludeLink (errorSrc, unreachNode, ipv4Address);
   925                   NS_LOG_DEBUG (
"The RREQ and newUnreach header length " <<  length);
   939           uint8_t ttl = ipv4Header.
GetTtl ();
   952               dsr->ScheduleInterRequest (interP);
   967     .SetGroupName (
"Dsr")
   997   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
  1004   uint8_t numberAddress = (buf[1] - 2) / 4;
  1013   NS_LOG_DEBUG (
"The next header value " << (uint32_t)protocol);
  1021   if (targetAddress == ipv4Address)
  1025       if (nodeList.size () == 0)
  1040       NS_ASSERT (nodeList.front () == ipv4Address);
  1041       bool addRoute = 
false;
  1042       if (dsr->IsLinkCache ())
  1044           addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
  1048           addRoute = dsr->AddRoute (toDestination);
  1053           NS_LOG_DEBUG (
"We have added the route and search send buffer for packet with destination " << dst);
  1058           NS_LOG_DEBUG (
"The route length " << nodeList.size ());
  1064           if (nextHop == 
"0.0.0.0")
  1066               dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
  1072           dsr->CancelRreqTimer (dst, 
true);
  1076           dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
  1087       NS_LOG_DEBUG (
"The length of rrep option " << (uint32_t)length);
  1089       if (length % 2 != 0)
  1099       std::vector<Ipv4Address> routeCopy = nodeList;
  1100       std::vector<Ipv4Address> cutRoute = 
CutRoute (ipv4Address, nodeList);
  1102       if (cutRoute.size () >= 2)
  1105           NS_LOG_DEBUG (
"The route destination after cut " << dst);
  1107           NS_ASSERT (cutRoute.front () == ipv4Address);
  1108           bool addRoute = 
false;
  1109           if (dsr->IsLinkCache ())
  1111               addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
  1115               addRoute = dsr->AddRoute (toDestination);
  1119               dsr->CancelRreqTimer (dst, 
true);
  1134       NS_ASSERT (routeCopy.back () == source);
  1136       NS_LOG_DEBUG (
"The nextHop address " << nextHop << 
" and the source in the route reply " << source);
  1148       NS_LOG_DEBUG (
"The reply header length " << (uint32_t)length);
  1155       newPacket->
AddHeader (dsrRoutingHeader);
  1156       dsr->SendReply (newPacket, ipv4Address, nextHop, 
m_ipv4Route);
  1168     .SetGroupName (
"Dsr")
  1197   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Address << ipv4Header << (uint32_t)protocol << isPromisc);
  1202   uint8_t numberAddress = (buf[1] - 2) / 4;
  1231       NS_LOG_LOGIC (
"We process promiscuous receipt data packet");
  1235           dsr->SendGratuitousReply (source, srcAddress, nodeList, protocol);
  1241       if (destAddress != destination)
  1243           NS_LOG_DEBUG (
"Process the promiscuously received packet");
  1244           bool findPassive = 
false;
  1246           for (int32_t i = 0; i < nNodes; ++i)
  1253               findPassive = dsrNode->PassiveEntryCheck (packet, source, destination, segsLeft, fragmentOffset, identification, 
false);
  1262               NS_LOG_DEBUG (
"We find one previously received passive entry");
  1272               dsrSrc->CancelPassiveTimer (packet, source, destination, segsLeft);
  1277               dsr->PassiveEntryCheck (packet, source, destination, segsLeft, fragmentOffset, identification, 
true);
  1288       uint8_t length = sourceRoute.
GetLength ();
  1289       uint8_t nextAddressIndex;
  1293       uint32_t size = p->
GetSize ();
  1294       uint8_t *
data = 
new uint8_t[size];
  1296       uint8_t optionType = 0;
  1297       optionType = *(
data);
  1300       if (optionType == 160)
  1302           NS_LOG_LOGIC (
"Remove the ack request header and add ack header to the packet");
  1306           uint16_t ackId = ackReq.
GetAckId ();
  1313           if (!nodeList.empty ())
  1315               if (segsLeft > numberAddress)   
  1322               if (numberAddress - segsLeft < 2)   
  1328               ackAddress = nodeList[numberAddress - segsLeft - 2];
  1331           NS_LOG_DEBUG (
"Send back ACK to the earlier hop " << ackAddress << 
" from us " << ipv4Address);
  1332           dsr->SendAck (ackId, ackAddress, source, destination, protocol, 
m_ipv4Route);
  1345       if (length % 2 != 0)
  1352       if (segsLeft > numberAddress) 
  1363       nextAddressIndex = numberAddress - segsLeft;
  1365       NS_LOG_DEBUG (
"The next address of source route option " << nextAddress << 
" and the nextAddressIndex: " << (uint32_t)nextAddressIndex << 
" and the segments left : " << (uint32_t)segsLeft);
  1377       if (nextHop == 
"0.0.0.0")
  1380           dsr->PacketNewRoute (dsrP, realSource, targetAddress, protocol);
  1384       if (ipv4Address == nextHop)
  1397       SetRoute (nextAddress, ipv4Address);
  1399       dsr->ForwardPacket (dsrP, newSourceRoute, ipv4Header, realSource, nextAddress, targetAddress, protocol, 
m_ipv4Route);
  1410     .SetGroupName (
"Dsr")
  1439   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
  1441   uint32_t size = p->
GetSize ();
  1442   uint8_t *
data = 
new uint8_t[size];
  1444   uint8_t errorType = *(
data + 2);
  1454   NS_LOG_DEBUG (
"The error type value here " << (uint32_t)errorType);
  1468       NS_LOG_DEBUG (
"The error source is " <<  rerrUnreach.
GetErrorDst () << 
"and the unreachable node is " << unreachAddress);
  1477       dsr->DeleteAllRoutesIncludeLink (errorSource, unreachAddress, ipv4Address);
  1480       uint32_t serialized = 
DoSendError (newP, rerrUnreach, rerrSize, ipv4Address, protocol);
  1500       uint32_t serialized = 0;
  1510   uint8_t numberAddress = (buf[1] - 2) / 4;
  1513   NS_LOG_DEBUG (
"The number of addresses " << (uint32_t)numberAddress);
  1527   uint8_t length = sourceRoute.
GetLength ();
  1528   uint8_t nextAddressIndex;
  1540   if (length % 2 != 0)
  1547   if (segmentsLeft > numberAddress)
  1556   if (segmentsLeft == 0 && targetAddress == ipv4Address)
  1558       NS_LOG_INFO (
"This is the destination of the error, send error request");
  1559       dsr->SendErrorRequest (rerr, protocol);
  1560       return serializedSize;
  1566   nextAddressIndex = numberAddress - segmentsLeft;
  1576       return serializedSize;
  1580   SetRoute (nextAddress, ipv4Address);
  1581   dsr->ForwardErrPacket (rerr, newSourceRoute, nextAddress, protocol, 
m_ipv4Route);
  1582   return serializedSize;
  1589   static TypeId tid = 
TypeId (
"ns3::dsr::DsrOptionAckReq")
  1591     .SetGroupName (
"Dsr")
  1620   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
  1636   NS_LOG_DEBUG (
"The next header value " << (uint32_t)protocol);
  1647     .SetGroupName (
"Dsr")
  1676   NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
  1694   dsr->UpdateRouteEntry (realDst);
  1698   dsr->CallCancelPacketTimer (ackId, ipv4Header, realSrc, realDst);
 
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer. 
 
static const uint8_t OPT_NUMBER
Dsr Route Error option number. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
virtual TypeId GetInstanceTypeId() const
Get the instance type ID. 
 
static const uint8_t OPT_NUMBER
Rreq option number. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
DsrRouteCacheEntry class for entries in the route cache. 
 
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
 
static uint32_t GetNNodes(void)
 
static const uint8_t OPT_NUMBER
Dsr ack request option number. 
 
static TypeId GetTypeId()
Get the type ID. 
 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
 
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload). 
 
static Ptr< Node > GetNode(uint32_t n)
 
virtual TypeId GetInstanceTypeId() const
Get the instance type ID. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
  Introspection did not find any typical Config paths. 
 
static TypeId GetTypeId()
Get the type ID. 
 
virtual uint8_t GetOptionNumber() const =0
Get the option number. 
 
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
#define NS_UNUSED(x)
Mark a local variable as unused. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
virtual TypeId GetInstanceTypeId() const
Get the instance type ID. 
 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
 
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate. 
 
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
virtual TypeId GetInstanceTypeId() const
Get the instance type ID. 
 
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer...
 
void SetNode(Ptr< Node > node)
Set the node. 
 
static const uint8_t OPT_NUMBER
Pad1 option number. 
 
uint8_t DoSendError(Ptr< Packet > p, DsrOptionRerrUnreachHeader &rerr, uint32_t rerrSize, Ipv4Address ipv4Address, uint8_t protocol)
Do Send error message. 
 
uint32_t GetIDfromIP(Ipv4Address address)
Get the node id with Ipv4Address. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source. 
 
void SetSource(Ipv4Address src)
 
bool IsMulticast(void) const
 
IP_VECTOR GetVector() const
Get the IP vector. 
 
void SetTtl(uint8_t ttl)
Set the tag's TTL. 
 
static TypeId GetTypeId()
Get the type ID. 
 
void SetGateway(Ipv4Address gw)
 
Hold an unsigned integer type. 
 
DsrOptionRreq()
Constructor. 
 
Ipv4Address ReverseSearchNextTwoHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Reverse search for the next two hop in the route. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
TracedCallback< Ptr< const Packet > > m_dropTrace
Drop trace callback. 
 
static const uint8_t OPT_NUMBER
Router alert option number. 
 
static TypeId GetTypeId()
Get the type ID. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
std::vector< Ipv4Address > IP_VECTOR
Define the vector to hold Ip address. 
 
static const uint8_t OPT_NUMBER
PadN option number. 
 
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC. 
 
virtual ~DsrOptionRreq()
Destructor. 
 
std::vector< Ipv4Address > m_finalRoute
The vector of final Ipv4 address. 
 
Access to the IPv4 forwarding table, interfaces, and configuration. 
 
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object. 
 
void RemoveDuplicates(std::vector< Ipv4Address > &vec)
Remove the duplicates from the route. 
 
Time ActiveRouteTimeout
The active route timeout value. 
 
void PrintVector(std::vector< Ipv4Address > &vec)
Print out the elements in the route vector. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
 
Ptr< Packet > Copy(void) const
performs a COW copy of the packet. 
 
static const uint8_t OPT_NUMBER
The Dsr Ack option number. 
 
Ipv4Address SearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Search for the next hop in the route. 
 
virtual TypeId GetInstanceTypeId() const
Get the instance type ID. 
 
Ptr< Node > GetNode() const
Get the node. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
TracedCallback< const DsrOptionSRHeader & > m_rxPacketTrace
The receive trace back, only triggered when final destination receive data packet. 
 
static TypeId GetTypeId()
Get the type ID. 
 
virtual ~DsrOptions()
Destructor. 
 
Ipv4 addresses are stored in host order in this class. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
Ptr< Node > m_node
the node 
 
static TypeId GetTypeId()
Get the type ID. 
 
void AddPacketTag(const Tag &tag) const
Add a packet tag. 
 
void AddDsrOption(DsrOptionHeader const &option)
Serialize the option, prepending pad1 or padn option as necessary. 
 
bool CheckDuplicates(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Check if the route already contains the node ip address. 
 
virtual uint8_t GetOptionNumber() const
Get the option number. 
 
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer. 
 
bool ReverseRoutes(std::vector< Ipv4Address > &vec)
Reverse the routes. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG. 
 
Ptr< Ipv4Route > m_ipv4Route
The ipv4 route. 
 
Ipv4Address ReverseSearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Reverse search for the next hop in the route. 
 
virtual ~DsrOptionAckReq()
 
static TypeId GetTypeId(void)
Get the type identificator. 
 
bool ContainAddressAfter(Ipv4Address ipv4Address, Ipv4Address destAddress, std::vector< Ipv4Address > &nodeList)
Search for the ipv4 address in the node list. 
 
static const uint8_t OPT_NUMBER
Source Route option number. 
 
A base class which provides memory management and object aggregation. 
 
virtual Ptr< Ipv4Route > SetRoute(Ipv4Address nextHop, Ipv4Address srcAddress)
Set the route to use for data packets, used by the option headers when sending data/control packets...
 
virtual TypeId GetInstanceTypeId() const
Get the instance type ID. 
 
bool IfDuplicates(std::vector< Ipv4Address > &vec, std::vector< Ipv4Address > &vec2)
Check if the two vectors contain duplicate or not. 
 
Ptr< Node > GetNodeWithAddress(Ipv4Address ipv4Address)
Get the node object with Ipv4Address. 
 
static TypeId GetTypeId()
Get the type ID. 
 
virtual uint8_t Process(Ptr< Packet > packet, Ptr< Packet > dsrP, Ipv4Address ipv4Address, Ipv4Address source, Ipv4Header const &ipv4Header, uint8_t protocol, bool &isPromisc, Ipv4Address promiscSource)
Process method. 
 
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
 Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
 
a unique identifier for an interface. 
 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
 
void AddHeader(const Header &header)
Add header to this packet. 
 
void SetDestination(Ipv4Address dest)
 
std::vector< Ipv4Address > CutRoute(Ipv4Address ipv4Address, std::vector< Ipv4Address > &nodeList)
Cut the route from ipv4Address to the end of the route vector. 
 
static TypeId GetTypeId()
Get the type ID.