A Discrete-Event Network Simulator
API
internet-stack-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #ifndef INTERNET_STACK_HELPER_H
22 #define INTERNET_STACK_HELPER_H
23 
24 #include "ns3/node-container.h"
25 #include "ns3/net-device-container.h"
26 #include "ns3/packet.h"
27 #include "ns3/ptr.h"
28 #include "ns3/object-factory.h"
29 #include "ns3/ipv4-l3-protocol.h"
30 #include "ns3/ipv6-l3-protocol.h"
31 #include "internet-trace-helper.h"
32 
33 namespace ns3 {
34 
35 class Node;
36 class Ipv4RoutingHelper;
37 class Ipv6RoutingHelper;
38 
88 {
89 public:
99  InternetStackHelper(void);
100 
104  virtual ~InternetStackHelper(void);
105 
111 
118 
122  void Reset (void);
123 
133  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
134 
139  void SetRoutingHelper (const Ipv6RoutingHelper &routing);
140 
148  void Install (std::string nodeName) const;
149 
157  void Install (Ptr<Node> node) const;
158 
168  void Install (NodeContainer c) const;
169 
173  void InstallAll (void) const;
174 
186  void SetTcp (std::string tid);
187 
200  void SetTcp (std::string tid, std::string attr, const AttributeValue &val);
201 
206  void SetIpv4StackInstall (bool enable);
207 
212  void SetIpv6StackInstall (bool enable);
213 
218  void SetIpv4ArpJitter (bool enable);
219 
224  void SetIpv6NsRsJitter (bool enable);
225 
237  int64_t AssignStreams (NodeContainer c, int64_t stream);
238 
239 private:
248  virtual void EnablePcapIpv4Internal (std::string prefix,
249  Ptr<Ipv4> ipv4,
250  uint32_t interface,
251  bool explicitFilename);
252 
264  std::string prefix,
265  Ptr<Ipv4> ipv4,
266  uint32_t interface,
267  bool explicitFilename);
268 
277  virtual void EnablePcapIpv6Internal (std::string prefix,
278  Ptr<Ipv6> ipv6,
279  uint32_t interface,
280  bool explicitFilename);
281 
293  std::string prefix,
294  Ptr<Ipv6> ipv6,
295  uint32_t interface,
296  bool explicitFilename);
297 
301  void Initialize (void);
302 
307 
312 
317 
323  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
324 
330  bool PcapHooked (Ptr<Ipv4> ipv4);
331 
337  bool AsciiHooked (Ptr<Ipv4> ipv4);
338 
344  bool PcapHooked (Ptr<Ipv6> ipv6);
345 
351  bool AsciiHooked (Ptr<Ipv6> ipv6);
352 
357 
362 
367 
372 };
373 
374 } // namespace ns3
375 
376 #endif /* INTERNET_STACK_HELPER_H */
ns3::InternetStackHelper::m_ipv6Enabled
bool m_ipv6Enabled
IPv6 install state (enabled/disabled) ?
Definition: internet-stack-helper.h:361
ns3::InternetStackHelper::InternetStackHelper
InternetStackHelper(void)
Create a new InternetStackHelper which uses a mix of static routing and global routing by default.
Definition: internet-stack-helper.cc:104
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::AttributeValue
Hold a value for an Attribute.
Definition: attribute.h:69
ns3::InternetStackHelper::SetIpv6NsRsJitter
void SetIpv6NsRsJitter(bool enable)
Enable/disable IPv6 NS and RS Jitter.
Definition: internet-stack-helper.cc:204
ns3::InternetStackHelper::EnablePcapIpv6Internal
virtual void EnablePcapIpv6Internal(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)
Enable pcap output the indicated Ipv6 and interface pair.
Definition: internet-stack-helper.cc:514
ns3::InternetStackHelper::Reset
void Reset(void)
Return helper internal state to that of a newly constructed one.
Definition: internet-stack-helper.cc:161
ns3::InternetStackHelper::SetTcp
void SetTcp(std::string tid)
set the Tcp stack which will not need any other parameter.
Definition: internet-stack-helper.cc:255
ns3::InternetStackHelper::InstallAll
void InstallAll(void) const
Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation.
Definition: internet-stack-helper.cc:277
ns3::PcapHelperForIpv6
Base class providing common user-level pcap operations for helpers representing IPv6 protocols .
Definition: internet-trace-helper.h:398
ns3::Ipv4RoutingHelper
a factory to create ns3::Ipv4RoutingProtocol objects
Definition: ipv4-routing-helper.h:46
ns3::Ipv6RoutingHelper
A factory to create ns3::Ipv6RoutingProtocol objects.
Definition: ipv6-routing-helper.h:46
ns3::InternetStackHelper::m_ipv4ArpJitterEnabled
bool m_ipv4ArpJitterEnabled
IPv4 ARP Jitter state (enabled/disabled) ?
Definition: internet-stack-helper.h:366
ns3::InternetStackHelper::~InternetStackHelper
virtual ~InternetStackHelper(void)
Destroy the InternetStackHelper.
Definition: internet-stack-helper.cc:131
ns3::InternetStackHelper::AsciiHooked
bool AsciiHooked(Ptr< Ipv4 > ipv4)
checks if there is an hook to an ascii output stream
Definition: internet-stack-helper.cc:758
ns3::Ptr< Node >
ns3::AsciiTraceHelperForIpv6
Base class providing common user-level ascii trace operations for helpers representing IPv6 protocols...
Definition: internet-trace-helper.h:490
ns3::InternetStackHelper::EnablePcapIpv4Internal
virtual void EnablePcapIpv4Internal(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)
Enable pcap output the indicated Ipv4 and interface pair.
Definition: internet-stack-helper.cc:416
ns3::InternetStackHelper::Install
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Definition: internet-stack-helper.cc:366
ns3::InternetStackHelper::m_routingv6
const Ipv6RoutingHelper * m_routingv6
IPv6 routing helper.
Definition: internet-stack-helper.h:316
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition: object-factory.h:48
ns3::InternetStackHelper::SetIpv6StackInstall
void SetIpv6StackInstall(bool enable)
Enable/disable IPv6 stack install.
Definition: internet-stack-helper.cc:194
ns3::InternetStackHelper::m_ipv6NsRsJitterEnabled
bool m_ipv6NsRsJitterEnabled
IPv6 IPv6 NS and RS Jitter state (enabled/disabled) ?
Definition: internet-stack-helper.h:371
internet-trace-helper.h
ns3::InternetStackHelper::Initialize
void Initialize(void)
Initialize the helper to its default values.
Definition: internet-stack-helper.cc:118
ns3::InternetStackHelper::AssignStreams
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: internet-stack-helper.cc:210
ns3::InternetStackHelper::SetIpv4ArpJitter
void SetIpv4ArpJitter(bool enable)
Enable/disable IPv4 ARP Jitter.
Definition: internet-stack-helper.cc:199
ns3::InternetStackHelper::PcapHooked
bool PcapHooked(Ptr< Ipv4 > ipv4)
checks if there is an hook to a Pcap wrapper
Definition: internet-stack-helper.cc:401
ns3::InternetStackHelper::SetRoutingHelper
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
Definition: internet-stack-helper.cc:175
ns3::InternetStackHelper::operator=
InternetStackHelper & operator=(const InternetStackHelper &o)
Copy constructor.
Definition: internet-stack-helper.cc:149
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
ns3::InternetStackHelper::SetIpv4StackInstall
void SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install.
Definition: internet-stack-helper.cc:189
ns3::InternetStackHelper::m_routing
const Ipv4RoutingHelper * m_routing
IPv4 routing helper.
Definition: internet-stack-helper.h:311
ns3::AsciiTraceHelperForIpv4
Base class providing common user-level ascii trace operations for helpers representing IPv4 protocols...
Definition: internet-trace-helper.h:131
ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId
static void CreateAndAggregateObjectFromTypeId(Ptr< Node > node, const std::string typeId)
create an object from its TypeId and aggregates it to the node
Definition: internet-stack-helper.cc:283
ns3::PcapHelperForIpv4
Base class providing common user-level pcap operations for helpers representing IPv4 protocols .
Definition: internet-trace-helper.h:38
ns3::InternetStackHelper
aggregate IP/TCP/UDP functionality to existing Nodes.
Definition: internet-stack-helper.h:88
ns3::InternetStackHelper::EnableAsciiIpv6Internal
virtual void EnableAsciiIpv6Internal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)
Enable ascii trace output on the indicated Ipv6 and interface pair.
Definition: internet-stack-helper.cc:1111
ns3::InternetStackHelper::m_ipv4Enabled
bool m_ipv4Enabled
IPv4 install state (enabled/disabled) ?
Definition: internet-stack-helper.h:356
ns3::InternetStackHelper::EnableAsciiIpv4Internal
virtual void EnableAsciiIpv4Internal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)
Enable ascii trace output on the indicated Ipv4 and interface pair.
Definition: internet-stack-helper.cc:773
ns3::InternetStackHelper::m_tcpFactory
ObjectFactory m_tcpFactory
TCP objects factory.
Definition: internet-stack-helper.h:306