32 #define NS_LOG_APPEND_CONTEXT \
33 if (GetObject<Node> ()) { std::clog << "[node " << GetObject<Node> ()->GetId () << "] "; }
41 #include "ns3/assert.h"
42 #include "ns3/fatal-error.h"
44 #include "ns3/uinteger.h"
45 #include "ns3/trace-source-accessor.h"
46 #include "ns3/udp-header.h"
47 #include "ns3/pointer.h"
48 #include "ns3/node-list.h"
49 #include "ns3/uinteger.h"
50 #include "ns3/object-vector.h"
51 #include "ns3/ipv4-l3-protocol.h"
52 #include "ns3/ipv4-interface.h"
53 #include "ns3/ipv4-header.h"
54 #include "ns3/ipv4-address.h"
55 #include "ns3/ipv4-route.h"
56 #include "ns3/icmpv4-l4-protocol.h"
57 #include "ns3/ip-l4-protocol.h"
76 .AddAttribute (
"OptionNumber",
"The Dsr option number.",
79 MakeUintegerChecker<uint8_t> ())
80 .AddTraceSource (
"Drop",
83 "ns3::Packet::TracedCallback")
84 .AddTraceSource (
"Rx",
85 "Receive DSR packet.",
87 "ns3::dsr::DsrOptionSRHeader::TracedCallback")
117 std::vector<Ipv4Address>::iterator it = find (nodeList.begin (), nodeList.end (), destAddress);
119 for (std::vector<Ipv4Address>::iterator i = it; i != nodeList.end (); ++i)
121 if ((ipv4Address == (*i)) && ((*i) != nodeList.back ()))
129 std::vector<Ipv4Address>
133 std::vector<Ipv4Address>::iterator it = find (nodeList.begin (), nodeList.end (), ipv4Address);
134 std::vector<Ipv4Address> cutRoute;
135 for (std::vector<Ipv4Address>::iterator i = it; i != nodeList.end (); ++i)
137 cutRoute.push_back (*i);
155 std::vector<Ipv4Address> vec2 (vec);
157 for (std::vector<Ipv4Address>::reverse_iterator ri = vec2.rbegin (); ri
158 != vec2.rend (); ++ri)
163 if ((vec.size () == vec2.size ()) && (vec.front () == vec2.back ()))
175 if (vec.size () == 2)
183 if (ipv4Address == vec.back ())
185 NS_LOG_DEBUG (
"We have reached to the final destination " << ipv4Address <<
" " << vec.back ());
188 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
190 if (ipv4Address == (*i))
197 NS_LOG_DEBUG (
"next hop address not found, route corrupted");
206 if (vec.size () == 2)
214 for (std::vector<Ipv4Address>::reverse_iterator ri = vec.rbegin (); ri != vec.rend (); ++ri)
216 if (ipv4Address == (*ri))
223 NS_LOG_DEBUG (
"next hop address not found, route corrupted");
234 for (std::vector<Ipv4Address>::reverse_iterator ri = vec.rbegin (); ri != vec.rend (); ++ri)
236 if (ipv4Address == (*ri))
238 nextTwoHop = *(ri + 2);
260 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
270 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
272 for (std::vector<Ipv4Address>::const_iterator j = vec2.begin (); j != vec2.end (); ++j)
290 for (std::vector<Ipv4Address>::const_iterator i = vec.begin (); i != vec.end (); ++i)
292 if ((*i) == ipv4Address)
308 std::vector<Ipv4Address> vec2 (vec);
311 for (std::vector<Ipv4Address>::const_iterator i = vec2.begin (); i != vec2.end (); ++i)
320 for (std::vector<Ipv4Address>::iterator j = vec.begin (); j != vec.end (); ++j)
324 if ((j + 1) != vec.end ())
326 vec.erase (j + 1, vec.end ());
334 else if (j == (vec.end () - 1))
353 for (int32_t i = 0; i < nNodes; ++i)
357 if (ipv4->GetAddress (1, 0).GetLocal () ==
address)
369 for (int32_t i = 0; i < nNodes; ++i)
373 int32_t ifIndex = ipv4->GetInterfaceForAddress (ipv4Address);
388 .SetGroupName (
"Dsr")
413 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
429 .SetGroupName (
"Dsr")
453 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
470 .SetGroupName (
"Dsr")
500 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
507 if (source == ipv4Address)
509 NS_LOG_DEBUG (
"Discard the packet since it was originated from same source address");
526 uint8_t numberAddress = (buf[1] - 6) / 4;
527 NS_LOG_DEBUG (
"The number of Ip addresses " << (uint32_t)numberAddress);
528 if (numberAddress >= 255)
530 NS_LOG_DEBUG (
"Discard the packet, malformed header since two many ip addresses in route");
544 p->RemoveHeader (rreq);
554 uint16_t requestId = rreq.
GetId ();
559 std::vector<Ipv4Address> nodeList (mainVector);
577 uint8_t ttl = ipv4Header.
GetTtl ();
578 bool dupRequest =
false;
583 dupRequest = dsr->FindSourceEntry (sourceAddress, targetAddress, requestId);
606 NS_LOG_DEBUG (
"Our node address is already seen in the route, drop the request");
613 bool isRouteInCache = dsr->LookupRoute (targetAddress,
617 std::vector<Ipv4Address> saveRoute (nodeList);
632 NS_LOG_DEBUG (
"The target address over here " << targetAddress <<
" and the ip address " << ipv4Address <<
" and the source address " << mainVector[0]);
633 if (targetAddress == ipv4Address)
636 if (nodeList.size () == 1)
643 nextHop = srcAddress;
647 std::vector<Ipv4Address> changeRoute (nodeList);
648 changeRoute.push_back (ipv4Address);
650 for (std::vector<Ipv4Address>::iterator i = changeRoute.begin (); i != changeRoute.end (); ++i)
678 dsr->ScheduleInitialReply (newPacket, ipv4Address, nextHop,
m_ipv4Route);
687 bool addRoute =
false;
688 if (numberAddress > 0)
692 if (dsr->IsLinkCache ())
694 addRoute = dsr->AddRoute_Link (
m_finalRoute, ipv4Address);
698 addRoute = dsr->AddRoute (toSource);
729 if (nextHop ==
"0.0.0.0")
731 dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
738 dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
740 dsr->CancelRreqTimer (dst,
true);
764 else if (isRouteInCache && !areThereDuplicates)
770 for (std::vector<Ipv4Address>::iterator i = saveRoute.begin (); i != saveRoute.end (); ++i)
777 for (std::vector<Ipv4Address>::iterator j = ip.begin (); j != ip.end (); ++j)
784 bool addRoute =
false;
789 saveRoute.push_back (ipv4Address);
796 NS_ASSERT (saveRoute.front () == ipv4Address);
798 if (dsr->IsLinkCache ())
800 addRoute = dsr->AddRoute_Link (saveRoute, ipv4Address);
804 addRoute = dsr->AddRoute (toSource);
809 NS_LOG_LOGIC (
"We have added the route and search send buffer for packet with destination " << dst);
827 if (nextHop ==
"0.0.0.0")
829 dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
836 dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
838 dsr->CancelRreqTimer (dst,
true);
875 dsrRoutingHeader.SetMessageType (1);
876 dsrRoutingHeader.SetSourceId (
GetIDfromIP (realSource));
877 dsrRoutingHeader.SetDestId (255);
880 dsrRoutingHeader.SetPayloadLength (length + 2);
881 dsrRoutingHeader.AddDsrOption (rrep);
884 dsr->ScheduleCachedReply (newPacket, ipv4Address, nextHop,
m_ipv4Route, hops);
893 mainVector.push_back (ipv4Address);
894 NS_ASSERT (mainVector.front () == source);
904 p->RemoveHeader (rerr);
909 if ((errorSrc == srcAddress) && (unreachNode == ipv4Address))
919 dsr->DeleteAllRoutesIncludeLink (errorSrc, unreachNode, ipv4Address);
928 NS_LOG_DEBUG (
"The RREQ and newUnreach header length " << length);
942 uint8_t ttl = ipv4Header.
GetTtl ();
955 dsr->ScheduleInterRequest (interP);
970 .SetGroupName (
"Dsr")
1000 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1007 uint8_t numberAddress = (buf[1] - 2) / 4;
1016 NS_LOG_DEBUG (
"The next header value " << (uint32_t)protocol);
1024 if (targetAddress == ipv4Address)
1028 if (nodeList.size () == 0)
1043 NS_ASSERT (nodeList.front () == ipv4Address);
1044 bool addRoute =
false;
1045 if (dsr->IsLinkCache ())
1047 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
1051 addRoute = dsr->AddRoute (toDestination);
1056 NS_LOG_DEBUG (
"We have added the route and search send buffer for packet with destination " << dst);
1061 NS_LOG_DEBUG (
"The route length " << nodeList.size ());
1067 if (nextHop ==
"0.0.0.0")
1069 dsr->PacketNewRoute (dsrP, ipv4Address, dst, protocol);
1075 dsr->CancelRreqTimer (dst,
true);
1079 dsr->SendPacketFromBuffer (sourceRoute, nextHop, protocol);
1090 NS_LOG_DEBUG (
"The length of rrep option " << (uint32_t)length);
1092 if (length % 2 != 0)
1102 std::vector<Ipv4Address> routeCopy = nodeList;
1103 std::vector<Ipv4Address> cutRoute =
CutRoute (ipv4Address, nodeList);
1105 if (cutRoute.size () >= 2)
1108 NS_LOG_DEBUG (
"The route destination after cut " << dst);
1110 NS_ASSERT (cutRoute.front () == ipv4Address);
1111 bool addRoute =
false;
1112 if (dsr->IsLinkCache ())
1114 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
1118 addRoute = dsr->AddRoute (toDestination);
1122 dsr->CancelRreqTimer (dst,
true);
1137 NS_ASSERT (routeCopy.back () == source);
1139 NS_LOG_DEBUG (
"The nextHop address " << nextHop <<
" and the source in the route reply " << source);
1151 NS_LOG_DEBUG (
"The reply header length " << (uint32_t)length);
1158 newPacket->
AddHeader (dsrRoutingHeader);
1159 dsr->SendReply (newPacket, ipv4Address, nextHop,
m_ipv4Route);
1171 .SetGroupName (
"Dsr")
1200 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Address << ipv4Header << (uint32_t)protocol << isPromisc);
1205 uint8_t numberAddress = (buf[1] - 2) / 4;
1234 NS_LOG_LOGIC (
"We process promiscuous receipt data packet");
1238 dsr->SendGratuitousReply (source, srcAddress, nodeList, protocol);
1244 if (destAddress != destination)
1246 NS_LOG_DEBUG (
"Process the promiscuously received packet");
1247 bool findPassive =
false;
1249 for (int32_t i = 0; i < nNodes; ++i)
1256 findPassive = dsrNode->PassiveEntryCheck (packet, source, destination, segsLeft, fragmentOffset, identification,
false);
1265 NS_LOG_DEBUG (
"We find one previously received passive entry");
1275 dsrSrc->CancelPassiveTimer (packet, source, destination, segsLeft);
1280 dsr->PassiveEntryCheck (packet, source, destination, segsLeft, fragmentOffset, identification,
true);
1291 uint8_t length = sourceRoute.
GetLength ();
1292 uint8_t nextAddressIndex;
1296 uint32_t size = p->
GetSize ();
1297 uint8_t *
data =
new uint8_t[size];
1299 uint8_t optionType = 0;
1300 optionType = *(
data);
1303 if (optionType == 160)
1305 NS_LOG_LOGIC (
"Remove the ack request header and add ack header to the packet");
1309 uint16_t ackId = ackReq.
GetAckId ();
1316 if (!nodeList.empty ())
1318 if (segsLeft > numberAddress)
1325 if (numberAddress - segsLeft < 2)
1331 ackAddress = nodeList[numberAddress - segsLeft - 2];
1334 NS_LOG_DEBUG (
"Send back ACK to the earlier hop " << ackAddress <<
" from us " << ipv4Address);
1335 dsr->SendAck (ackId, ackAddress, source, destination, protocol,
m_ipv4Route);
1348 if (length % 2 != 0)
1355 if (segsLeft > numberAddress)
1366 nextAddressIndex = numberAddress - segsLeft;
1368 NS_LOG_DEBUG (
"The next address of source route option " << nextAddress <<
" and the nextAddressIndex: " << (uint32_t)nextAddressIndex <<
" and the segments left : " << (uint32_t)segsLeft);
1380 if (nextHop ==
"0.0.0.0")
1383 dsr->PacketNewRoute (dsrP, realSource, targetAddress, protocol);
1387 if (ipv4Address == nextHop)
1400 SetRoute (nextAddress, ipv4Address);
1402 dsr->ForwardPacket (dsrP, newSourceRoute, ipv4Header, realSource, nextAddress, targetAddress, protocol,
m_ipv4Route);
1413 .SetGroupName (
"Dsr")
1442 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1444 uint32_t size = p->
GetSize ();
1445 uint8_t *
data =
new uint8_t[size];
1447 uint8_t errorType = *(data + 2);
1457 NS_LOG_DEBUG (
"The error type value here " << (uint32_t)errorType);
1471 NS_LOG_DEBUG (
"The error source is " << rerrUnreach.
GetErrorDst () <<
"and the unreachable node is " << unreachAddress);
1480 dsr->DeleteAllRoutesIncludeLink (errorSource, unreachAddress, ipv4Address);
1483 uint32_t serialized =
DoSendError (newP, rerrUnreach, rerrSize, ipv4Address, protocol);
1502 uint32_t serialized = 0;
1512 uint8_t numberAddress = (buf[1] - 2) / 4;
1515 NS_LOG_DEBUG (
"The number of addresses " << (uint32_t)numberAddress);
1529 uint8_t length = sourceRoute.
GetLength ();
1530 uint8_t nextAddressIndex;
1542 if (length % 2 != 0)
1549 if (segmentsLeft > numberAddress)
1558 if (segmentsLeft == 0 && targetAddress == ipv4Address)
1560 NS_LOG_INFO (
"This is the destination of the error, send error request");
1561 dsr->SendErrorRequest (rerr, protocol);
1562 return serializedSize;
1568 nextAddressIndex = numberAddress - segmentsLeft;
1578 return serializedSize;
1582 SetRoute (nextAddress, ipv4Address);
1583 dsr->ForwardErrPacket (rerr, newSourceRoute, nextAddress, protocol,
m_ipv4Route);
1584 return serializedSize;
1591 static TypeId tid =
TypeId (
"ns3::dsr::DsrOptionAckReq")
1593 .SetGroupName (
"Dsr")
1622 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1638 NS_LOG_DEBUG (
"The next header value " << (uint32_t)protocol);
1649 .SetGroupName (
"Dsr")
1678 NS_LOG_FUNCTION (
this << packet << dsrP << ipv4Address << source << ipv4Header << (uint32_t)protocol << isPromisc);
1696 dsr->UpdateRouteEntry (realDst);
1700 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 uint8_t GetOptionNumber() const
Get the option number.
static const uint8_t OPT_NUMBER
Rreq option number.
#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.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
static TypeId GetTypeId()
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
static Ptr< Node > GetNode(uint32_t n)
Introspection did not find any typical Config paths.
static TypeId GetTypeId()
void AddPacketTag(const Tag &tag) const
Add a packet tag.
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.
IP_VECTOR GetVector() const
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.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
bool IsMulticast(void) const
#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.
Introspection did not find any typical Config paths.
This class implements a tag that carries the socket-specific TTL of a packet to the IP layer...
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
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.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
void SetSource(Ipv4Address src)
virtual uint8_t GetOptionNumber() const
Get the option number.
void SetTtl(uint8_t ttl)
Set the tag's TTL.
Introspection did not find any typical Config paths.
static TypeId GetTypeId()
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()
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.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Access to the Ipv4 forwarding table, interfaces, and configuration.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.
Introspection did not find any typical Config paths.
TracedCallback< const DsrOptionSRHeader & > m_rxPacketTrace
The receive trace back, only triggered when final destination receive data packet.
static TypeId GetTypeId()
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.
static TypeId GetTypeId()
Introspection did not find any typical Config paths.
Introspection did not find any typical Config paths.
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.
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.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
Ipv4Address ReverseSearchNextHop(Ipv4Address ipv4Address, std::vector< Ipv4Address > &vec)
Reverse search for the next hop in the route.
virtual ~DsrOptionAckReq()
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
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.
virtual uint8_t GetOptionNumber() const
Get the option number.
virtual uint8_t GetOptionNumber() const
Get the option number.
virtual uint8_t GetOptionNumber() const
Get the option number.
Introspection did not find any typical Config paths.
virtual TypeId GetInstanceTypeId() const
Get the instance type ID.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
static const uint8_t OPT_NUMBER
Source Route option number.
Introspection did not find any typical Config paths.
virtual uint8_t GetOptionNumber() const
Get the option number.
A base class which provides memory management and object aggregation.
Introspection did not find any typical Config paths.
Ptr< Node > GetNode() const
Get the node.
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...
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()
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.
virtual uint8_t GetOptionNumber() const
Get the option number.
static TypeId GetTypeId()
virtual uint8_t GetOptionNumber() const
Get the option number.