A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
64
class
InternetStackHelper
:
public
PcapHelperForIpv4
,
public
PcapHelperForIpv6
,
65
public
AsciiTraceHelperForIpv4
,
public
AsciiTraceHelperForIpv6
66
{
67
public
:
77
InternetStackHelper
(
void
);
78
82
virtual
~InternetStackHelper
(
void
);
83
InternetStackHelper
(
const
InternetStackHelper
&);
84
InternetStackHelper
&
operator =
(
const
InternetStackHelper
&o);
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
185
void
SetIpv4ArpJitter
(
bool
enable);
186
191
void
SetIpv6NsRsJitter
(
bool
enable);
192
204
int64_t
AssignStreams
(
NodeContainer
c, int64_t stream);
205
206
private
:
216
virtual
void
EnablePcapIpv4Internal
(std::string prefix,
217
Ptr<Ipv4>
ipv4,
218
uint32_t interface,
219
bool
explicitFilename);
220
232
virtual
void
EnableAsciiIpv4Internal
(
Ptr<OutputStreamWrapper>
stream,
233
std::string prefix,
234
Ptr<Ipv4>
ipv4,
235
uint32_t interface,
236
bool
explicitFilename);
237
247
virtual
void
EnablePcapIpv6Internal
(std::string prefix,
248
Ptr<Ipv6>
ipv6,
249
uint32_t interface,
250
bool
explicitFilename);
251
263
virtual
void
EnableAsciiIpv6Internal
(
Ptr<OutputStreamWrapper>
stream,
264
std::string prefix,
265
Ptr<Ipv6>
ipv6,
266
uint32_t interface,
267
bool
explicitFilename);
268
269
void
Initialize
(
void
);
270
ObjectFactory
m_tcpFactory
;
271
const
Ipv4RoutingHelper
*
m_routing
;
272
277
const
Ipv6RoutingHelper
*
m_routingv6
;
278
282
static
void
CreateAndAggregateObjectFromTypeId
(
Ptr<Node>
node,
const
std::string typeId);
283
287
static
void
Cleanup
(
void
);
288
292
bool
PcapHooked
(
Ptr<Ipv4>
ipv4);
293
297
bool
AsciiHooked
(
Ptr<Ipv4>
ipv4);
298
302
bool
PcapHooked
(
Ptr<Ipv6>
ipv6);
303
307
bool
AsciiHooked
(
Ptr<Ipv6>
ipv6);
308
312
bool
m_ipv4Enabled
;
313
317
bool
m_ipv6Enabled
;
318
322
bool
m_ipv4ArpJitterEnabled
;
323
327
bool
m_ipv6NsRsJitterEnabled
;
328
};
329
330
}
// namespace ns3
331
332
#endif
/* INTERNET_STACK_HELPER_H */
src
internet
helper
internet-stack-helper.h
Generated on Fri Aug 30 2013 01:42:50 for ns-3 by
1.8.1.2