--- a/src/helper/tap-bridge-helper.cc Fri Feb 13 00:10:21 2009 -0500
+++ b/src/helper/tap-bridge-helper.cc Fri Feb 13 12:44:22 2009 -0800
@@ -19,6 +19,7 @@
#include "ns3/log.h"
#include "ns3/node.h"
#include "ns3/tap-bridge.h"
+#include "ns3/names.h"
#include "tap-bridge-helper.h"
NS_LOG_COMPONENT_DEFINE ("TapBridgeHelper");
@@ -39,6 +40,7 @@
m_deviceFactory.Set (n1, v1);
}
+
Ptr<NetDevice>
TapBridgeHelper::Install (Ptr<Node> node, Ptr<NetDevice> nd)
{
@@ -52,4 +54,26 @@
return bridge;
}
+Ptr<NetDevice>
+TapBridgeHelper::Install (std::string nodeName, Ptr<NetDevice> nd)
+{
+ Ptr<Node> node = Names::Find<Node> (nodeName);
+ return Install (node, nd);
+}
+
+Ptr<NetDevice>
+TapBridgeHelper::Install (Ptr<Node> node, std::string ndName)
+{
+ Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
+ return Install (node, nd);
+}
+
+Ptr<NetDevice>
+TapBridgeHelper::Install (std::string nodeName, std::string ndName)
+{
+ Ptr<Node> node = Names::Find<Node> (nodeName);
+ Ptr<NetDevice> nd = Names::Find<NetDevice> (ndName);
+ return Install (node, nd);
+}
+
} // namespace ns3
--- a/src/helper/tap-bridge-helper.h Fri Feb 13 00:10:21 2009 -0500
+++ b/src/helper/tap-bridge-helper.h Fri Feb 13 12:44:22 2009 -0800
@@ -34,6 +34,9 @@
TapBridgeHelper (Ipv4Address gateway);
void SetAttribute (std::string n1, const AttributeValue &v1);
Ptr<NetDevice> Install (Ptr<Node> node, Ptr<NetDevice> nd);
+ Ptr<NetDevice> Install (std::string nodeName, Ptr<NetDevice> nd);
+ Ptr<NetDevice> Install (Ptr<Node> node, std::string ndName);
+ Ptr<NetDevice> Install (std::string nodeName, std::string ndName);
private:
ObjectFactory m_deviceFactory;
};