From: Richard Whitehouse Date: Sun, 8 May 2011 16:27:46 +0000 (+0100) Subject: Install RSTP protocol on Ethernet bridges X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=4a80f2531decb65eea978dcc7965c2e9a4dde78a;p=ns-moose.git Install RSTP protocol on Ethernet bridges --- diff --git a/src/devices/bridge/helper/ethernet-bridge-helper.cc b/src/devices/bridge/helper/ethernet-bridge-helper.cc index afce12e..b59ea2b 100644 --- a/src/devices/bridge/helper/ethernet-bridge-helper.cc +++ b/src/devices/bridge/helper/ethernet-bridge-helper.cc @@ -42,6 +42,8 @@ EthernetBridgeHelper::SetDeviceAttribute (std::string n1, const AttributeValue & NetDeviceContainer EthernetBridgeHelper::Install (Ptr node, NetDeviceContainer c, std::map, bool> portsEnabled) { + // Static Routing + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("**** Install bridge device on node " << node->GetId ()); @@ -65,6 +67,8 @@ EthernetBridgeHelper::Install (Ptr node, NetDeviceContainer c, std::map node, NetDeviceContainer c) { + // Static Routing + NS_LOG_FUNCTION_NOARGS (); NS_LOG_LOGIC ("**** Install bridge device on node " << node->GetId ()); @@ -73,6 +77,11 @@ EthernetBridgeHelper::Install (Ptr node, NetDeviceContainer c) devs.Add (dev); node->AddDevice (dev); + ObjectFactory factory; + factory.SetTypeId ("ns3::RstpL3Protocol"); + Ptr protocol = factory.Create(); + node->AggregateObject(protocol); + for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i) { NS_LOG_LOGIC ("**** Add BridgePort "<< *i);