A Discrete-Event Network Simulator
API
ping6.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2009 Strasbourg University
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
18  */
19 
20 #ifndef PING6_H
21 #define PING6_H
22 
23 #include "ns3/application.h"
24 #include "ns3/ipv6-address.h"
25 #include "ns3/ipv6-l3-protocol.h"
26 
27 namespace ns3
28 {
29 
30 class Packet;
31 class Socket;
32 
42 class NS_DEPRECATED_3_38("Use Ping instead - the attributes might have been renamed.") Ping6
43  : public Application
44 {
45  public:
50  static TypeId GetTypeId();
51 
55  Ping6();
56 
60  ~Ping6() override;
61 
66  void SetLocal(Ipv6Address ipv6);
67 
72  void SetRemote(Ipv6Address ipv6);
73 
80  void SetIfIndex(uint32_t ifIndex);
81 
86  void SetRouters(std::vector<Ipv6Address> routers);
87 
88  protected:
92  void DoDispose() override;
93 
94  private:
98  void StartApplication() override;
99 
103  void StopApplication() override;
104 
109  void ScheduleTransmit(Time dt);
110 
114  void Send();
115 
120  void HandleRead(Ptr<Socket> socket);
121 
125  Ipv6Address m_address;
126 
130  uint32_t m_count;
131 
135  uint32_t m_sent;
136 
140  uint32_t m_size;
141 
145  Time m_interval;
146 
150  Ipv6Address m_localAddress;
151 
155  uint32_t m_ipInterfaceIndex;
156 
160  Ptr<Ipv6L3Protocol> m_ipv6Protocol;
161 
165  Ipv6Address m_peerAddress;
166 
170  Ptr<Socket> m_socket;
171 
175  uint16_t m_seq;
176 
180  EventId m_sendEvent;
181 
185  uint32_t m_ifIndex;
186 
190  std::vector<Ipv6Address> m_routers;
191 };
192 
193 } /* namespace ns3 */
194 
195 #endif /* PING6_H */
static void Send(Ptr< NetDevice > dev, int level, std::string emuMode)
Definition: fd-emu-send.cc:54
#define NS_DEPRECATED_3_38(msg)
Tag for things deprecated in version ns-3.38.
Definition: deprecated.h:82
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:848
Every class exported by the ns3 library is enclosed in the ns3 namespace.