A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Ping6 Class Reference

A ping6 application. More...

#include <ping6.h>

+ Inheritance diagram for ns3::Ping6:
+ Collaboration diagram for ns3::Ping6:

Public Member Functions

 Ping6 ()
 Constructor.
virtual ~Ping6 ()
 Destructor.
void SetIfIndex (uint32_t ifIndex)
 Set the out interface index. This is to send to link-local (unicast or multicast) address when a node has multiple interfaces.
void SetLocal (Ipv6Address ipv6)
 Set the local address.
void SetRemote (Ipv6Address ipv6)
 Set the remote peer.
void SetRouters (std::vector< Ipv6Address > routers)
 Set routers for routing type 0 (loose routing).
- Public Member Functions inherited from ns3::Application
 Application ()
virtual ~Application ()
Ptr< NodeGetNode () const
void SetNode (Ptr< Node > node)
void SetStartTime (Time start)
 Specify application start time.
void SetStopTime (Time stop)
 Specify application stop time.
- Public Member Functions inherited from ns3::Object
 Object ()
virtual ~Object ()
void AggregateObject (Ptr< Object > other)
void Dispose (void)
AggregateIterator GetAggregateIterator (void) const
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 SimpleRefCount (const SimpleRefCount &o)
uint32_t GetReferenceCount (void) const
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.

Protected Member Functions

virtual void DoDispose ()
 Dispose this object;.
- Protected Member Functions inherited from ns3::Application
virtual void DoStart (void)
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
virtual void NotifyNewAggregate (void)

Private Member Functions

void HandleRead (Ptr< Socket > socket)
 Receive method.
void ScheduleTransmit (Time dt)
 Schedule sending a packet.
void Send ()
 Send a packet.
virtual void StartApplication ()
 Start the application.
virtual void StopApplication ()
 Stop the application.

Private Attributes

Ipv6Address m_address
 Peer IPv6 address.
uint32_t m_count
 Number of "Echo request" packets that will be sent.
uint32_t m_ifIndex
 Out interface (i.e. for link-local communication).
Time m_interval
 Intervall between packets sent.
Ipv6Address m_localAddress
 Local address.
Ipv6Address m_peerAddress
 Peer address.
std::vector< Ipv6Addressm_routers
 Routers addresses for routing type 0.
EventId m_sendEvent
 Event ID.
uint32_t m_sent
 Number of packets sent.
uint16_t m_seq
 Sequence number.
uint32_t m_size
 Size of the packet.
Ptr< Socketm_socket
 Local socket.

Additional Inherited Members

- Protected Attributes inherited from ns3::Application
Ptr< Nodem_node
EventId m_startEvent
Time m_startTime
EventId m_stopEvent
Time m_stopTime

Detailed Description

A ping6 application.

Definition at line 45 of file ping6.h.

Constructor & Destructor Documentation

ns3::Ping6::Ping6 ( )

Constructor.

Definition at line 79 of file ping6.cc.

References m_sendEvent, m_sent, m_seq, m_socket, and NS_LOG_FUNCTION_NOARGS.

ns3::Ping6::~Ping6 ( )
virtual

Destructor.

Definition at line 88 of file ping6.cc.

References m_socket, and NS_LOG_FUNCTION_NOARGS.

Member Function Documentation

void ns3::Ping6::DoDispose ( void  )
protectedvirtual

Dispose this object;.

Reimplemented from ns3::Application.

Definition at line 94 of file ping6.cc.

References NS_LOG_FUNCTION_NOARGS.

TypeId ns3::Ping6::GetTypeId ( void  )
static

Get the type ID.

This method returns the TypeId associated to ns3::Ping6.

Returns
type ID

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/ApplicationList/[i]/$ns3::Ping6

Attributes defined for this type:

  • MaxPackets: The maximum number of packets the application will send
  • Interval: The time to wait between packets
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • RemoteIpv6: The Ipv6Address of the outbound packets
    • Set with class: Ipv6AddressValue
    • Underlying type: Ipv6Address
    • Initial value: 0000:0000:0000:0000:0000:0000:0000:0000
    • Flags: construct write read
  • LocalIpv6: Local Ipv6Address of the sender
    • Set with class: Ipv6AddressValue
    • Underlying type: Ipv6Address
    • Initial value: 0000:0000:0000:0000:0000:0000:0000:0000
    • Flags: construct write read
  • PacketSize: Size of packets generated

Attributes defined in parent class ns3::Application:

  • StartTime: Time at which the application will start
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +0.0ns
    • Flags: construct write read
  • StopTime: Time at which the application will stop
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +0.0ns
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::Application.

Definition at line 45 of file ping6.cc.

