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
flent-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
* Copyright (c) 2022 NITK Surathkal
4
*
5
* SPDX-License-Identifier: GPL-2.0-only
6
*
7
* This file is adapted from bulk-send-helper.h.
8
*
9
* Author: Ameya Deshpande <ameyanrd@outlook.com>
10
*/
11
12
#ifndef FLENT_HELPER_H
13
#define FLENT_HELPER_H
14
15
#include "ns3/application-container.h"
16
#include "ns3/attribute.h"
17
#include "ns3/nstime.h"
18
#include "ns3/object-factory.h"
19
20
#include <string>
21
22
namespace
ns3
23
{
24
25
/**
26
* @ingroup flent
27
* @brief A helper to make it easier to instantiate an ns3::FlentApplication
28
*/
29
class
FlentHelper
30
{
31
public
:
32
/**
33
* Create an FlentHelper to make it easier to work with FlentApplication
34
*
35
* @param [in] testname the name of the test to run on FlentApplication
36
* The supported tests are ping, tcp_upload, tcp_download and rrul.
37
* @param [in] address the address of the remote host to send traffic to.
38
*/
39
FlentHelper
(std::string testname,
Address
address);
40
41
/**
42
* Helper function used to set the underlying application attributes.
43
*
44
* @param name the name of the application attribute to set
45
* @param value the value of the application attribute to set
46
*/
47
void
SetAttribute
(std::string name,
const
AttributeValue
& value);
48
49
/**
50
* @brief Set the test start time
51
* @param start Test start time
52
*/
53
void
SetTestStartTime
(
Time
start);
54
55
/**
56
* @brief Set the length of the Flent test
57
* @param length Test length
58
*/
59
void
SetTestLength
(
Time
length);
60
61
/**
62
* @brief Get the overall stop time of the simulation
63
* @returns Stop time (start + length + 10s cooldown)
64
*/
65
Time
GetStopTime
()
const
;
66
67
/**
68
* Install an ns3::FlentApplication on the node configured with all the
69
* attributes set with SetAttribute.
70
*
71
* @param node The node on which an FlentApplication will be installed.
72
* @returns Container of Ptr to the applications installed.
73
*/
74
ApplicationContainer
Install
(
Ptr<Node>
node)
const
;
75
76
/**
77
* Install an ns3::FlentApplication on the node configured with all the
78
* attributes set with SetAttribute.
79
*
80
* @param nodeName The node on which an FlentApplication will be installed.
81
* @returns Container of Ptr to the applications installed.
82
*/
83
ApplicationContainer
Install
(std::string nodeName)
const
;
84
85
private
:
86
/**
87
* Install an ns3::FlentApplication on the node configured with all the
88
* attributes set with SetAttribute.
89
*
90
* @param node The node on which an FlentApplication will be installed.
91
* @returns Ptr to the application installed.
92
*/
93
Ptr<Application>
InstallPriv
(
Ptr<Node>
node)
const
;
94
95
ObjectFactory
m_factory
;
//!< Object factory.
96
Time
m_startTime
{0};
//!< The start time of the Flent test
97
Time
m_length
{
Seconds
(60)};
//!< The duration of the Flent test
98
};
99
100
}
// namespace ns3
101
102
#endif
/* FLENT_HELPER_H */
ns3::Address
a polymophic address class
Definition
address.h:114
ns3::ApplicationContainer
holds a vector of ns3::Application pointers.
Definition
application-container.h:33
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::FlentHelper::InstallPriv
Ptr< Application > InstallPriv(Ptr< Node > node) const
Install an ns3::FlentApplication on the node configured with all the attributes set with SetAttribute...
Definition
flent-helper.cc:69
ns3::FlentHelper::SetTestLength
void SetTestLength(Time length)
Set the length of the Flent test.
Definition
flent-helper.cc:42
ns3::FlentHelper::m_length
Time m_length
The duration of the Flent test.
Definition
flent-helper.h:97
ns3::FlentHelper::m_startTime
Time m_startTime
The start time of the Flent test.
Definition
flent-helper.h:96
ns3::FlentHelper::SetTestStartTime
void SetTestStartTime(Time start)
Set the test start time.
Definition
flent-helper.cc:34
ns3::FlentHelper::FlentHelper
FlentHelper(std::string testname, Address address)
Create an FlentHelper to make it easier to work with FlentApplication.
Definition
flent-helper.cc:20
ns3::FlentHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
Definition
flent-helper.cc:28
ns3::FlentHelper::GetStopTime
Time GetStopTime() const
Get the overall stop time of the simulation.
Definition
flent-helper.cc:50
ns3::FlentHelper::m_factory
ObjectFactory m_factory
Object factory.
Definition
flent-helper.h:95
ns3::FlentHelper::Install
ApplicationContainer Install(Ptr< Node > node) const
Install an ns3::FlentApplication on the node configured with all the attributes set with SetAttribute...
Definition
flent-helper.cc:56
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:95
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition
nstime.h:1313
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
applications
helper
flent-helper.h
Generated on
for ns-3 by
1.16.1