A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
hello-regression-test.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 IITP RAS
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Pavel Boyko <boyko@iitp.ru>
7 */
8
9#ifndef HELLO_REGRESSION_TEST_H
10#define HELLO_REGRESSION_TEST_H
11
12#include "ns3/ipv4-raw-socket-impl.h"
13#include "ns3/node-container.h"
14#include "ns3/nstime.h"
15#include "ns3/socket.h"
16#include "ns3/test.h"
17
18namespace ns3
19{
20namespace olsr
21{
22/**
23 * \ingroup olsr-test
24 * \ingroup tests
25 *
26 * \brief Trivial (still useful) test of OLSR operation
27 *
28 * This test creates 2 stations with point-to-point link and runs OLSR without any extra traffic.
29 * It is expected that only HELLO messages will be sent.
30 *
31 * Expected trace (5 seconds):
32 \verbatim
33 1 2
34 |------>| HELLO (empty) src = 10.1.1.1
35 |<------| HELLO (empty) src = 10.1.1.2
36 |------>| HELLO (Link type: Asymmetric link, Neighbor address: 10.1.1.2) src = 10.1.1.1
37 |<------| HELLO (Link type: Asymmetric link, Neighbor address: 10.1.1.1) src = 10.1.1.2
38 |------>| HELLO (Link type: Symmetric link, Neighbor address: 10.1.1.2) src = 10.1.1.1
39 |<------| HELLO (Link type: Symmetric link, Neighbor address: 10.1.1.1) src = 10.1.1.2
40 \endverbatim
41 */
43{
44 public:
46 ~HelloRegressionTest() override;
47
48 private:
49 /// Total simulation time
50 const Time m_time;
51 /// Create & configure test network
52 void CreateNodes();
53 void DoRun() override;
54
55 /**
56 * Receive raw data on node A
57 * \param socket receiving socket
58 */
59 void ReceivePktProbeA(Ptr<Socket> socket);
60 /// Packet counter on node A
61 uint8_t m_countA;
62 /// Receiving socket on node A
64 /**
65 * Receive raw data on node B
66 * \param socket receiving socket
67 */
68 void ReceivePktProbeB(Ptr<Socket> socket);
69 /// Packet counter on node B
70 uint8_t m_countB;
71 /// Receiving socket on node B
73};
74
75} // namespace olsr
76} // namespace ns3
77
78#endif /* HELLO_REGRESSION_TEST_H */
Smart pointer class similar to boost::intrusive_ptr.
encapsulates test code
Definition test.h:1050
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Trivial (still useful) test of OLSR operation.
void ReceivePktProbeA(Ptr< Socket > socket)
Receive raw data on node A.
Ptr< Ipv4RawSocketImpl > m_rxSocketA
Receiving socket on node A.
Ptr< Ipv4RawSocketImpl > m_rxSocketB
Receiving socket on node B.
const Time m_time
Total simulation time.
void DoRun() override
Implementation to actually run this TestCase.
uint8_t m_countA
Packet counter on node A.
uint8_t m_countB
Packet counter on node B.
void CreateNodes()
Create & configure test network.
void ReceivePktProbeB(Ptr< Socket > socket)
Receive raw data on node B.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Definition olsr.py:1