References m_count, m_interval, m_localAddress, m_peerAddress, m_size, 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:

void ns3::Ping6::HandleRead ( Ptr< Socket socket)
private

Receive method.

Parameters
socketsocket that receive a packet

Definition at line 228 of file ping6.cc.

References ns3::Inet6SocketAddress::ConvertFrom(), ns3::Packet::CopyData(), ns3::Icmpv6Echo::GetId(), ns3::Inet6SocketAddress::GetIpv6(), ns3::Icmpv6Echo::GetSeq(), ns3::Packet::GetSize(), ns3::Icmpv6Header::ICMPV6_ECHO_REPLY, ns3::Inet6SocketAddress::IsMatchingType(), NS_LOG_FUNCTION, NS_LOG_INFO, ns3::Socket::RecvFrom(), and ns3::Packet::RemoveHeader().

Referenced by StartApplication().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Ping6::ScheduleTransmit ( Time  dt)
private

Schedule sending a packet.

Parameters
dtinterval between packet

Definition at line 149 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:

void ns3::Ping6::SetIfIndex ( uint32_t  ifIndex)

Set the out interface index. This is to send to link-local (unicast or multicast) address when a node has multiple interfaces.

Parameters
ifIndexinterface index

Definition at line 144 of file ping6.cc.

References m_ifIndex.

void ns3::Ping6::SetLocal ( Ipv6Address  ipv6)

Set the local address.

Parameters
ipv6the local IPv6 address

Definition at line 120 of file ping6.cc.

References m_localAddress, and NS_LOG_FUNCTION.

void ns3::Ping6::SetRemote ( Ipv6Address  ipv6)

Set the remote peer.

Parameters
ipv6IPv6 address of the peer

Definition at line 126 of file ping6.cc.

References m_peerAddress, and NS_LOG_FUNCTION.

void ns3::Ping6::SetRouters ( std::vector< Ipv6Address routers)

Set routers for routing type 0 (loose routing).

Parameters
routersrouters addresses

Definition at line 155 of file ping6.cc.

References m_routers.

void ns3::Ping6::StopApplication ( void  )
privatevirtual

Stop the application.

Definition at line 132 of file ping6.cc.

References ns3::Simulator::Cancel(), m_sendEvent, m_socket, ns3::MakeNullCallback(), NS_LOG_FUNCTION_NOARGS, and ns3::Socket::SetRecvCallback().

+ Here is the call graph for this function:

Member Data Documentation

Ipv6Address ns3::Ping6::m_address
private

Peer IPv6 address.

Definition at line 127 of file ping6.h.

uint32_t ns3::Ping6::m_count
private

Number of "Echo request" packets that will be sent.

Definition at line 132 of file ping6.h.

Referenced by GetTypeId(), and Send().

uint32_t ns3::Ping6::m_ifIndex
private

Out interface (i.e. for link-local communication).

Definition at line 177 of file ping6.h.

Referenced by Send(), and SetIfIndex().

Time ns3::Ping6::m_interval
private

Intervall between packets sent.

Definition at line 147 of file ping6.h.

Referenced by GetTypeId(), and Send().

Ipv6Address ns3::Ping6::m_localAddress
private

Local address.

Definition at line 152 of file ping6.h.

Referenced by GetTypeId(), Send(), SetLocal(), and StartApplication().

Ipv6Address ns3::Ping6::m_peerAddress
private

Peer address.

Definition at line 157 of file ping6.h.

Referenced by GetTypeId(), Send(), SetRemote(), and StartApplication().

std::vector<Ipv6Address> ns3::Ping6::m_routers
private

Routers addresses for routing type 0.

Definition at line 182 of file ping6.h.

Referenced by Send(), and SetRouters().

EventId ns3::Ping6::m_sendEvent
private

Event ID.

Definition at line 172 of file ping6.h.

Referenced by Ping6(), ScheduleTransmit(), Send(), and StopApplication().

uint32_t ns3::Ping6::m_sent
private

Number of packets sent.

Definition at line 137 of file ping6.h.

Referenced by Ping6(), and Send().

uint16_t ns3::Ping6::m_seq
private

Sequence number.

Definition at line 167 of file ping6.h.

Referenced by Ping6(), and Send().

uint32_t ns3::Ping6::m_size
private

Size of the packet.

Definition at line 142 of file ping6.h.

Referenced by GetTypeId(), and Send().

Ptr<Socket> ns3::Ping6::m_socket
private

Local socket.

Definition at line 162 of file ping6.h.

Referenced by Ping6(), Send(), StartApplication(), StopApplication(), and ~Ping6().


The documentation for this class was generated from the following files: