bridge coding style changes

This commit is contained in:
Josh Pelkey committed 2011-05-13 14:51:27 -04:00
1 parent 5cde6cee98
commit 0eddfa3aea
4 files changed
+24 -24

No files matched your search

+3 -3
View File
@@ -23,7 +23,7 @@
// | | | The bridge node talks over three CSMA channels
// | | |
// CSMA CSMA CSMA to three other CSMA net devices
// ---- ---- ----
// ---- ---- ----
// n0 n1 n2 Node two acts as a router and talks to another
// ---- bridge that connects the remaining nodes.
// CSMA
@@ -44,9 +44,9 @@
// n0 n1 (n0 = 10.1.1.2)
// | | (n1 = 10.1.1.3) Note odd addressing
// ----------- (n2 = 10.1.1.1)
// | bridge1 | <- n5
// | bridge1 | <- n5
// -----------
// |
// |
// router <- n2
// |
// -----------
+2 -2
View File
@@ -16,13 +16,13 @@
// Network topology
//
// n0 n1
// n0 n1
// | |
// ----------
// | Switch |
// ----------
// | |
// n2 n3
// n2 n3
//
//
// - CBR/UDP flows from n0 to n1 and from n3 to n0
+1 -1
View File
@@ -31,7 +31,7 @@ BridgeChannel::GetTypeId (void)
static TypeId tid = TypeId ("ns3::BridgeChannel")
.SetParent<Channel> ()
.AddConstructor<BridgeChannel> ()
;
;
return tid;
}
+18 -18
View File
@@ -41,7 +41,7 @@ BridgeNetDevice::GetTypeId (void)
UintegerValue (1500),
MakeUintegerAccessor (&BridgeNetDevice::SetMtu,
&BridgeNetDevice::GetMtu),
MakeUintegerChecker<uint16_t> ())
MakeUintegerChecker<uint16_t> ())
.AddAttribute ("EnableLearning",
"Enable the learning mode of the Learning Bridge",
BooleanValue (true),
@@ -52,7 +52,7 @@ BridgeNetDevice::GetTypeId (void)
TimeValue (Seconds (30)),
MakeTimeAccessor (&BridgeNetDevice::m_expirationTime),
MakeTimeChecker ())
;
;
return tid;
}
@@ -70,7 +70,7 @@ BridgeNetDevice::~BridgeNetDevice()
NS_LOG_FUNCTION_NOARGS ();
}
void
void
BridgeNetDevice::DoDispose ()
{
NS_LOG_FUNCTION_NOARGS ();
@@ -133,8 +133,8 @@ BridgeNetDevice::ForwardUnicast (Ptr<NetDevice> incomingPort, Ptr<const Packet>
{
NS_LOG_FUNCTION_NOARGS ();
NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetInstanceTypeId ().GetName ()
<< ", packet=" << packet << ", protocol="<<protocol
<< ", src=" << src << ", dst=" << dst << ")");
<< ", packet=" << packet << ", protocol="<<protocol
<< ", src=" << src << ", dst=" << dst << ")");
Learn (src, incomingPort);
Ptr<NetDevice> outPort = GetLearnedState (dst);
@@ -153,9 +153,9 @@ BridgeNetDevice::ForwardUnicast (Ptr<NetDevice> incomingPort, Ptr<const Packet>
if (port != incomingPort)
{
NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): "
<< incomingPort->GetInstanceTypeId ().GetName ()
<< " --> " << port->GetInstanceTypeId ().GetName ()
<< " (UID " << packet->GetUid () << ").");
<< incomingPort->GetInstanceTypeId ().GetName ()
<< " --> " << port->GetInstanceTypeId ().GetName ()
<< " (UID " << packet->GetUid () << ").");
port->SendFrom (packet->Copy (), src, dst, protocol);
}
}
@@ -164,24 +164,24 @@ BridgeNetDevice::ForwardUnicast (Ptr<NetDevice> incomingPort, Ptr<const Packet>
void
BridgeNetDevice::ForwardBroadcast (Ptr<NetDevice> incomingPort, Ptr<const Packet> packet,
uint16_t protocol, Mac48Address src, Mac48Address dst)
uint16_t protocol, Mac48Address src, Mac48Address dst)
{
NS_LOG_FUNCTION_NOARGS ();
NS_LOG_DEBUG ("LearningBridgeForward (incomingPort=" << incomingPort->GetInstanceTypeId ().GetName ()
<< ", packet=" << packet << ", protocol="<<protocol
<< ", src=" << src << ", dst=" << dst << ")");
<< ", packet=" << packet << ", protocol="<<protocol
<< ", src=" << src << ", dst=" << dst << ")");
Learn (src, incomingPort);
for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
iter != m_ports.end (); iter++)
iter != m_ports.end (); iter++)
{
Ptr<NetDevice> port = *iter;
if (port != incomingPort)
{
NS_LOG_LOGIC ("LearningBridgeForward (" << src << " => " << dst << "): "
<< incomingPort->GetInstanceTypeId ().GetName ()
<< " --> " << port->GetInstanceTypeId ().GetName ()
<< " (UID " << packet->GetUid () << ").");
<< incomingPort->GetInstanceTypeId ().GetName ()
<< " --> " << port->GetInstanceTypeId ().GetName ()
<< " (UID " << packet->GetUid () << ").");
port->SendFrom (packet->Copy (), src, dst, protocol);
}
}
@@ -351,9 +351,9 @@ BridgeNetDevice::IsMulticast (void) const
Address
BridgeNetDevice::GetMulticast (Ipv4Address multicastGroup) const
{
NS_LOG_FUNCTION (this << multicastGroup);
Mac48Address multicast = Mac48Address::GetMulticast (multicastGroup);
return multicast;
NS_LOG_FUNCTION (this << multicastGroup);
Mac48Address multicast = Mac48Address::GetMulticast (multicastGroup);
return multicast;
}