A Discrete-Event Network Simulator
API
bug780-test.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  * Authors: Pavel Boyko <boyko@iitp.ru>
16  */
17 
18 #ifndef BUG780_TEST_H
19 #define BUG780_TEST_H
20 
21 #include "ns3/node-container.h"
22 #include "ns3/nstime.h"
23 #include "ns3/ptr.h"
24 #include "ns3/test.h"
25 
26 namespace ns3
27 {
28 
29 class Socket;
30 
31 namespace olsr
32 {
33 
40 class Bug780Test : public TestCase
41 {
42  public:
43  Bug780Test();
44  ~Bug780Test() override;
45 
46  private:
48  const Time m_time;
50  void CreateNodes();
51  void DoRun() override;
53  void SendPing();
58  void Receive(Ptr<Socket> socket);
62  uint16_t m_seq;
64  uint16_t m_recvCount;
65 };
66 
67 } // namespace olsr
68 } // namespace ns3
69 
70 #endif /* BUG780_TEST_H */
encapsulates test code
Definition: test.h:1060
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
uint16_t m_recvCount
Received ECHO Reply counter.
Definition: bug780-test.h:64
void DoRun() override
Implementation to actually run this TestCase.
Definition: bug780-test.cc:60
const Time m_time
Total simulation time.
Definition: bug780-test.h:48
void Receive(Ptr< Socket > socket)
Receive echo reply.
Definition: bug780-test.cc:149
void CreateNodes()
Create & configure test network.
Definition: bug780-test.cc:75
uint16_t m_seq
Sequence number.
Definition: bug780-test.h:62
Ptr< Socket > m_socket
Socket.
Definition: bug780-test.h:60
void SendPing()
Send one ping.
Definition: bug780-test.cc:120
~Bug780Test() override
Definition: bug780-test.cc:55
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Definition: olsr.py:1