From 513db7e28dd972e1bf4b50e6adc985aa718106e0 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Sun, 20 Feb 2011 04:19:43 +0000 Subject: [PATCH] Added additional logging to MOOSE Switch --- code/src/devices/bridge/model/moose-bridge-net-device.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/src/devices/bridge/model/moose-bridge-net-device.cc b/code/src/devices/bridge/model/moose-bridge-net-device.cc index 41417c1..2bf550e 100644 --- a/code/src/devices/bridge/model/moose-bridge-net-device.cc +++ b/code/src/devices/bridge/model/moose-bridge-net-device.cc @@ -175,9 +175,12 @@ MooseAddress MooseBridgeNetDevice::ToMoose(MooseAddress const& addr){ } void MooseBridgeNetDevice::AddRoutes(std::map > routes){ + NS_LOG_FUNCTION_NOARGS (); for(std::map >::iterator it = routes.begin(); it != routes.end(); it ++){ + NS_LOG_LOGIC("Adding Prefix State: (port: " << it->second << ", time: " << Simulator::GetMaximumSimulationTime() << ")"); + PrefixState &state = m_prefixState[it->first]; state.associatedPort = it->second; state.expirationTime = Simulator::GetMaximumSimulationTime(); @@ -197,6 +200,8 @@ void MooseBridgeNetDevice::Learn(MooseAddress const& addr, Ptr state.expirationTime){ + NS_LOG_LOGIC("Updating Learned Prefix State: (port: " << port << ", time: " << now + m_expirationTime << ", address: " << addr << ") - Previous State: (port: " << state.associatedPort << ", time: " << state.expirationTime << ")"); + state.associatedPort = port; // Only update if the expiration is not in the future state.expirationTime = now + m_expirationTime; } @@ -205,6 +210,7 @@ void MooseBridgeNetDevice::Learn(MooseAddress const& addr, Ptr state.expirationTime){ + NS_LOG_LOGIC("Updating Learned Suffix State: (port: " << port << ", time: " << now + m_expirationTime << ", address: " << addr << ") - Previous State: (port: " << state.associatedPort << ", time: " << state.expirationTime << ")"); state.associatedPort = port; state.expirationTime = now + m_expirationTime; } -- 2.34.1