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 */
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 */
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 */
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.