25 #include "ns3/assert.h"
26 #include "ns3/packet.h"
28 #include "ns3/boolean.h"
29 #include "ns3/ipv6-routing-protocol.h"
30 #include "ns3/ipv6-route.h"
31 #include "ns3/pointer.h"
32 #include "ns3/string.h"
33 #include "ns3/integer.h"
67 .SetGroupName (
"Internet")
69 .AddAttribute (
"DAD",
"Always do DAD check.",
73 .AddAttribute (
"SolicitationJitter",
"The jitter in ms a node is allowed to wait before sending any solicitation. Some jitter aims to prevent collisions. By default, the model will wait for a duration in ms defined by a uniform random-variable between 0 and SolicitationJitter",
74 StringValue (
"ns3::UniformRandomVariable[Min=0.0|Max=10.0]"),
76 MakePointerChecker<RandomVariableStream> ())
77 .AddAttribute (
"MaxMulticastSolicit",
"Neighbor Discovery node constants: max multicast solicitations.",
80 MakeIntegerChecker<uint8_t> ())
81 .AddAttribute (
"MaxUnicastSolicit",
"Neighbor Discovery node constants: max unicast solicitations.",
84 MakeIntegerChecker<uint8_t> ())
85 .AddAttribute (
"ReachableTime",
"Neighbor Discovery node constants: reachable time.",
89 .AddAttribute (
"RetransmissionTime",
"Neighbor Discovery node constants: retransmission timer.",
93 .AddAttribute (
"DelayFirstProbe",
"Neighbor Discovery node constants: delay for the first probe.",
146 Ptr<Node> node = this->GetObject<Node> ();
149 Ptr<Ipv6> ipv6 = this->GetObject<Ipv6> ();
215 interface->
SetNsDadUid (target, p.first->GetUid ());
227 NS_LOG_FUNCTION (
this << packet << header.GetSource () << header.GetDestination () << interface);
228 Ptr<Packet> p = packet->Copy ();
233 p->CopyData (&type,
sizeof(type));
238 if (ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->GetDevice ())))
240 HandleRS (p, header.GetSource (), header.GetDestination (), interface);
244 if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->GetDevice ())))
246 HandleRA (p, header.GetSource (), header.GetDestination (), interface);
250 HandleNS (p, header.GetSource (), header.GetDestination (), interface);
253 HandleNA (p, header.GetSource (), header.GetDestination (), interface);
288 const uint8_t payload[8])
290 NS_LOG_FUNCTION (
this << source << icmp << info << ipHeader << payload);
313 uint8_t* buf =
new uint8_t[packet->
GetSize ()];
355 ipv6->AddAutoconfiguredAddress (ipv6->GetInterfaceForDevice (interface->
GetDevice ()), prefixHdr.GetPrefix (), prefixHdr.GetPrefixLength (),
356 prefixHdr.GetFlags (), prefixHdr.GetValidTime (), prefixHdr.GetPreferredTime (), defaultRouter);
392 entry = cache->
Lookup (src);
396 entry = cache->
Add (src);
404 std::list<NdiscCache::Ipv6PayloadHeaderPair> waiting;
412 for (std::list<NdiscCache::Ipv6PayloadHeaderPair>::const_iterator it = waiting.begin (); it != waiting.end (); it++)
434 for (std::list<NdiscCache::Ipv6PayloadHeaderPair>::const_iterator it = waiting.begin (); it != waiting.end (); it++)
465 packet->
CopyData (&type,
sizeof(type));
474 entry = cache->
Lookup (src);
477 entry = cache->
Add (src);
501 for (i = 0; i < nb; i++)
533 bool hasSllao =
false;
538 packet->
CopyData (&type,
sizeof (type));
563 entry = cache->
Lookup (src);
568 NS_LOG_LOGIC (
"Icmpv6L4Protocol::HandleNS: NS without SLLAO and we do not have a NCE, discarding.");
571 entry = cache->
Add (src);
598 if (ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())))
605 src.
IsAny () ? dst : src,
622 NS_LOG_LOGIC (
"Forge RS (from " << src <<
" to " << dst <<
")");
678 std::list<NdiscCache::Ipv6PayloadHeaderPair> waiting;
681 entry = cache->
Lookup (target);
692 for (i = 0; i < nb; i++)
717 packet->
CopyData (&type,
sizeof(type));
736 for (std::list<NdiscCache::Ipv6PayloadHeaderPair>::const_iterator it = waiting.begin (); it != waiting.end (); it++)
779 for (std::list<NdiscCache::Ipv6PayloadHeaderPair>::const_iterator it = waiting.begin (); it != waiting.end (); it++)
836 entry = cache->
Lookup (redirTarget);
839 entry = cache->
Add (redirTarget);
841 entry->
SetRouter (redirTarget != redirDestination);
866 if (redirTarget == redirDestination)
868 ipv6->GetRoutingProtocol ()->NotifyAddRoute (redirDestination,
Ipv6Prefix (128),
Ipv6Address (
"::"), ipv6->GetInterfaceForAddress (dst));
872 uint32_t ifIndex = ipv6->GetInterfaceForAddress (dst);
873 ipv6->GetRoutingProtocol ()->NotifyAddRoute (redirDestination,
Ipv6Prefix (128), redirTarget, ifIndex);
910 Forward (src, timeexceeded, timeexceeded.
GetCode (), ipHeader, payload);
961 tag.SetHopLimit (ttl);
976 NS_ASSERT (ipv6 != 0 && ipv6->GetRoutingProtocol () != 0);
984 route = ipv6->GetRoutingProtocol ()->RouteOutput (packet, header, oif, err);
1005 NS_LOG_FUNCTION (
this << src << dst << hardwareAddress <<
static_cast<uint32_t
> (flags));
1010 NS_LOG_LOGIC (
"Send NA ( from " << src <<
" to " << dst <<
" target " << src <<
")");
1061 NS_LOG_LOGIC (
"Send NS ( from " << src <<
" to " << dst <<
" target " << target <<
")");
1072 NS_LOG_LOGIC (
"Destination is Multicast, using DelayedSendMessage");
1092 NS_LOG_LOGIC (
"Send RS (from " << src <<
" to " << dst <<
")");
1102 NS_LOG_LOGIC (
"Destination is Multicast, using DelayedSendMessage");
1110 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1114 NS_LOG_LOGIC (
"Send Destination Unreachable ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1117 if (malformedPacketSize <= 1280 - 48)
1133 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1141 if (malformedPacketSize <= 1280 - 48)
1156 NS_LOG_FUNCTION (
this << malformedPacket << dst <<
static_cast<uint32_t
> (code));
1157 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1161 NS_LOG_LOGIC (
"Send Time Exceeded ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1164 if (malformedPacketSize <= 1280 - 48)
1179 NS_LOG_FUNCTION (
this << malformedPacket << dst <<
static_cast<uint32_t
> (code) << ptr);
1180 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1185 NS_LOG_LOGIC (
"Send Parameter Error ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1188 if (malformedPacketSize <= 1280 - 48 )
1203 NS_LOG_FUNCTION (
this << redirectedPacket << dst << redirTarget << redirDestination << redirHardwareTarget);
1204 uint32_t llaSize = 0;
1206 uint32_t redirectedPacketSize = redirectedPacket->
GetSize ();
1209 NS_LOG_LOGIC (
"Send Redirection ( to " << dst <<
" target " << redirTarget <<
" destination " << redirDestination <<
" )");
1213 if ((redirectedPacketSize % 8) != 0)
1215 Ptr<Packet> pad = Create<Packet> (8 - (redirectedPacketSize % 8));
1226 if (redirectedPacketSize <= (1280 - 56 - llaSize))
1228 redirectedOptionHeader.
SetPacket (redirectedPacket);
1233 redirectedOptionHeader.
SetPacket (fragment);
1244 redirectionHeader.
SetTarget (redirTarget);
1254 NS_LOG_FUNCTION (
this << src << dst << hardwareAddress << (uint32_t)flags);
1260 NS_LOG_LOGIC (
"Send NA ( from " << src <<
" to " << dst <<
")");
1300 NS_LOG_LOGIC (
"Send NS ( from " << src <<
" to " << dst <<
" target " << target <<
")");
1321 if ((*i)->GetDevice () == device)
1327 NS_ASSERT_MSG (
false,
"Icmpv6L4Protocol can not find a NDIS Cache for device " << device);
1338 cache->
SetDevice (device, interface,
this);
1346 NS_LOG_FUNCTION (
this << dst << device << cache << hardwareDestination);
1377 NS_LOG_FUNCTION (
this << p << ipHeader << dst << device << cache << hardwareDestination);
1459 for (i = 0; i < nb; i++)
1472 NS_LOG_LOGIC (
"Can not find the address in the interface.");
1488 if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())) && addr.
IsLinkLocal ())
1498 NS_LOG_LOGIC (
"Did not schedule a Router Solicitation because the interface is in forwarding mode");
a polymophic address class
uint8_t GetLength(void) const
Get the length of the underlying address.
AttributeValue implementation for Boolean.
bool IsNull(void) const
Check for null implementation.
void Nullify(void)
Discard the implementation, set it to null.
ICMPv6 Error Destination Unreachable header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
void SetId(uint16_t id)
Set the ID of the packet.
uint16_t GetId() const
Get the ID of the packet.
void SetSeq(uint16_t seq)
Set the sequence number.
uint16_t GetSeq() const
Get the sequence number.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
An implementation of the ICMPv6 protocol.
Time GetRetransmissionTime() const
Neighbor Discovery node constants: retransmission timer.
virtual void SetDownTarget(IpL4Protocol::DownTargetCallback cb)
This method allows a caller to set the current down target callback set for this L4 protocol (IPv4 ca...
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void Forward(Ipv6Address source, Icmpv6Header icmp, uint32_t info, Ipv6Header ipHeader, const uint8_t payload[8])
Notify an ICMPv6 reception to upper layers (if requested).
void SendErrorTimeExceeded(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Time Exceeded.
void SendErrorTooBig(Ptr< Packet > malformedPacket, Ipv6Address dst, uint32_t mtu)
Send an error Too Big.
uint8_t m_maxMulticastSolicit
Neighbor Discovery node constants: max multicast solicitations.
Time m_reachableTime
Neighbor Discovery node constants: reachable time.
NdiscCache::Ipv6PayloadHeaderPair ForgeEchoRequest(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Forge an Echo Request.
virtual Ptr< NdiscCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
Create a neighbor cache.
void DelayedSendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Helper function used during delayed solicitation.
Ptr< Node > GetNode()
Get the node.
bool IsAlwaysDad() const
Is the node must do DAD.
void HandlePacketTooBig(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Packet Too Big method.
void SendErrorParameterError(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code, uint32_t ptr)
Send an error Parameter Error.
void HandleRS(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Router Solicitation method.
void NotifyNewAggregate()
This method is called by AggregateObject and completes the aggregation by setting the node in the ICM...
Time GetDelayFirstProbe() const
Neighbor Discovery node constants : delay for the first probe.
NdiscCache::Ipv6PayloadHeaderPair ForgeNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Forge a Neighbor Advertisement.
virtual void DoDispose()
Dispose this object.
void HandleNA(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Advertisement method.
void FunctionDadTimeout(Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
uint8_t m_maxUnicastSolicit
Neighbor Discovery node constants: max unicast solicitations.
void SendRedirection(Ptr< Packet > redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget)
Send an ICMPv6 Redirection.
Ptr< Node > m_node
The node.
IpL4Protocol::DownTargetCallback6 m_downTarget
callback to Ipv6::Send
Ptr< NdiscCache > FindCache(Ptr< NetDevice > device)
Get the cache corresponding to the device.
void DoDAD(Ipv6Address target, Ptr< Ipv6Interface > interface)
Do the Duplication Address Detection (DAD).
virtual void SetDownTarget6(IpL4Protocol::DownTargetCallback6 cb)
This method allows a caller to set the current down target callback set for this L4 protocol (IPv6 ca...
bool m_alwaysDad
Always do DAD ?
void SendErrorDestinationUnreachable(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Destination Unreachable.
static const uint8_t PROT_NUMBER
ICMPv6 protocol number (58).
virtual void SendNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Send a Neighbor Solicitation.
virtual ~Icmpv6L4Protocol()
Destructor.
void SendRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Send a Router Solicitation.
Time m_retransmissionTime
Neighbor Discovery node constants: retransmission timer.
virtual IpL4Protocol::DownTargetCallback6 GetDownTarget6(void) const
This method allows a caller to get the current down target callback set for this L4 protocol (IPv6 ca...
uint8_t GetMaxUnicastSolicit() const
Neighbor Discovery node constants: max unicast solicitations.
void HandleTimeExceeded(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Time Exceeded method.
bool Lookup(Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
Lookup in the ND cache for the IPv6 address.
void HandleRedirection(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Redirection method.
void HandleEchoRequest(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Echo Request method.
virtual int GetVersion() const
Get the version of the protocol.
void HandleDestinationUnreachable(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Destination Unreachable method.
Ptr< RandomVariableStream > m_solicitationJitter
Random jitter before sending solicitations.
void SendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Send a packet via ICMPv6, note that packet already contains ICMPv6 header.
Time m_delayFirstProbe
Neighbor Discovery node constants: delay for the first probe.
Icmpv6L4Protocol()
Constructor.
void HandleNS(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Solicitation method.
virtual int GetProtocolNumber() const
Get the protocol number.
void ReceiveLLA(Icmpv6OptionLinkLayerAddress lla, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Link layer address option processing.
void SendEchoReply(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Send a Echo Reply.
NdiscCache::Ipv6PayloadHeaderPair ForgeRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Forge a Router Solicitation.
NdiscCache::Ipv6PayloadHeaderPair ForgeNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Forge a Neighbor Solicitation.
void HandleParameterError(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Parameter Error method.
void SendNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Send a Neighbor Adverstisement.
virtual IpL4Protocol::DownTargetCallback GetDownTarget(void) const
This method allows a caller to get the current down target callback set for this L4 protocol (IPv4 ca...
static TypeId GetTypeId()
Get the type ID.
Time GetReachableTime() const
Neighbor Discovery node constants: reachable time.
virtual enum IpL4Protocol::RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > interface)
Receive method.
void HandleRA(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Router Advertisement method.
CacheList m_cacheList
A list of cache by device.
uint8_t GetMaxMulticastSolicit() const
Neighbor Discovery node constants: max multicast solicitations.
void SetNode(Ptr< Node > node)
Set the node.
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
ICMPv6 Neighbor Advertisement header.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
bool GetFlagS() const
Get the S flag.
void SetFlagS(bool s)
Set the S flag.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
void SetFlagR(bool r)
Set the R flag.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
bool GetFlagR() const
Get the R flag.
bool GetFlagO() const
Get the O flag.
void SetFlagO(bool o)
Set the O flag.
ICMPv6 Neighbor Solicitation header.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
ICMPv6 link-layer address option.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
Address GetAddress() const
Get the hardware address.
void SetAddress(Address addr)
Set the hardware address.
ICMPv6 redirected option.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
ICMPv6 Error Parameter Error header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
void SetPtr(uint32_t ptr)
Set the pointer field.
ICMPv6 Router Advertisement header.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
ICMPv6 Router Solicitation header.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
ICMPv6 Redirection header.
Ipv6Address GetTarget() const
Get the IPv6 target address.
void SetDestination(Ipv6Address destination)
Set the IPv6 destination address.
Ipv6Address GetDestination() const
Get the IPv6 destination address.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
ICMPv6 Error Time Exceeded header.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
ICMPv6 Error Too Big header.
void SetMtu(uint32_t mtu)
Set the MTU.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
uint32_t GetMtu() const
Get the MTU field.
Hold a signed integer type.
L4 Protocol abstract base class.
virtual void ReceiveIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, Ipv4Address payloadSource, Ipv4Address payloadDestination, const uint8_t payload[8])
Called from lower-level layers to send the ICMP packet up in the stack.
Describes an IPv6 address.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
bool IsAny() const
If the IPv6 address is the "Any" address.
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.
Access to the IPv6 forwarding table, interfaces, and configuration.
virtual void Send(Ptr< Packet > packet, Ipv6Address source, Ipv6Address destination, uint8_t protocol, Ptr< Ipv6Route > route)=0
Higher-level layers call this method to send a packet down the stack to the MAC and PHY layers.
IPv6 address associated with an interface.
Ipv6Address GetAddress() const
Get the IPv6 address.
uint32_t GetNsDadUid() const
Get the latest DAD probe packet UID.
Ipv6InterfaceAddress::State_e GetState() const
Get the address state.
@ PREFERRED
Preferred address.
@ TENTATIVE_OPTIMISTIC
Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished.
@ INVALID
Invalid state (after a DAD failed)
@ TENTATIVE
Address is tentative, no packet can be sent unless DAD finished.
The IPv6 representation of a network interface.
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
Ipv6InterfaceAddress GetAddressMatchingDestination(Ipv6Address dst)
Get an address which is in the same network prefix as destination.
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
void SetNsDadUid(Ipv6Address address, uint32_t uid)
Update NS DAD packet UID of an interface address.
void Send(Ptr< Packet > p, const Ipv6Header &hdr, Ipv6Address dest)
Send a packet through this interface.
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
IPv6 layer implementation.
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
Describes an IPv6 prefix.
A record that holds information about a NdiscCache entry.
bool IsPermanent() const
Is the entry PERMANENT.
void ClearWaitingPacket()
Clear the waiting packet list.
std::list< Ipv6PayloadHeaderPair > MarkStale(Address mac)
Changes the state to this entry to STALE.
void StartReachableTimer()
Start the reachable timer.
Address GetMacAddress() const
Get the MAC address of this entry.
void StartDelayTimer()
Start delay timer.
std::list< Ipv6PayloadHeaderPair > MarkReachable(Address mac)
Changes the state to this entry to REACHABLE.
bool IsIncomplete() const
Is the entry INCOMPLETE.
bool IsDelay() const
Is the entry DELAY.
void StartRetransmitTimer()
Start retransmit timer.
void MarkIncomplete(Ipv6PayloadHeaderPair p)
Changes the state to this entry to INCOMPLETE.
bool IsStale() const
Is the entry STALE.
void SetMacAddress(Address mac)
Set the MAC address of this entry.
bool IsProbe() const
Is the entry PROBE.
void MarkDelay()
Change the state to this entry to DELAY.
void SetRouter(bool router)
Set the node type.
void AddWaitingPacket(Ipv6PayloadHeaderPair p)
Add a packet (or replace old value) in the queue.
bool IsReachable() const
Is the entry REACHABLE.
void StopNudTimer()
Stop NUD timer and reset the NUD retransmission counter.
void SetDevice(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface, Ptr< Icmpv6L4Protocol > icmpv6)
Set the device and interface.
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv4 header.
virtual NdiscCache::Entry * Add(Ipv6Address to)
Add an entry.
void Flush()
Flush the cache.
void Remove(NdiscCache::Entry *entry)
Delete an entry.
virtual NdiscCache::Entry * Lookup(Ipv6Address dst)
Lookup in the cache.
Ptr< NetDevice > GetDevice() const
Get the NetDevice associated with this cache.
Ptr< Ipv6Interface > GetInterface() const
Get the Ipv6Interface associated with this cache.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
virtual Address GetAddress(void) const =0
virtual Address GetMulticast(Ipv4Address multicastGroup) const =0
Make and return a MAC multicast address using the provided multicast group.
virtual void AddLinkChangeCallback(Callback< void > callback)=0
virtual void DoDispose(void)
Destructor implementation.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void Dispose(void)
Dispose of this Object.
virtual void NotifyNewAggregate(void)
Notify all Objects aggregated to this one of a new Object being aggregated.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
uint64_t GetUid(void) const
Returns the packet's Uid.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
virtual double GetValue(void)=0
Get the next random value as a double drawn from the distribution.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
SocketErrno
Enumeration of the possible errors returned by a socket.
This class implements a tag that carries the socket-specific HOPLIMIT of a packet to the IPv6 layer.
void SetHopLimit(uint8_t hopLimit)
Set the tag's Hop Limit.
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...