A Discrete-Event Network Simulator
API
sensornode-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 
3 /*
4 * Copyright (c) 2020 DLTLT
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Corresponding author: Niki Hrovatin <niki.hrovatin@famnit.upr.si>
20 */
21 
22 #ifndef SENSORNODE_HELPER_H
23 #define SENSORNODE_HELPER_H
24 
25 #include "ns3/sensornode.h"
26 #include "ns3/log.h"
27 #include "ns3/config.h"
28 #include "ns3/trace-helper.h"
29 #include "ns3/inet-socket-address.h"
30 #include "ns3/packet-socket-address.h"
31 #include "ns3/string.h"
32 #include "ns3/names.h"
33 #include <stdint.h>
34 #include <string>
35 #include "ns3/uinteger.h"
36 #include "ns3/object-factory.h"
37 #include "ns3/address.h"
38 #include "ns3/attribute.h"
39 #include "ns3/attribute-helper.h"
40 #include "ns3/net-device.h"
41 #include "ns3/node-container.h"
42 #include "ns3/application-container.h"
43 #include "ns3/application.h"
44 #include "ns3/outputmanager.h"
45 #include "ns3/onionvalidator.h"
46 
47 namespace ns3 {
48 
56 class SensorNodeHelper : public Object
57 {
58 public:
63  static TypeId GetTypeId (void);
70 
76  SensorNodeHelper (Ipv4Address address, Ptr<OutputManager> outputManager,
77  Ptr<OnionValidator> onionValidator);
78 
85 
92  void SetAttribute (std::string name, const AttributeValue &value);
93 
94  /*
95  * Install an ns3::SensorNode application on the node configured with all the attributes set with SetAttribute.
96  * \param NodeContainer
97  * \returns ApplicationContainer
98  *
99  */
100  ApplicationContainer Install (NodeContainer c) const;
101 
102  /*
103  *Install an ns3::Sink application on the node configured with all the attributes set with SetAttribute.
104  * \param node, the node on which an SensorNode will be installed
105  * \returns Ptr to the installed application
106  */
107 
108  Ptr<Application> InstallPriv (Ptr<Node> node) const;
109 
110 private:
111  Ipv4Address m_sinkAddress;
112  Ptr<OutputManager> m_outputManager;
113  Ptr<OnionValidator> m_onionValidator;
114  uint16_t
116  ObjectFactory m_factory;
117 };
118 
119 } // namespace ns3
120 
121 #endif /* SENSORNODE_HELPER_H */
ns3::SensorNodeHelper::SensorNodeHelper
SensorNodeHelper()
Default constructor.
Definition: sensornode-helper.cc:39
ns3
Definition: sensornode-helper.cc:26
ns3::SensorNodeHelper
Helper class for the creation of SensorNode applications.
Definition: sensornode-helper.h:56
ns3::SensorNodeHelper::m_onionTimeout
uint16_t m_onionTimeout
A watchdog timer set to abort onion messagess, if the timer elepses before the onion returns back to ...
Definition: sensornode-helper.h:115
ns3::SensorNodeHelper::m_onionValidator
Ptr< OnionValidator > m_onionValidator
Manage onions and when to abort them.
Definition: sensornode-helper.h:113
ns3::SensorNodeHelper::Install
ApplicationContainer Install(NodeContainer c) const
Definition: sensornode-helper.cc:65
ns3::SensorNodeHelper::m_outputManager
Ptr< OutputManager > m_outputManager
Manage the output of the simulation.
Definition: sensornode-helper.h:112
ns3::SensorNodeHelper::~SensorNodeHelper
~SensorNodeHelper()
Default constructor.
Definition: sensornode-helper.cc:54
ns3::SensorNodeHelper::InstallPriv
Ptr< Application > InstallPriv(Ptr< Node > node) const
Definition: sensornode-helper.cc:77
ns3::SensorNodeHelper::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition: sensornode-helper.cc:32
ns3::SensorNodeHelper::m_sinkAddress
Ipv4Address m_sinkAddress
Ipv4 address of the sink node.
Definition: sensornode-helper.h:111
ns3::SensorNodeHelper::m_factory
ObjectFactory m_factory
factory object
Definition: sensornode-helper.h:116
ns3::SensorNodeHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &value)
Setter of individual attributes.
Definition: sensornode-helper.cc:59