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
* 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
* Authors: Pavel Boyko <boyko@iitp.ru>
18
*/
19
20
#ifndef HELLO_REGRESSION_TEST_H
21
#define HELLO_REGRESSION_TEST_H
22
23
#include "ns3/ipv4-raw-socket-impl.h"
24
#include "ns3/node-container.h"
25
#include "ns3/nstime.h"
26
#include "ns3/socket.h"
27
#include "ns3/test.h"
28
29
namespace
ns3
30
{
31
namespace
olsr
32
{
33
/**
34
* \ingroup olsr-test
35
* \ingroup tests
36
*
37
* \brief Trivial (still useful) test of OLSR operation
38
*
39
* This test creates 2 stations with point-to-point link and runs OLSR without any extra traffic.
40
* It is expected that only HELLO messages will be sent.
41
*
42
* Expected trace (5 seconds):
43
\verbatim
44
1 2
45
|------>| HELLO (empty) src = 10.1.1.1
46
|<------| HELLO (empty) src = 10.1.1.2
47
|------>| HELLO (Link type: Asymmetric link, Neighbor address: 10.1.1.2) src = 10.1.1.1
48
|<------| HELLO (Link type: Asymmetric link, Neighbor address: 10.1.1.1) src = 10.1.1.2
49
|------>| HELLO (Link type: Symmetric link, Neighbor address: 10.1.1.2) src = 10.1.1.1
50
|<------| HELLO (Link type: Symmetric link, Neighbor address: 10.1.1.1) src = 10.1.1.2
51
\endverbatim
52
*/
53
class
HelloRegressionTest
:
public
TestCase
54
{
55
public
:
56
HelloRegressionTest
();
57
~HelloRegressionTest
()
override
;
58
59
private
:
60
/// Total simulation time
61
const
Time
m_time
;
62
/// Create & configure test network
63
void
CreateNodes
();
64
void
DoRun
()
override
;
65
66
/**
67
* Receive raw data on node A
68
* \param socket receiving socket
69
*/
70
void
ReceivePktProbeA
(
Ptr<Socket>
socket);
71
/// Packet counter on node A
72
uint8_t
m_countA
;
73
/// Receiving socket on node A
74
Ptr<Ipv4RawSocketImpl>
m_rxSocketA
;
75
/**
76
* Receive raw data on node B
77
* \param socket receiving socket
78
*/
79
void
ReceivePktProbeB
(
Ptr<Socket>
socket);
80
/// Packet counter on node B
81
uint8_t
m_countB
;
82
/// Receiving socket on node B
83
Ptr<Ipv4RawSocketImpl>
m_rxSocketB
;
84
};
85
86
}
// namespace olsr
87
}
// namespace ns3
88
89
#endif
/* HELLO_REGRESSION_TEST_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TestCase
encapsulates test code
Definition:
test.h:1061
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::olsr::HelloRegressionTest
Trivial (still useful) test of OLSR operation.
Definition:
hello-regression-test.h:54
ns3::olsr::HelloRegressionTest::ReceivePktProbeA
void ReceivePktProbeA(Ptr< Socket > socket)
Receive raw data on node A.
Definition:
hello-regression-test.cc:110
ns3::olsr::HelloRegressionTest::m_rxSocketA
Ptr< Ipv4RawSocketImpl > m_rxSocketA
Receiving socket on node A.
Definition:
hello-regression-test.h:74
ns3::olsr::HelloRegressionTest::~HelloRegressionTest
~HelloRegressionTest() override
Definition:
hello-regression-test.cc:54
ns3::olsr::HelloRegressionTest::m_rxSocketB
Ptr< Ipv4RawSocketImpl > m_rxSocketB
Receiving socket on node B.
Definition:
hello-regression-test.h:83
ns3::olsr::HelloRegressionTest::m_time
const Time m_time
Total simulation time.
Definition:
hello-regression-test.h:61
ns3::olsr::HelloRegressionTest::HelloRegressionTest
HelloRegressionTest()
Definition:
hello-regression-test.cc:46
ns3::olsr::HelloRegressionTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition:
hello-regression-test.cc:59
ns3::olsr::HelloRegressionTest::m_countA
uint8_t m_countA
Packet counter on node A.
Definition:
hello-regression-test.h:72
ns3::olsr::HelloRegressionTest::m_countB
uint8_t m_countB
Packet counter on node B.
Definition:
hello-regression-test.h:81
ns3::olsr::HelloRegressionTest::CreateNodes
void CreateNodes()
Create & configure test network.
Definition:
hello-regression-test.cc:74
ns3::olsr::HelloRegressionTest::ReceivePktProbeB
void ReceivePktProbeB(Ptr< Socket > socket)
Receive raw data on node B.
Definition:
hello-regression-test.cc:163
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 Tue May 28 2024 23:38:57 for ns-3 by
1.9.6