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
* SPDX-License-Identifier: GPL-2.0-only
5
*/
6
7
#ifndef TAP_BRIDGE_HELPER_H
8
#define TAP_BRIDGE_HELPER_H
9
10
#include "ns3/net-device-container.h"
11
#include "ns3/object-factory.h"
12
#include "ns3/tap-bridge.h"
13
14
#include <string>
15
16
namespace
ns3
17
{
18
19
class
Node;
20
class
AttributeValue;
21
22
/**
23
* \brief build TapBridge to allow ns-3 simulations to interact with Linux
24
* tap devices and processes on the Linux host.
25
*/
26
class
TapBridgeHelper
27
{
28
public
:
29
/**
30
* Construct a TapBridgeHelper to make life easier for people wanting to
31
* have their simulations interact with Linux tap devices and processes
32
* on the Linux host.
33
*/
34
TapBridgeHelper
();
35
36
/**
37
* Construct a TapBridgeHelper to make life easier for people wanting to
38
* have their simulations interact with Linux tap devices and processes
39
* on the Linux host.
40
*
41
* \param gateway An Ipv4Address to be used as the default gateway for
42
* the created bridges,
43
*/
44
TapBridgeHelper
(
Ipv4Address
gateway);
45
46
/**
47
* Set an attribute in the underlying TapBridge net device when these
48
* devices are automatically created.
49
*
50
* \param n1 the name of the attribute to set
51
* \param v1 the value of the attribute to set
52
*/
53
void
SetAttribute
(std::string n1,
const
AttributeValue
& v1);
54
55
/**
56
* This method installs a TapBridge on the specified Node and forms the
57
* bridge with the NetDevice specified. The Node is specified using
58
* a Ptr<Node> and the NetDevice is specified using a Ptr<NetDevice>
59
*
60
* \param node The Ptr<Node> to install the TapBridge in
61
* \param nd The Ptr<NetDevice> to attach to the bridge.
62
* \returns A pointer to the new TapBridge NetDevice.
63
*/
64
Ptr<NetDevice>
Install
(
Ptr<Node>
node,
Ptr<NetDevice>
nd);
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 by a
69
* name string that has previously been associated with the Node using
70
* the Object Name Service. The NetDevice is specified by a Ptr<NetDevice>.
71
*
72
* \param nodeName The name of the Node to install the TapBridge in
73
* \param nd The Ptr<NetDevice> to attach to the bridge.
74
* \returns A pointer to the new TapBridge NetDevice.
75
*/
76
Ptr<NetDevice>
Install
(std::string nodeName,
Ptr<NetDevice>
nd);
77
78
/**
79
* This method installs a TapBridge on the specified Node and forms the
80
* bridge with the NetDevice specified. The NetDevice is specified by a
81
* name string that has previously been associated with the NetDevice
82
* using the Object Name Service.
83
*
84
* \param node The Ptr<Node> to install the TapBridge in
85
* \param ndName The name of the NetDevice to attach to the bridge.
86
* \returns A pointer to the new TapBridge NetDevice.
87
*/
88
Ptr<NetDevice>
Install
(
Ptr<Node>
node, std::string ndName);
89
90
/**
91
* This method installs a TapBridge on the specified Node and forms the
92
* bridge with the NetDevice specified. The node is specified by a
93
* name string that has previously been associated with the Node using
94
* the Object Name Service. The NetDevice is specified by a name
95
* string that has previously been associated with the Object Name
96
* Service.
97
*
98
* \param nodeName The name of the Node to install the TapBridge in
99
* \param ndName The name of the NetDevice to attach to the bridge.
100
* \returns A pointer to the new TapBridge NetDevice.
101
*/
102
Ptr<NetDevice>
Install
(std::string nodeName, std::string ndName);
103
104
/**
105
* This method installs a TapBridge on the specified Node and forms the
106
* bridge with the NetDevice specified. The Node is specified using
107
* a Ptr<Node> and the NetDevice is specified using a Ptr<NetDevice>.
108
* The type of the actual Bridge device is specified with the
109
* provided AttributeValue (typically "ns3::TapBridge").
110
*
111
* \param node The Ptr<Node> to install the TapBridge in
112
* \param nd The Ptr<NetDevice> to attach to the bridge.
113
* \param bridgeType The TypeId of the bridge that will be automatically
114
* created.
115
* \returns A pointer to the new TapBridge NetDevice.
116
*/
117
Ptr<NetDevice>
Install
(
Ptr<Node>
node,
Ptr<NetDevice>
nd,
const
AttributeValue
& bridgeType);
118
119
private
:
120
ObjectFactory
m_deviceFactory
;
//!< Object factory
121
};
122
123
}
// namespace ns3
124
125
#endif
/* TAP_BRIDGE_HELPER_H */
ns3::AttributeValue
Hold a value for an Attribute.
Definition
attribute.h:59
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition
ipv4-address.h:31
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition
object-factory.h:37
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
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:27
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:50
ns3::TapBridgeHelper::TapBridgeHelper
TapBridgeHelper()
Construct a TapBridgeHelper to make life easier for people wanting to have their simulations interact...
Definition
tap-bridge-helper.cc:20
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:35
ns3::TapBridgeHelper::m_deviceFactory
ObjectFactory m_deviceFactory
Object factory.
Definition
tap-bridge-helper.h:120
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
tap-bridge
helper
tap-bridge-helper.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0