|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
909 Forward (src, timeexceeded, timeexceeded.
GetCode (), ipHeader, payload);
955 tag.SetHopLimit (ttl);
970 NS_ASSERT (ipv6 != 0 && ipv6->GetRoutingProtocol () != 0);
978 route = ipv6->GetRoutingProtocol ()->RouteOutput (packet, header, oif, err);
999 NS_LOG_FUNCTION (
this << src << dst << hardwareAddress <<
static_cast<uint32_t
> (flags));
1004 NS_LOG_LOGIC (
"Send NA ( from " << src <<
" to " << dst <<
" target " << src <<
")");
1055 NS_LOG_LOGIC (
"Send NS ( from " << src <<
" to " << dst <<
" target " << target <<
")");
1066 NS_LOG_LOGIC (
"Destination is Multicast, using DelayedSendMessage");
1086 NS_LOG_LOGIC (
"Send RS (from " << src <<
" to " << dst <<
")");
1096 NS_LOG_LOGIC (
"Destination is Multicast, using DelayedSendMessage");
1105 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1108 NS_LOG_LOGIC (
"Send Destination Unreachable ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1111 if (malformedPacketSize <= 1280 - 48)
1129 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1135 if (malformedPacketSize <= 1280 - 48)
1152 NS_LOG_FUNCTION (
this << malformedPacket << dst <<
static_cast<uint32_t
> (code));
1154 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1157 NS_LOG_LOGIC (
"Send Time Exceeded ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1160 if (malformedPacketSize <= 1280 - 48)
1176 NS_LOG_FUNCTION (
this << malformedPacket << dst <<
static_cast<uint32_t
> (code) << ptr);
1178 uint32_t malformedPacketSize = malformedPacket->
GetSize ();
1181 NS_LOG_LOGIC (
"Send Parameter Error ( to " << dst <<
" code " << (uint32_t)code <<
" )");
1184 if (malformedPacketSize <= 1280 - 48 )
1201 NS_LOG_FUNCTION (
this << redirectedPacket << dst << redirTarget << redirDestination << redirHardwareTarget);
1202 uint32_t llaSize = 0;
1204 uint32_t redirectedPacketSize = redirectedPacket->
GetSize ();
1207 NS_LOG_LOGIC (
"Send Redirection ( to " << dst <<
" target " << redirTarget <<
" destination " << redirDestination <<
" )");
1211 if ((redirectedPacketSize % 8) != 0)
1213 Ptr<Packet> pad = Create<Packet> (8 - (redirectedPacketSize % 8));
1224 if (redirectedPacketSize <= (1280 - 56 - llaSize))
1226 redirectedOptionHeader.
SetPacket (redirectedPacket);
1231 redirectedOptionHeader.
SetPacket (fragment);
1242 redirectionHeader.
SetTarget (redirTarget);
1252 NS_LOG_FUNCTION (
this << src << dst << hardwareAddress << (uint32_t)flags);
1258 NS_LOG_LOGIC (
"Send NA ( from " << src <<
" to " << dst <<
")");
1298 NS_LOG_LOGIC (
"Send NS ( from " << src <<
" to " << dst <<
" target " << target <<
")");
1319 if ((*i)->GetDevice () == device)
1325 NS_ASSERT_MSG (
false,
"Icmpv6L4Protocol can not find a NDIS Cache for device " << device);
1336 cache->
SetDevice (device, interface,
this);
1344 NS_LOG_FUNCTION (
this << dst << device << cache << hardwareDestination);
1375 NS_LOG_FUNCTION (
this << p << ipHeader << dst << device << cache << hardwareDestination);
1457 for (i = 0; i < nb; i++)
1470 NS_LOG_LOGIC (
"Can not find the address in the interface.");
1486 if (!ipv6->IsForwarding (ipv6->GetInterfaceForDevice (interface->
GetDevice ())) && addr.
IsLinkLocal ())
1496 NS_LOG_LOGIC (
"Did not schedule a Router Solicitation because the interface is in forwarding mode");
Ptr< Packet > GetPacket() const
Get the incorrect packet.
The IPv6 representation of a network interface.
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void NotifyNewAggregate(void)
Notify all Objects aggregated to this one of a new Object being aggregated.
IPv6 address associated with an interface.
Ptr< Ipv6Interface > GetInterface() const
Get the Ipv6Interface associated with this cache.
bool IsStale() const
Is the entry STALE.
Time m_delayFirstProbe
Neighbor Discovery node constants: delay for the first probe.
void Dispose(void)
Dispose of this Object.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetNsDadUid(Ipv6Address address, uint32_t uid)
Update NS DAD packet UID of an interface address.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< Packet > GetPacket() const
Get the incorrect packet.
void Flush()
Flush the cache.
void ReceiveLLA(Icmpv6OptionLinkLayerAddress lla, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Link layer address option processing.
static uint16_t GetStaticProtocolNumber()
Get ICMPv6 protocol number.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
AttributeValue implementation for Boolean.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
Time GetReachableTime() const
Neighbor Discovery node constants: reachable time.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
ICMPv6 Error Time Exceeded header.
void AddHeader(const Header &header)
Add header to this packet.
SocketErrno
Enumeration of the possible errors returned by a socket.
virtual Address GetAddress(void) const =0
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
Time GetDelayFirstProbe() const
Neighbor Discovery node constants : delay for the first probe.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ipv6Address GetAddress() const
Get the IPv6 address.
static Ipv6Address MakeSolicitedAddress(Ipv6Address addr)
Make the solicited IPv6 address.
bool IsReachable() const
Is the entry REACHABLE.
@ INVALID
Invalid state (after a DAD failed)
bool IsNull(void) const
Check for null implementation.
void ClearWaitingPacket()
Clear the waiting packet list.
Hold a signed integer type.
void DelayedSendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Helper function used during delayed solicitation.
void SetDestination(Ipv6Address destination)
Set the IPv6 destination address.
uint8_t GetMaxMulticastSolicit() const
Neighbor Discovery node constants: max multicast solicitations.
void MarkIncomplete(Ipv6PayloadHeaderPair p)
Changes the state to this entry to INCOMPLETE.
A record that holds information about a NdiscCache entry.
virtual NdiscCache::Entry * Add(Ipv6Address to)
Add an entry.
virtual void SendNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Send a Neighbor Solicitation.
uint16_t GetId() const
Get the ID of the packet.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
IPv6 layer implementation.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
void SetRouter(bool router)
Set the node type.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
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...
bool GetFlagR() const
Get the R flag.
void SetFlagS(bool s)
Set the S flag.
virtual int GetVersion() const
Get the version of the protocol.
void SendNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Send a Neighbor Adverstisement.
Describes an IPv6 address.
NdiscCache::Ipv6PayloadHeaderPair ForgeNA(Ipv6Address src, Ipv6Address dst, Address *hardwareAddress, uint8_t flags)
Forge a Neighbor Advertisement.
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...
void SetPtr(uint32_t ptr)
Set the pointer field.
NdiscCache::Ipv6PayloadHeaderPair ForgeEchoRequest(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Forge an Echo Request.
Ipv6Address GetDestination() const
Get the IPv6 destination address.
Ipv6InterfaceAddress GetAddress(uint32_t index) const
Get an address from IPv6 interface.
virtual Ptr< NdiscCache > CreateCache(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface)
Create a neighbor cache.
void HandleRS(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Router Solicitation method.
void StartDelayTimer()
Start delay timer.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
static TypeId GetTypeId()
Get the type ID.
void SetSeq(uint16_t seq)
Set the sequence number.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
bool IsDelay() const
Is the entry DELAY.
Ipv6InterfaceAddress GetAddressMatchingDestination(Ipv6Address dst)
Get an address which is in the same network prefix as destination.
void HandlePacketTooBig(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Packet Too Big method.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Ptr< RandomVariableStream > m_solicitationJitter
Random jitter before sending solicitations.
void HandleNS(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Solicitation method.
void FunctionDadTimeout(Ipv6Interface *interface, Ipv6Address addr)
Function called when DAD timeout.
void HandleNA(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Neighbor Advertisement method.
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 DoDAD(Ipv6Address target, Ptr< Ipv6Interface > interface)
Do the Duplication Address Detection (DAD).
Ptr< NdiscCache > FindCache(Ptr< NetDevice > device)
Get the cache corresponding to the device.
ICMPv6 redirected option.
void AddWaitingPacket(Ipv6PayloadHeaderPair p)
Add a packet (or replace old value) in the queue.
IpL4Protocol::DownTargetCallback6 m_downTarget
callback to Ipv6::Send
bool Lookup(Ipv6Address dst, Ptr< NetDevice > device, Ptr< NdiscCache > cache, Address *hardwareDestination)
Lookup in the ND cache for the IPv6 address.
uint32_t GetMtu() const
Get the MTU field.
@ PREFERRED
Preferred address.
bool GetFlagS() const
Get the S flag.
Ptr< Node > m_node
The node.
ICMPv6 link-layer address option.
bool IsLinkLocal() const
If the IPv6 address is a link-local address (fe80::/64).
void SetDevice(Ptr< NetDevice > device, Ptr< Ipv6Interface > interface, Ptr< Icmpv6L4Protocol > icmpv6)
Set the device and interface.
bool IsPermanent() const
Is the entry PERMANENT.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
void SetFlagR(bool r)
Set the R flag.
void SetMacAddress(Address mac)
Set the MAC address of this entry.
void StopNudTimer()
Stop NUD timer and reset the NUD retransmission counter.
void Remove(NdiscCache::Entry *entry)
Delete an entry.
a polymophic address class
ICMPv6 Router Advertisement header.
ICMPv6 Neighbor Advertisement header.
Ptr< Node > GetNode()
Get the node.
void SetFlagO(bool o)
Set the O flag.
CacheList m_cacheList
A list of cache by device.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
virtual enum IpL4Protocol::RxStatus Receive(Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > interface)
Receive method.
void HandleEchoRequest(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Echo Request method.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
Ipv6Address GetTarget() const
Get the IPv6 target address.
This class implements a tag that carries the socket-specific HOPLIMIT of a packet to the IPv6 layer.
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...
std::list< Ipv6PayloadHeaderPair > MarkStale(Address mac)
Changes the state to this entry to STALE.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
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.
void StartRetransmitTimer()
Start retransmit timer.
void StartReachableTimer()
Start the reachable timer.
Simulation virtual time values and global simulation resolution.
uint16_t GetLifeTime() const
Get the node Life time (Neighbor Discovery).
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
virtual uint32_t GetSerializedSize() const
Get the serialized size.
bool IsProbe() const
Is the entry PROBE.
Time m_retransmissionTime
Neighbor Discovery node constants: retransmission timer.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
static const uint16_t PROT_NUMBER
The protocol number for IPv6 (0x86DD).
@ TENTATIVE_OPTIMISTIC
Address is tentative but we are optimistic so we can send packet even if DAD is not yet finished.
@ TENTATIVE
Address is tentative, no packet can be sent unless DAD finished.
static const uint8_t PROT_NUMBER
ICMPv6 protocol number (58).
virtual Address GetMulticast(Ipv4Address multicastGroup) const =0
Make and return a MAC multicast address using the provided multicast group.
static Ipv6Address GetZero()
Get the 0 (::) Ipv6Address.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
Ipv6InterfaceAddress GetLinkLocalAddress() const
Get link-local address from IPv6 interface.
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.
L4 Protocol abstract base class.
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...
Address GetAddress() const
Get the hardware address.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void SetPacket(Ptr< Packet > packet)
Set the redirected packet.
Hold variables of type string.
void SetState(Ipv6Address address, Ipv6InterfaceAddress::State_e state)
Update state of an interface address.
Ipv6Address GetIpv6Target() const
Get the IPv6 target field.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
ICMPv6 Router Solicitation header.
virtual NdiscCache::Entry * Lookup(Ipv6Address dst)
Lookup in the cache.
void NotifyNewAggregate()
This method is called by AggregateObject and completes the aggregation by setting the node in the ICM...
void SendRedirection(Ptr< Packet > redirectedPacket, Ipv6Address src, Ipv6Address dst, Ipv6Address redirTarget, Ipv6Address redirDestination, Address redirHardwareTarget)
Send an ICMPv6 Redirection.
ICMPv6 Neighbor Solicitation header.
bool IsMulticast() const
If the IPv6 address is multicast (ff00::/8).
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual Ptr< NetDevice > GetDevice() const
Get the NetDevice.
void SendRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Send a Router Solicitation.
Icmpv6L4Protocol()
Constructor.
uint8_t GetMaxUnicastSolicit() const
Neighbor Discovery node constants: max unicast solicitations.
void SendErrorTimeExceeded(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Time Exceeded.
void AddAtEnd(Ptr< const Packet > packet)
Concatenate the input packet at the end of the current packet.
void MarkDelay()
Change the state to this entry to DELAY.
bool GetFlagO() const
Get the O flag.
Ptr< Packet > GetPacket() const
Get the incorrect packet.
static Ipv6Address GetAllNodesMulticast()
Get the "all nodes multicast" address.
uint8_t m_maxMulticastSolicit
Neighbor Discovery node constants: max multicast solicitations.
virtual double GetValue(void)=0
Get the next random value as a double drawn from the distribution.
void SetTarget(Ipv6Address target)
Set the IPv6 target address.
std::pair< Ptr< Packet >, Ipv6Header > Ipv6PayloadHeaderPair
Pair of a packet and an Ipv4 header.
Time GetRetransmissionTime() const
Neighbor Discovery node constants: retransmission timer.
uint32_t GetNsDadUid() const
Get the latest DAD probe packet UID.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
virtual void AddLinkChangeCallback(Callback< void > callback)=0
void SetNode(Ptr< Node > node)
Set the node.
void HandleRedirection(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Redirection method.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
ICMPv6 Error Parameter Error header.
void HandleTimeExceeded(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Time Exceeded method.
void SetMtu(uint32_t mtu)
Set the MTU.
virtual uint32_t GetSerializedSize() const
Get the serialized size.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SendEchoReply(Ipv6Address src, Ipv6Address dst, uint16_t id, uint16_t seq, Ptr< Packet > data)
Send a Echo Reply.
uint8_t GetLength(void) const
Get the length of the underlying address.
void SetAddress(Address addr)
Set the hardware address.
Access to the IPv6 forwarding table, interfaces, and configuration.
uint16_t GetSeq() const
Get the sequence number.
void SetId(uint16_t id)
Set the ID of the packet.
void Send(Ptr< Packet > p, const Ipv6Header &hdr, Ipv6Address dest)
Send a packet through this interface.
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
void SetIpv6Target(Ipv6Address target)
Set the IPv6 target field.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
void SendMessage(Ptr< Packet > packet, Ipv6Address src, Ipv6Address dst, uint8_t ttl)
Send a packet via ICMPv6, note that packet already contains ICMPv6 header.
void HandleDestinationUnreachable(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Destination Unreachable method.
virtual ~Icmpv6L4Protocol()
Destructor.
void HandleParameterError(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Parameter Error method.
std::list< Ipv6PayloadHeaderPair > MarkReachable(Address mac)
Changes the state to this entry to REACHABLE.
bool IsAny() const
If the IPv6 address is the "Any" address.
void SendErrorTooBig(Ptr< Packet > malformedPacket, Ipv6Address dst, uint32_t mtu)
Send an error Too Big.
Ipv6InterfaceAddress::State_e GetState() const
Get the address state.
void HandleRA(Ptr< Packet > p, Ipv6Address const &src, Ipv6Address const &dst, Ptr< Ipv6Interface > interface)
Receive Router Advertisement method.
Describes an IPv6 prefix.
void SetPacket(Ptr< Packet > p)
Set the incorrect packet.
Time m_reachableTime
Neighbor Discovery node constants: reachable time.
ICMPv6 Redirection header.
bool IsIncomplete() const
Is the entry INCOMPLETE.
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...
NdiscCache::Ipv6PayloadHeaderPair ForgeRS(Ipv6Address src, Ipv6Address dst, Address hardwareAddress)
Forge a Router Solicitation.
void SendErrorDestinationUnreachable(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code)
Send an error Destination Unreachable.
virtual void DoDispose(void)
Destructor implementation.
An implementation of the ICMPv6 protocol.
NdiscCache::Ipv6PayloadHeaderPair ForgeNS(Ipv6Address src, Ipv6Address dst, Ipv6Address target, Address hardwareAddress)
Forge a Neighbor Solicitation.
void SendErrorParameterError(Ptr< Packet > malformedPacket, Ipv6Address dst, uint8_t code, uint32_t ptr)
Send an error Parameter Error.
virtual void DoDispose()
Dispose this object.
static Ipv6Address GetAllRoutersMulticast()
Get the "all routers multicast" address.
ICMPv6 Error Too Big header.
void SetHopLimit(uint8_t hopLimit)
Set the tag's Hop Limit.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< NetDevice > GetDevice() const
Get the NetDevice associated with this cache.
uint64_t GetUid(void) const
Returns the packet's Uid.
Address GetMacAddress() const
Get the MAC address of this entry.
uint32_t GetNAddresses(void) const
Get number of addresses on this IPv6 interface.
virtual int GetProtocolNumber() const
Get the protocol number.
ICMPv6 Error Destination Unreachable header.
uint8_t m_maxUnicastSolicit
Neighbor Discovery node constants: max unicast solicitations.
void Nullify(void)
Discard the implementation, set it to null.
bool m_alwaysDad
Always do DAD ?
virtual uint32_t GetSerializedSize() const
Get the serialized size.
bool IsAlwaysDad() const
Is the node must do DAD.