A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
internet-stack-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19
20#ifndef INTERNET_STACK_HELPER_H
21#define INTERNET_STACK_HELPER_H
22
24
25#include "ns3/ipv4-l3-protocol.h"
26#include "ns3/ipv6-l3-protocol.h"
27#include "ns3/net-device-container.h"
28#include "ns3/node-container.h"
29#include "ns3/object-factory.h"
30#include "ns3/packet.h"
31#include "ns3/ptr.h"
32
33namespace ns3
34{
35
36class Node;
37class Ipv4RoutingHelper;
38class Ipv6RoutingHelper;
39
89 public PcapHelperForIpv6,
92{
93 public:
104
108 ~InternetStackHelper() override;
109
115
122
126 void Reset();
127
137 void SetRoutingHelper(const Ipv4RoutingHelper& routing);
138
143 void SetRoutingHelper(const Ipv6RoutingHelper& routing);
144
152 void Install(std::string nodeName) const;
153
161 void Install(Ptr<Node> node) const;
162
172 void Install(NodeContainer c) const;
173
177 void InstallAll() const;
178
190 void SetTcp(std::string tid);
191
196 void SetIpv4StackInstall(bool enable);
197
202 void SetIpv6StackInstall(bool enable);
203
208 void SetIpv4ArpJitter(bool enable);
209
214 void SetIpv6NsRsJitter(bool enable);
215
227 int64_t AssignStreams(NodeContainer c, int64_t stream);
228
229 private:
238 void EnablePcapIpv4Internal(std::string prefix,
239 Ptr<Ipv4> ipv4,
240 uint32_t interface,
241 bool explicitFilename) override;
242
254 std::string prefix,
255 Ptr<Ipv4> ipv4,
256 uint32_t interface,
257 bool explicitFilename) override;
258
267 void EnablePcapIpv6Internal(std::string prefix,
268 Ptr<Ipv6> ipv6,
269 uint32_t interface,
270 bool explicitFilename) override;
271
283 std::string prefix,
284 Ptr<Ipv6> ipv6,
285 uint32_t interface,
286 bool explicitFilename) override;
287
291 void Initialize();
292
297
302
307
313 static void CreateAndAggregateObjectFromTypeId(Ptr<Node> node, const std::string typeId);
314
320 bool PcapHooked(Ptr<Ipv4> ipv4);
321
327 bool AsciiHooked(Ptr<Ipv4> ipv4);
328
334 bool PcapHooked(Ptr<Ipv6> ipv6);
335
341 bool AsciiHooked(Ptr<Ipv6> ipv6);
342
347
352
357
362};
363
364} // namespace ns3
365
366#endif /* INTERNET_STACK_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing IPv4 protocols...
Base class providing common user-level ascii trace operations for helpers representing IPv6 protocols...
aggregate IP/TCP/UDP functionality to existing Nodes.
void EnablePcapIpv6Internal(std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename) override
Enable pcap output the indicated Ipv6 and interface pair.
void SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
void SetIpv4ArpJitter(bool enable)
Enable/disable IPv4 ARP Jitter.
void EnableAsciiIpv4Internal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename) override
Enable ascii trace output on the indicated Ipv4 and interface pair.
bool m_ipv6Enabled
IPv6 install state (enabled/disabled) ?
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
bool m_ipv6NsRsJitterEnabled
IPv6 IPv6 NS and RS Jitter state (enabled/disabled) ?
bool AsciiHooked(Ptr< Ipv4 > ipv4)
checks if there is an hook to an ascii output stream
bool m_ipv4Enabled
IPv4 install state (enabled/disabled) ?
const Ipv4RoutingHelper * m_routing
IPv4 routing helper.
void InstallAll() const
Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation.
void SetIpv6StackInstall(bool enable)
Enable/disable IPv6 stack install.
int64_t AssignStreams(NodeContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static void CreateAndAggregateObjectFromTypeId(Ptr< Node > node, const std::string typeId)
create an object from its TypeId and aggregates it to the node
void Initialize()
Initialize the helper to its default values.
ObjectFactory m_tcpFactory
TCP objects factory.
void SetIpv6NsRsJitter(bool enable)
Enable/disable IPv6 NS and RS Jitter.
bool PcapHooked(Ptr< Ipv4 > ipv4)
checks if there is an hook to a Pcap wrapper
void EnablePcapIpv4Internal(std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename) override
Enable pcap output the indicated Ipv4 and interface pair.
bool m_ipv4ArpJitterEnabled
IPv4 ARP Jitter state (enabled/disabled) ?
const Ipv6RoutingHelper * m_routingv6
IPv6 routing helper.
InternetStackHelper & operator=(const InternetStackHelper &o)
Copy constructor.
InternetStackHelper()
Create a new InternetStackHelper which uses a mix of static routing and global routing by default.
void SetTcp(std::string tid)
set the Tcp stack which will not need any other parameter.
void Reset()
Return helper internal state to that of a newly constructed one.
~InternetStackHelper() override
Destroy the InternetStackHelper.
void EnableAsciiIpv6Internal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename) override
Enable ascii trace output on the indicated Ipv6 and interface pair.
a factory to create ns3::Ipv4RoutingProtocol objects
A factory to create ns3::Ipv6RoutingProtocol objects.
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Base class providing common user-level pcap operations for helpers representing IPv4 protocols .
Base class providing common user-level pcap operations for helpers representing IPv6 protocols .
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Every class exported by the ns3 library is enclosed in the ns3 namespace.