# HG changeset patch # User Mathieu Lacage # Date 1231763741 -3600 # Node ID 210d64d11998709b4173589bb144e12ba31d391e # Parent d2e461e575f47e9322660ae319d42d03a04fd7d4 add wifi multicast support. Based on patch by Mauchle Fabian. diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/dca-txop.cc --- a/src/devices/wifi/dca-txop.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/dca-txop.cc Mon Jan 12 13:35:41 2009 +0100 @@ -388,7 +388,7 @@ } MacLowTransmissionParameters params; params.DisableOverrideDurationId (); - if (m_currentHdr.GetAddr1 ().IsBroadcast ()) + if (m_currentHdr.GetAddr1 ().IsGroup ()) { params.DisableRts (); params.DisableAck (); diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/mac-low.cc --- a/src/devices/wifi/mac-low.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/mac-low.cc Mon Jan 12 13:35:41 2009 +0100 @@ -613,18 +613,18 @@ } goto rxPacket; } - else if (hdr.GetAddr1 ().IsBroadcast ()) + else if (hdr.GetAddr1 ().IsGroup ()) { - if (hdr.IsData () || hdr.IsMgt ()) + if (hdr.IsData () || hdr.IsMgt ()) { - NS_LOG_DEBUG ("rx broadcast from=" << hdr.GetAddr2 ()); + NS_LOG_DEBUG ("rx group from=" << hdr.GetAddr2 ()); goto rxPacket; - } - else + } + else { - // DROP. + // DROP } - } + } else { //NS_LOG_DEBUG_VERBOSE ("rx not-for-me from %d", GetSource (packet)); diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/mac-rx-middle.cc --- a/src/devices/wifi/mac-rx-middle.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/mac-rx-middle.cc Mon Jan 12 13:35:41 2009 +0100 @@ -157,7 +157,7 @@ OriginatorRxStatus *originator; Mac48Address source = hdr->GetAddr2 (); if (hdr->IsQosData () && - !hdr->GetAddr2 ().IsBroadcast ()) + !hdr->GetAddr2 ().IsGroup ()) { /* only for qos data non-broadcast frames */ originator = m_qosOriginatorStatus[std::make_pair(source, hdr->GetQosTid ())]; @@ -293,7 +293,7 @@ NS_LOG_DEBUG ("forwarding data from="<GetAddr2 ()<< ", seq="<GetSequenceNumber ()<< ", frag="<GetFragmentNumber ()); - if (!hdr->GetAddr1 ().IsBroadcast ()) + if (!hdr->GetAddr1 ().IsGroup ()) { originator->SetSequenceControl (hdr->GetSequenceControl ()); } diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/mac-tx-middle.cc --- a/src/devices/wifi/mac-tx-middle.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/mac-tx-middle.cc Mon Jan 12 13:35:41 2009 +0100 @@ -39,7 +39,7 @@ { uint16_t retval; if (hdr->IsQosData () && - !hdr->GetAddr1 ().IsBroadcast ()) + !hdr->GetAddr1 ().IsGroup ()) { uint8_t tid = hdr->GetQosTid (); NS_ASSERT (tid < 16); diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/nqap-wifi-mac.cc --- a/src/devices/wifi/nqap-wifi-mac.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/nqap-wifi-mac.cc Mon Jan 12 13:35:41 2009 +0100 @@ -447,8 +447,7 @@ NS_LOG_DEBUG ("frame for me from="<IsAssociated ()) { NS_LOG_DEBUG ("forwarding frame from="<GetAddr1 () != GetAddress () && + !hdr->GetAddr1 ().IsGroup ()) { NS_LOG_LOGIC ("packet is not for us"); } @@ -497,10 +501,7 @@ NS_LOG_LOGIC ("Received data frame not from the the BSS we are associated with: ignore"); return; } - if (hdr->GetAddr3 () != GetAddress ()) - { - ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ()); - } + ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ()); } else if (hdr->IsProbeReq () || hdr->IsAssocReq ()) diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/wifi-net-device.cc --- a/src/devices/wifi/wifi-net-device.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/wifi-net-device.cc Mon Jan 12 13:35:41 2009 +0100 @@ -221,7 +221,7 @@ bool WifiNetDevice::IsMulticast (void) const { - return false; + return true; } Address WifiNetDevice::GetMulticast (Ipv4Address multicastGroup) const @@ -291,7 +291,7 @@ { type = NetDevice::PACKET_BROADCAST; } - else if (to.IsMulticast ()) + else if (to.IsGroup ()) { type = NetDevice::PACKET_MULTICAST; } diff -r d2e461e575f4 -r 210d64d11998 src/devices/wifi/wifi-remote-station-manager.cc --- a/src/devices/wifi/wifi-remote-station-manager.cc Sun Jan 11 23:26:34 2009 +0000 +++ b/src/devices/wifi/wifi-remote-station-manager.cc Mon Jan 12 13:35:41 2009 +0100 @@ -227,8 +227,7 @@ WifiRemoteStation * WifiRemoteStationManager::Lookup (Mac48Address address) { - if (address.IsBroadcast () || - address.IsMulticast ()) + if (address.IsGroup ()) { return m_nonUnicast; }