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
NS_DEPRECATED_3_44
(
"Use TapBridgeHelper()"
)
45
TapBridgeHelper
(
Ipv4Address
gateway);
46
47
/**
48
* Set an attribute in the underlying TapBridge net device when these
49
* devices are automatically created.
50
*
51
* @param n1 the name of the attribute to set
52
* @param v1 the value of the attribute to set
53
*/
54
void
SetAttribute
(std::string n1,
const
AttributeValue
& v1);
55
56
/**
57
* This method installs a TapBridge on the specified Node and forms the
58
* bridge with the NetDevice specified. The Node is specified using
59
* a Ptr<Node> and the NetDevice is specified using a Ptr<NetDevice>
60
*
61
* @param node The Ptr<Node> to install the TapBridge in
62
* @param nd The Ptr<NetDevice> to attach to the bridge.
63
* @returns A pointer to the new TapBridge NetDevice.
64
*/
65
Ptr<NetDevice>
Install
(
Ptr<Node>
node,
Ptr<NetDevice>
nd);
66
67
/**
68
* This method installs a TapBridge on the specified Node and forms the
69
* bridge with the NetDevice specified. The node is specified by a
70
* name string that has previously been associated with the Node using
71
* the Object Name Service. The NetDevice is specified by a Ptr<NetDevice>.
72
*
73
* @param nodeName The name of the Node to install the TapBridge in
74
* @param nd The Ptr<NetDevice> to attach to the bridge.
75
* @returns A pointer to the new TapBridge NetDevice.
76
*/
77
Ptr<NetDevice>
Install
(std::string nodeName,
Ptr<NetDevice>
nd);
78
79
/**
80
* This method installs a TapBridge on the specified Node and forms the
81
* bridge with the NetDevice specified. The NetDevice is specified by a
82
* name string that has previously been associated with the NetDevice
83
* using the Object Name Service.
84
*
85
* @param node The Ptr<Node> to install the TapBridge in
86
* @param ndName The name of the NetDevice to attach to the bridge.
87
* @returns A pointer to the new TapBridge NetDevice.
88
*/
89
Ptr<NetDevice>
Install
(
Ptr<Node>
node, std::string ndName);
90
91
/**
92
* This method installs a TapBridge on the specified Node and forms the
93
* bridge with the NetDevice specified. The node is specified by a
94
* name string that has previously been associated with the Node using
95
* the Object Name Service. The NetDevice is specified by a name
96
* string that has previously been associated with the Object Name
97
* Service.
98
*
99
* @param nodeName The name of the Node to install the TapBridge in
100
* @param ndName The name of the NetDevice to attach to the bridge.
101
* @returns A pointer to the new TapBridge NetDevice.
102
*/
103
Ptr<NetDevice>
Install
(std::string nodeName, std::string ndName);
104
105
/**
106
* This method installs a TapBridge on the specified Node and forms the
107
* bridge with the NetDevice specified. The Node is specified using
108
* a Ptr<Node> and the NetDevice is specified using a Ptr<NetDevice>.
109
* The type of the actual Bridge device is specified with the
110
* provided AttributeValue (typically "ns3::TapBridge").
111
*
112
* @param node The Ptr<Node> to install the TapBridge in
113
* @param nd The Ptr<NetDevice> to attach to the bridge.
114
* @param bridgeType The TypeId of the bridge that will be automatically
115
* created.
116
* @returns A pointer to the new TapBridge NetDevice.
117
*/
118
Ptr<NetDevice>
Install
(
Ptr<Node>
node,
Ptr<NetDevice>
nd,
const
AttributeValue
& bridgeType);
119
120
private
:
121
ObjectFactory
m_deviceFactory
;
//!< Object factory
122
};
123
124
}
// namespace ns3
125
126
#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:49
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:34
ns3::TapBridgeHelper::m_deviceFactory
ObjectFactory m_deviceFactory
Object factory.
Definition
tap-bridge-helper.h:121
NS_DEPRECATED_3_44
#define NS_DEPRECATED_3_44(msg)
Tag for things deprecated in version ns-3.44.
Definition
deprecated.h:91
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 Apr 8 2025 15:27:18 for ns-3 by
1.11.0