A Discrete-Event Network Simulator
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
16namespace ns3
17{
18
19class Node;
20class 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 */
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 */
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()")
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 */
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 */
Hold a value for an Attribute.
Definition attribute.h:59
Ipv4 addresses are stored in host order in this class.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
build TapBridge to allow ns-3 simulations to interact with Linux tap devices and processes on the Lin...
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...
TapBridgeHelper()
Construct a TapBridgeHelper to make life easier for people wanting to have their simulations interact...
void SetAttribute(std::string n1, const AttributeValue &v1)
Set an attribute in the underlying TapBridge net device when these devices are automatically created.
ObjectFactory m_deviceFactory
Object factory.
#define NS_DEPRECATED_3_44(msg)
Tag for things deprecated in version ns-3.44.
Definition deprecated.h:91
Every class exported by the ns3 library is enclosed in the ns3 namespace.