A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
internet-stack-helper.h
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 "ns3/repository.h"
32 #include "ns3/aodv-module.h"
33 #include "internet-trace-helper.h"
34 
35 namespace ns3 {
36 
37 class Node;
38 class Ipv4RoutingHelper;
39 class Ipv6RoutingHelper;
40 
68 {
69 public:
79  InternetStackHelper(void);
80 
84  virtual ~InternetStackHelper(void);
86  InternetStackHelper &operator = (const InternetStackHelper &o);
87 
91  void Reset (void);
92 
102  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
103 
108  void SetRoutingHelper (const Ipv6RoutingHelper &routing);
109 
117  void Install (std::string nodeName) const;
118 
126  void Install (Ptr<Node> node) const;
127 
136  void InstallCR (Ptr<Repository> repo, Ptr<Node> node) const;
137 
147  void Install (NodeContainer c) const;
148 
159  void InstallCR (Ptr<Repository> repo, NodeContainer c) const;
160 
164  void InstallAll (void) const;
165 
177  void SetTcp (std::string tid);
178 
191  void SetTcp (std::string tid, std::string attr, const AttributeValue &val);
192 
197  void SetIpv4StackInstall (bool enable);
198 
203  void SetIpv6StackInstall (bool enable);
204 
216  int64_t AssignStreams (NodeContainer c, int64_t stream);
217 
218 private:
228  virtual void EnablePcapIpv4Internal (std::string prefix,
229  Ptr<Ipv4> ipv4,
230  uint32_t interface,
231  bool explicitFilename);
232 
245  std::string prefix,
246  Ptr<Ipv4> ipv4,
247  uint32_t interface,
248  bool explicitFilename);
249 
259  virtual void EnablePcapIpv6Internal (std::string prefix,
260  Ptr<Ipv6> ipv6,
261  uint32_t interface,
262  bool explicitFilename);
263 
276  std::string prefix,
277  Ptr<Ipv6> ipv6,
278  uint32_t interface,
279  bool explicitFilename);
280 
281  void Initialize (void);
282  ObjectFactory m_tcpFactory;
283  const Ipv4RoutingHelper *m_routing;
284 
290 
294  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
295 
299  static void Cleanup (void);
300 
304  bool PcapHooked (Ptr<Ipv4> ipv4);
305 
309  bool AsciiHooked (Ptr<Ipv4> ipv4);
310 
314  bool PcapHooked (Ptr<Ipv6> ipv6);
315 
319  bool AsciiHooked (Ptr<Ipv6> ipv6);
320 
325 
330 };
331 
332 } // namespace ns3
333 
334 #endif /* INTERNET_STACK_HELPER_H */
void InstallCR(Ptr< Repository > repo, Ptr< Node > node) const
Base class providing common user-level pcap operations for helpers representing IPv6 protocols ...
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:51
static void Cleanup(void)
aggregate IP/TCP/UDP functionality to existing Nodes.
static void CreateAndAggregateObjectFromTypeId(Ptr< Node > node, const std::string typeId)
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 SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install.
A factory to create ns3::Ipv6RoutingProtocol objects.
bool PcapHooked(Ptr< Ipv4 > ipv4)
bool m_ipv6Enabled
IPv6 install state (enabled/disabled) ?
a factory to create ns3::Ipv4RoutingProtocol objects
keep track of a set of node pointers.
Base class providing common user-level pcap operations for helpers representing IPv4 protocols ...
void SetTcp(std::string tid)
set the Tcp stack which will not need any other parameter.
void Install(std::string nodeName) const
instantiate subclasses of ns3::Object.
const Ipv6RoutingHelper * m_routingv6
IPv6 routing helper.
int64_t AssignStreams(NodeContainer c, int64_t stream)
bool AsciiHooked(Ptr< Ipv4 > ipv4)
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.
Base class providing common user-level ascii trace operations for helpers representing IPv4 protocols...
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.