A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
tap-bridge-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 University of Washington
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
18
#ifndef TAP_BRIDGE_HELPER_H
19
#define TAP_BRIDGE_HELPER_H
20
21
#include "ns3/net-device-container.h"
22
#include "ns3/object-factory.h"
23
#include "ns3/tap-bridge.h"
24
25
#include <string>
26
27
namespace
ns3
28
{
29
30
class
Node;
31
class
AttributeValue;
32
33
/**
34
* \brief build TapBridge to allow ns-3 simulations to interact with Linux
35
* tap devices and processes on the Linux host.
36
*/
37
class
TapBridgeHelper
38
{
39
public
:
40
/**
41
* Construct a TapBridgeHelper to make life easier for people wanting to
42
* have their simulations interact with Linux tap devices and processes
43
* on the Linux host.
44
*/
45
TapBridgeHelper
();
46
47
/**
48
* Construct a TapBridgeHelper to make life easier for people wanting to
49
* have their simulations interact with Linux tap devices and processes
50
* on the Linux host.
51
*
52
* \param gateway An Ipv4Address to be used as the default gateway for
53
* the created bridges,
54
*/
55
TapBridgeHelper
(
Ipv4Address
gateway);
56
57
/**
58
* Set an attribute in the underlying TapBridge net device when these
59
* devices are automatically created.
60
*
61
* \param n1 the name of the attribute to set
62
* \param v1 the value of the attribute to set
63
*/
64
void
SetAttribute
(std::string n1,
const
AttributeValue
& v1);
65
66
/**
67
* This method installs a TapBridge on the specified Node and forms the
68
* bridge with the NetDevice specified. The Node is specified using
69
* a Ptr<Node> and the NetDevice is specified using a Ptr<NetDevice>
70
*
71
* \param node The Ptr<Node> to install the TapBridge in
72
* \param nd The Ptr<NetDevice> to attach to the bridge.
73
* \returns A pointer to the new TapBridge NetDevice.
74
*/
75
Ptr<NetDevice>
Install
(
Ptr<Node>
node,
Ptr<NetDevice>
nd);
76
77
/**
78
* This method installs a TapBridge on the specified Node and forms the
79
* bridge with the NetDevice specified. The node is specified by a
80
* name string that has previously been associated with the Node using
81
* the Object Name Service. The NetDevice is specified by a Ptr<NetDevice>.
82
*
83
* \param nodeName The name of the Node to install the TapBridge in
84
* \param nd The Ptr<NetDevice> to attach to the bridge.
85
* \returns A pointer to the new TapBridge NetDevice.
86
*/
87
Ptr<NetDevice>
Install
(std::string nodeName,
Ptr<NetDevice>
nd);
88
89
/**
90
* This method installs a TapBridge on the specified Node and forms the
91
* bridge with the NetDevice specified. The NetDevice is specified by a
92
* name string that has previously been associated with the NetDevice
93
* using the Object Name Service.
94
*
95
* \param node The Ptr<Node> to install the TapBridge in
96
* \param ndName The name of the NetDevice to attach to the bridge.
97
* \returns A pointer to the new TapBridge NetDevice.
98
*/
99
Ptr<NetDevice>
Install
(
Ptr<Node>
node, std::string ndName);
100
101
/**
102
* This method installs a TapBridge on the specified Node and forms the
103
* bridge with the NetDevice specified. The node is specified by a
104
* name string that has previously been associated with the Node using
105
* the Object Name Service. The NetDevice is specified by a name
106
* string that has previously been associated with the Object Name
107
* Service.
108
*
109
* \param nodeName The name of the Node to install the TapBridge in
110
* \param ndName The name of the NetDevice to attach to the bridge.
111
* \returns A pointer to the new TapBridge NetDevice.
112
*/
113
Ptr<NetDevice>
Install
(std::string nodeName, std::string ndName);
114
115
/**
116
* This method installs a TapBridge on the specified Node and forms the
117
* bridge with the NetDevice specified. The Node is specified using
118
* a Ptr<Node> and the NetDevice is specified using a Ptr<NetDevice>.
119
* The type of the actual Bridge device is specified with the
120
* provided AttributeValue (typically "ns3::TapBridge").
121
*
122
* \param node The Ptr<Node> to install the TapBridge in
123
* \param nd The Ptr<NetDevice> to attach to the bridge.
124
* \param bridgeType The TypeId of the bridge that will be automatically
125
* created.
126
* \returns A pointer to the new TapBridge NetDevice.
127
*/
128
Ptr<NetDevice>
Install
(
Ptr<Node>
node,
Ptr<NetDevice>
nd,
const
AttributeValue
& bridgeType);
129
130
private
:
131
ObjectFactory
m_deviceFactory
;
//!< Object factory
132
};
133
134
}
// namespace ns3
135
136
#endif
/* TAP_BRIDGE_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:42
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TapBridgeHelper
build TapBridge to allow ns-3 simulations to interact with Linux tap devices and processes on the Lin...
Definition:
tap-bridge-helper.h:38
ns3::TapBridgeHelper::Install
Ptr< NetDevice > Install(Ptr< Node > node, Ptr< NetDevice > nd)
This method installs a TapBridge on the specified Node and forms the bridge with the NetDevice specif...
Definition:
tap-bridge-helper.cc:61
ns3::TapBridgeHelper::TapBridgeHelper
TapBridgeHelper()
Construct a TapBridgeHelper to make life easier for people wanting to have their simulations interact...
Definition:
tap-bridge-helper.cc:31
ns3::TapBridgeHelper::SetAttribute
void SetAttribute(std::string n1, const AttributeValue &v1)
Set an attribute in the underlying TapBridge net device when these devices are automatically created.
Definition:
tap-bridge-helper.cc:46
ns3::TapBridgeHelper::m_deviceFactory
ObjectFactory m_deviceFactory
Object factory.
Definition:
tap-bridge-helper.h:131
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
tap-bridge
helper
tap-bridge-helper.h
Generated on Tue May 28 2024 23:39:32 for ns-3 by
1.9.6