A ping6 application. More...
#include "ping6.h"
Inheritance diagram for ns3::Ping6:
Collaboration diagram for ns3::Ping6:Public Member Functions | |
| Ping6 () | |
| Constructor. More... | |
| ~Ping6 () override | |
| Destructor. More... | |
| void | SetIfIndex (uint32_t ifIndex) |
| Set the out interface index. More... | |
| void | SetLocal (Ipv6Address ipv6) |
| Set the local address. More... | |
| void | SetRemote (Ipv6Address ipv6) |
| Set the remote peer. More... | |
| void | SetRouters (std::vector< Ipv6Address > routers) |
| Set routers for routing type 0 (loose routing). More... | |
Public Member Functions inherited from ns3::Application | |
| Application () | |
| ~Application () override | |
| Ptr< Node > | GetNode () const |
| void | SetNode (Ptr< Node > node) |
| void | SetStartTime (Time start) |
| Specify application start time. More... | |
| void | SetStopTime (Time stop) |
| Specify application stop time. More... | |
Public Member Functions inherited from ns3::Object | |
| Object () | |
| Constructor. More... | |
| ~Object () override | |
| Destructor. More... | |
| void | AggregateObject (Ptr< Object > other) |
| Aggregate two Objects together. More... | |
| void | Dispose () |
| Dispose of this Object. More... | |
| AggregateIterator | GetAggregateIterator () const |
| Get an iterator to the Objects aggregated to this one. More... | |
| TypeId | GetInstanceTypeId () const override |
| Get the most derived TypeId for this Object. More... | |
| template<typename T > | |
| Ptr< T > | GetObject () const |
| Get a pointer to the requested aggregated Object. More... | |
| template<> | |
| Ptr< Object > | GetObject () const |
| Specialization of () for objects of type ns3::Object. More... | |
| template<typename T > | |
| Ptr< T > | GetObject (TypeId tid) const |
| Get a pointer to the requested aggregated Object by TypeId. More... | |
| template<> | |
| Ptr< Object > | GetObject (TypeId tid) const |
| Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
| void | Initialize () |
| Invoke DoInitialize on all Objects aggregated to this one. More... | |
| bool | IsInitialized () const |
| Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| Default constructor. More... | |
| SimpleRefCount (const SimpleRefCount &o) | |
| Copy constructor. More... | |
| uint32_t | GetReferenceCount () const |
| Get the reference count of the object. More... | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment operator. More... | |
| void | Ref () const |
| Increment the reference count. More... | |
| void | Unref () const |
| Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| Virtual destructor. More... | |
| void | GetAttribute (std::string name, AttributeValue &value) const |
| Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
| Get the value of an attribute without raising erros. More... | |
| virtual TypeId | GetInstanceTypeId () const =0 |
| Get the most derived TypeId for this Object. More... | |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| Set a single attribute, raising fatal errors if unsuccessful. More... | |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| Set a single attribute without raising errors. More... | |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| Connect a TraceSource to a Callback with a context. More... | |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| Connect a TraceSource to a Callback without a context. More... | |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected with a context. More... | |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
| static TypeId | GetTypeId () |
| Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Application | |
| static TypeId | GetTypeId () |
| Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
| static TypeId | GetTypeId () |
| Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
| static TypeId | GetTypeId () |
| Get the type ID. More... | |
Protected Member Functions | |
| void | DoDispose () override |
| Dispose this object;. More... | |
Protected Member Functions inherited from ns3::Application | |
| void | DoDispose () override |
| Destructor implementation. More... | |
| void | DoInitialize () override |
| Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
| Object (const Object &o) | |
| Copy an Object. More... | |
| virtual void | DoDispose () |
| Destructor implementation. More... | |
| virtual void | DoInitialize () |
| Initialize() implementation. More... | |
| virtual void | NotifyNewAggregate () |
| Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
| void | ConstructSelf (const AttributeConstructionList &attributes) |
| Complete construction of ObjectBase; invoked by derived classes. More... | |
| virtual void | NotifyConstructionCompleted () |
| Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
| void | HandleRead (Ptr< Socket > socket) |
| Receive method. More... | |
| void | ScheduleTransmit (Time dt) |
| Schedule sending a packet. More... | |
| void | Send () |
| Send a packet. More... | |
| void | StartApplication () override |
| Start the application. More... | |
| void | StopApplication () override |
| Stop the application. More... | |
Private Attributes | |
| Ipv6Address | m_address |
| Peer IPv6 address. More... | |
| uint32_t | m_count |
| Number of "Echo request" packets that will be sent. More... | |
| uint32_t | m_ifIndex |
| Out interface (i.e. More... | |
| Time | m_interval |
| Interval between packets sent. More... | |
| uint32_t | m_ipInterfaceIndex |
| IP interface index relative to the local address. More... | |
| Ptr< Ipv6L3Protocol > | m_ipv6Protocol |
| IP interface index relative to the local address. More... | |
| Ipv6Address | m_localAddress |
| Local address. More... | |
| Ipv6Address | m_peerAddress |
| Peer address. More... | |
| std::vector< Ipv6Address > | m_routers |
| Routers addresses for routing type 0. More... | |
| EventId | m_sendEvent |
| Event ID. More... | |
| uint32_t | m_sent |
| Number of packets sent. More... | |
| uint16_t | m_seq |
| Sequence number. More... | |
| uint32_t | m_size |
| Size of the packet. More... | |
| Ptr< Socket > | m_socket |
| Local socket. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::Application | |
| typedef void(* | DelayAddressCallback) (const Time &delay, const Address &from) |
| Common callback signature for packet delay and address. More... | |
| typedef void(* | StateTransitionCallback) (const std::string &oldState, const std::string &newState) |
| Common signature used by callbacks to application's state transition trace source. More... | |
Protected Attributes inherited from ns3::Application | |
| Ptr< Node > | m_node |
| The node that this application is installed on. More... | |
| EventId | m_startEvent |
| The event that will fire at m_startTime to start the application. More... | |
| Time | m_startTime |
| The simulation time that the application will start. More... | |
| EventId | m_stopEvent |
| The event that will fire at m_stopTime to end the application. More... | |
| Time | m_stopTime |
| The simulation time that the application will end. More... | |
Related Functions inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
A ping6 application.
ns3::Ping6 is accessible through the following paths with Config::Set and Config::Connect:
Time +9.22337e+18ns:+9.22337e+18ns Ipv6Address Ipv6Address Time +9.22337e+18ns:+9.22337e+18ns Time +9.22337e+18ns:+9.22337e+18ns No TraceSources are defined for this type.
Size of this type is 272 bytes (on a 64-bit architecture).
| ns3::Ping6::Ping6 | ( | ) |
Constructor.
Definition at line 77 of file ping6.cc.
References m_ifIndex, m_ipInterfaceIndex, m_sendEvent, m_sent, m_seq, m_socket, and NS_LOG_FUNCTION.
|
override |
|
overrideprotectedvirtual |
Dispose this object;.
Reimplemented from ns3::Object.
Definition at line 95 of file ping6.cc.
References ns3::Application::DoDispose(), and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
static |
Get the type ID.
Definition at line 43 of file ping6.cc.
References m_count, m_interval, m_localAddress, m_peerAddress, m_size, ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().
Referenced by ns3::Ping6Helper::Ping6Helper().
Here is the call graph for this function:
Here is the caller graph for this function:Receive method.
| socket | socket that receive a packet |
Definition at line 258 of file ping6.cc.
References first::address, ns3::Inet6SocketAddress::ConvertFrom(), ns3::Packet::CopyData(), ns3::Ipv6Header::GetHopLimit(), ns3::Icmpv6Echo::GetId(), ns3::Icmpv6Echo::GetSeq(), ns3::Packet::GetSize(), ns3::Icmpv6Header::ICMPV6_ECHO_REPLY, ns3::Icmpv6Header::ICMPV6_ERROR_DESTINATION_UNREACHABLE, ns3::Icmpv6Header::ICMPV6_ERROR_TIME_EXCEEDED, ns3::Inet6SocketAddress::IsMatchingType(), m_ifIndex, m_ipInterfaceIndex, m_ipv6Protocol, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Socket::RecvFrom(), ns3::Packet::RemoveHeader(), and check-style-clang-format::type.
Referenced by StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Schedule sending a packet.
| dt | interval between packet |
Definition at line 161 of file ping6.cc.
References m_sendEvent, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and Send().
Referenced by Send(), and StartApplication().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Send a packet.
Definition at line 174 of file ping6.cc.
References ns3::Packet::AddHeader(), ns3::Socket::Bind(), data, ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Application::GetNode(), ns3::Object::GetObject(), ns3::Packet::GetSize(), ns3::Ipv6Header::IPV6_EXT_ROUTING, ns3::Ipv6Header::IPV6_ICMPV6, ns3::EventId::IsExpired(), ns3::Ipv6InterfaceAddress::IsInSameSubnet(), m_count, m_ifIndex, m_interval, m_localAddress, m_peerAddress, m_routers, m_sendEvent, m_sent, m_seq, m_size, m_socket, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_WARN, ScheduleTransmit(), ns3::Socket::SendTo(), ns3::ObjectBase::SetAttribute(), ns3::Icmpv6Echo::SetId(), ns3::Ipv6ExtensionHeader::SetNextHeader(), ns3::Ipv6ExtensionLooseRoutingHeader::SetRoutersAddress(), ns3::Ipv6ExtensionRoutingHeader::SetSegmentsLeft(), ns3::Icmpv6Echo::SetSeq(), and ns3::Ipv6ExtensionRoutingHeader::SetTypeRouting().
Referenced by ScheduleTransmit().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::Ping6::SetIfIndex | ( | uint32_t | ifIndex | ) |
| void ns3::Ping6::SetLocal | ( | Ipv6Address | ipv6 | ) |
Set the local address.
| ipv6 | the local IPv6 address |
Definition at line 128 of file ping6.cc.
References m_localAddress, and NS_LOG_FUNCTION.
| void ns3::Ping6::SetRemote | ( | Ipv6Address | ipv6 | ) |
Set the remote peer.
| ipv6 | IPv6 address of the peer |
Definition at line 135 of file ping6.cc.
References m_peerAddress, and NS_LOG_FUNCTION.
| void ns3::Ping6::SetRouters | ( | std::vector< Ipv6Address > | routers | ) |
|
overrideprivatevirtual |
Start the application.
Reimplemented from ns3::Application.
Definition at line 102 of file ping6.cc.
References ns3::Socket::Bind(), ns3::Socket::CreateSocket(), ns3::Application::GetNode(), ns3::Object::GetObject(), HandleRead(), ns3::Ipv6Header::IPV6_ICMPV6, ns3::Ipv6Address::IsAny(), ns3::TypeId::LookupByName(), m_ipInterfaceIndex, m_ipv6Protocol, m_localAddress, ns3::Application::m_node, m_socket, ns3::MakeCallback(), NS_ASSERT, NS_LOG_FUNCTION, ScheduleTransmit(), ns3::Seconds(), ns3::ObjectBase::SetAttribute(), and ns3::Socket::SetRecvCallback().
Here is the call graph for this function:
|
overrideprivatevirtual |
Stop the application.
Reimplemented from ns3::Application.
Definition at line 142 of file ping6.cc.
References ns3::Simulator::Cancel(), m_sendEvent, m_socket, ns3::MakeNullCallback(), NS_LOG_FUNCTION, and ns3::Socket::SetRecvCallback().
Here is the call graph for this function:
|
private |
|
private |
Number of "Echo request" packets that will be sent.
Definition at line 129 of file ping6.h.
Referenced by GetTypeId(), and Send().
|
private |
Out interface (i.e.
for link-local communication).
Definition at line 184 of file ping6.h.
Referenced by Ping6(), HandleRead(), Send(), and SetIfIndex().
|
private |
Interval between packets sent.
Definition at line 144 of file ping6.h.
Referenced by GetTypeId(), and Send().
|
private |
IP interface index relative to the local address.
Definition at line 154 of file ping6.h.
Referenced by Ping6(), HandleRead(), and StartApplication().
|
private |
IP interface index relative to the local address.
Definition at line 159 of file ping6.h.
Referenced by HandleRead(), and StartApplication().
|
private |
Local address.
Definition at line 149 of file ping6.h.
Referenced by GetTypeId(), Send(), SetLocal(), and StartApplication().
|
private |
Peer address.
Definition at line 164 of file ping6.h.
Referenced by GetTypeId(), Send(), and SetRemote().
|
private |
Routers addresses for routing type 0.
Definition at line 189 of file ping6.h.
Referenced by Send(), and SetRouters().
|
private |
Event ID.
Definition at line 179 of file ping6.h.
Referenced by Ping6(), ScheduleTransmit(), Send(), and StopApplication().
|
private |
|
private |
|
private |
Local socket.
Definition at line 169 of file ping6.h.
Referenced by Ping6(), ~Ping6(), Send(), StartApplication(), and StopApplication().