A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
18
namespace
ns3
19
{
20
namespace
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
*/
42
class
HelloRegressionTest
:
public
TestCase
43
{
44
public
:
45
HelloRegressionTest
();
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
63
Ptr<Ipv4RawSocketImpl>
m_rxSocketA
;
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
72
Ptr<Ipv4RawSocketImpl>
m_rxSocketB
;
73
};
74
75
}
// namespace olsr
76
}
// namespace ns3
77
78
#endif
/* HELLO_REGRESSION_TEST_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TestCase
encapsulates test code
Definition
test.h:1050
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::olsr::HelloRegressionTest
Trivial (still useful) test of OLSR operation.
Definition
hello-regression-test.h:43
ns3::olsr::HelloRegressionTest::ReceivePktProbeA
void ReceivePktProbeA(Ptr< Socket > socket)
Receive raw data on node A.
Definition
hello-regression-test.cc:99
ns3::olsr::HelloRegressionTest::m_rxSocketA
Ptr< Ipv4RawSocketImpl > m_rxSocketA
Receiving socket on node A.
Definition
hello-regression-test.h:63
ns3::olsr::HelloRegressionTest::~HelloRegressionTest
~HelloRegressionTest() override
Definition
hello-regression-test.cc:43
ns3::olsr::HelloRegressionTest::m_rxSocketB
Ptr< Ipv4RawSocketImpl > m_rxSocketB
Receiving socket on node B.
Definition
hello-regression-test.h:72
ns3::olsr::HelloRegressionTest::m_time
const Time m_time
Total simulation time.
Definition
hello-regression-test.h:50
ns3::olsr::HelloRegressionTest::HelloRegressionTest
HelloRegressionTest()
Definition
hello-regression-test.cc:35
ns3::olsr::HelloRegressionTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
hello-regression-test.cc:48
ns3::olsr::HelloRegressionTest::m_countA
uint8_t m_countA
Packet counter on node A.
Definition
hello-regression-test.h:61
ns3::olsr::HelloRegressionTest::m_countB
uint8_t m_countB
Packet counter on node B.
Definition
hello-regression-test.h:70
ns3::olsr::HelloRegressionTest::CreateNodes
void CreateNodes()
Create & configure test network.
Definition
hello-regression-test.cc:63
ns3::olsr::HelloRegressionTest::ReceivePktProbeB
void ReceivePktProbeB(Ptr< Socket > socket)
Receive raw data on node B.
Definition
hello-regression-test.cc:152
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
olsr
Definition
olsr.py:1
src
olsr
test
hello-regression-test.h
Generated on Fri Nov 8 2024 13:59:05 for ns-3 by
1.11.0