A Discrete-Event Network Simulator
API
v4ping.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License version 2 as
4  * published by the Free Software Foundation;
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  */
15 
16 #ifndef V4PING_H
17 #define V4PING_H
18 
19 #include "ns3/application.h"
20 #include "ns3/average.h"
21 #include "ns3/traced-callback.h"
22 
23 #include <map>
24 
25 namespace ns3
26 {
27 
28 class Socket;
29 
42 class NS_DEPRECATED_3_38("Use Ping instead - the attributes might have been renamed.") V4Ping
43  : public Application
44 {
45  public:
50  static TypeId GetTypeId();
51 
55  V4Ping();
56  ~V4Ping() override;
57 
58  private:
67  void Write32(uint8_t* buffer, const uint32_t data);
74  void Read32(const uint8_t* buffer, uint32_t& data);
75 
76  // inherited from Application base class.
77  void StartApplication() override;
78  void StopApplication() override;
79  void DoDispose() override;
84  uint32_t GetApplicationId() const;
91  void Receive(Ptr<Socket> socket);
95  void Send();
96 
98  Ipv4Address m_remote;
100  Time m_interval;
106  uint32_t m_size;
108  Ptr<Socket> m_socket;
110  uint16_t m_seq;
112  TracedCallback<Time> m_traceRtt;
114  bool m_verbose;
116  uint32_t m_recv;
118  Time m_started;
120  Average<double> m_avgRtt;
122  EventId m_next;
124  std::map<uint16_t, Time> m_sent;
125 };
126 
127 } // namespace ns3
128 
129 #endif /* V4PING_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.
uint8_t data[writeSize]