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 
110 
115 
119  void Reset (void);
120 
130  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
131 
136  void SetRoutingHelper (const Ipv6RoutingHelper &routing);
137 
145  void Install (std::string nodeName) const;
146 
154  void Install (Ptr<Node> node) const;
155 
165  void Install (NodeContainer c) const;
166 
170  void InstallAll (void) const;
171 
183  void SetTcp (std::string tid);
184 
197  void SetTcp (std::string tid, std::string attr, const AttributeValue &val);
198 
203  void SetIpv4StackInstall (bool enable);
204 
209  void SetIpv6StackInstall (bool enable);
210 
215  void SetIpv4ArpJitter (bool enable);
216 
221  void SetIpv6NsRsJitter (bool enable);
222 
234  int64_t AssignStreams (NodeContainer c, int64_t stream);
235 
236 private:
245  virtual void EnablePcapIpv4Internal (std::string prefix,
246  Ptr<Ipv4> ipv4,
247  uint32_t interface,
248  bool explicitFilename);
249 
261  std::string prefix,
262  Ptr<Ipv4> ipv4,
263  uint32_t interface,
264  bool explicitFilename);
265 
274  virtual void EnablePcapIpv6Internal (std::string prefix,
275  Ptr<Ipv6> ipv6,
276  uint32_t interface,
277  bool explicitFilename);
278 
290  std::string prefix,
291  Ptr<Ipv6> ipv6,
292  uint32_t interface,
293  bool explicitFilename);
294 
298  void Initialize (void);
299 
304 
309 
314 
320  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
321 
327  bool PcapHooked (Ptr<Ipv4> ipv4);
328 
334  bool AsciiHooked (Ptr<Ipv4> ipv4);
335 
341  bool PcapHooked (Ptr<Ipv6> ipv6);
342 
348  bool AsciiHooked (Ptr<Ipv6> ipv6);
349 
354 
359 
364 
369 };
370 
371 } // namespace ns3
372 
373 #endif /* INTERNET_STACK_HELPER_H */
bool m_ipv4ArpJitterEnabled
IPv4 ARP Jitter state (enabled/disabled) ?
Base class providing common user-level pcap operations for helpers representing IPv6 protocols ...
bool m_ipv6NsRsJitterEnabled
IPv6 IPv6 NS and RS Jitter state (enabled/disabled) ?
virtual void EnablePcapIpv6Internal(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)
Enable pcap output the indicated Ipv6 and interface pair.
Hold a value for an Attribute.
Definition: attribute.h:68
void SetIpv4ArpJitter(bool enable)
Enable/disable IPv4 ARP Jitter.
ObjectFactory m_tcpFactory
TCP objects factory.
aggregate IP/TCP/UDP functionality to existing Nodes.
InternetStackHelper & operator=(const InternetStackHelper &o)
Copy constructor.
static void CreateAndAggregateObjectFromTypeId(Ptr< Node > node, const std::string typeId)
create an object from its TypeId and aggregates it to the node
Base class providing common user-level ascii trace operations for helpers representing IPv6 protocols...
virtual void EnablePcapIpv4Internal(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)
Enable pcap output the indicated Ipv4 and interface pair.
void InstallAll(void) const
Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation.
void SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install.
A factory to create ns3::Ipv6RoutingProtocol objects.
void Reset(void)
Return helper internal state to that of a newly constructed one.
bool PcapHooked(Ptr< Ipv4 > ipv4)
checks if there is an hook to a Pcap wrapper
bool m_ipv6Enabled
IPv6 install state (enabled/disabled) ?
a factory to create ns3::Ipv4RoutingProtocol objects
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Base class providing common user-level pcap operations for helpers representing IPv4 protocols ...
void Initialize(void)
Initialize the helper to its default values.
void SetTcp(std::string tid)
set the Tcp stack which will not need any other parameter.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
virtual ~InternetStackHelper(void)
Destroy the InternetStackHelper.
Instantiate subclasses of ns3::Object.
const Ipv6RoutingHelper * m_routingv6
IPv6 routing helper.
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
bool AsciiHooked(Ptr< Ipv4 > ipv4)
checks if there is an hook to an ascii output stream
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.
InternetStackHelper(void)
Create a new InternetStackHelper which uses a mix of static routing and global routing by default...
const Ipv4RoutingHelper * m_routing
IPv4 routing helper.
Base class providing common user-level ascii trace operations for helpers representing IPv4 protocols...
void SetIpv6NsRsJitter(bool enable)
Enable/disable IPv6 NS and RS Jitter.
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
bool m_ipv4Enabled
IPv4 install state (enabled/disabled) ?
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.
void SetIpv6StackInstall(bool enable)
Enable/disable IPv6 stack install.