A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
66 {
67 public:
77  InternetStackHelper(void);
78 
82  virtual ~InternetStackHelper(void);
85 
89  void Reset (void);
90 
100  void SetRoutingHelper (const Ipv4RoutingHelper &routing);
101 
106  void SetRoutingHelper (const Ipv6RoutingHelper &routing);
107 
115  void Install (std::string nodeName) const;
116 
124  void Install (Ptr<Node> node) const;
125 
135  void Install (NodeContainer c) const;
136 
140  void InstallAll (void) const;
141 
153  void SetTcp (std::string tid);
154 
167  void SetTcp (std::string tid, std::string attr, const AttributeValue &val);
168 
173  void SetIpv4StackInstall (bool enable);
174 
179  void SetIpv6StackInstall (bool enable);
180 
192  int64_t AssignStreams (NodeContainer c, int64_t stream);
193 
194 private:
204  virtual void EnablePcapIpv4Internal (std::string prefix,
205  Ptr<Ipv4> ipv4,
206  uint32_t interface,
207  bool explicitFilename);
208 
221  std::string prefix,
222  Ptr<Ipv4> ipv4,
223  uint32_t interface,
224  bool explicitFilename);
225 
235  virtual void EnablePcapIpv6Internal (std::string prefix,
236  Ptr<Ipv6> ipv6,
237  uint32_t interface,
238  bool explicitFilename);
239 
252  std::string prefix,
253  Ptr<Ipv6> ipv6,
254  uint32_t interface,
255  bool explicitFilename);
256 
257  void Initialize (void);
260 
266 
270  static void CreateAndAggregateObjectFromTypeId (Ptr<Node> node, const std::string typeId);
271 
275  static void Cleanup (void);
276 
280  bool PcapHooked (Ptr<Ipv4> ipv4);
281 
285  bool AsciiHooked (Ptr<Ipv4> ipv4);
286 
290  bool PcapHooked (Ptr<Ipv6> ipv6);
291 
295  bool AsciiHooked (Ptr<Ipv6> ipv6);
296 
301 
306 };
307 
308 } // namespace ns3
309 
310 #endif /* INTERNET_STACK_HELPER_H */