equal
deleted
inserted
replaced
473 void |
473 void |
474 NqstaWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr) |
474 NqstaWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr) |
475 { |
475 { |
476 NS_LOG_FUNCTION (this << packet << hdr); |
476 NS_LOG_FUNCTION (this << packet << hdr); |
477 NS_ASSERT (!hdr->IsCtl ()); |
477 NS_ASSERT (!hdr->IsCtl ()); |
478 if (hdr->GetAddr1 () != GetAddress () && |
478 if (hdr->GetAddr3 () == GetAddress ()) |
479 !hdr->GetAddr1 ().IsBroadcast ()) |
479 { |
|
480 NS_LOG_LOGIC ("packet sent by us."); |
|
481 } |
|
482 else if (hdr->GetAddr1 () != GetAddress () && |
|
483 !hdr->GetAddr1 ().IsGroup ()) |
480 { |
484 { |
481 NS_LOG_LOGIC ("packet is not for us"); |
485 NS_LOG_LOGIC ("packet is not for us"); |
482 } |
486 } |
483 else if (hdr->IsData ()) |
487 else if (hdr->IsData ()) |
484 { |
488 { |
495 if (hdr->GetAddr2 () != GetBssid ()) |
499 if (hdr->GetAddr2 () != GetBssid ()) |
496 { |
500 { |
497 NS_LOG_LOGIC ("Received data frame not from the the BSS we are associated with: ignore"); |
501 NS_LOG_LOGIC ("Received data frame not from the the BSS we are associated with: ignore"); |
498 return; |
502 return; |
499 } |
503 } |
500 if (hdr->GetAddr3 () != GetAddress ()) |
504 ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ()); |
501 { |
|
502 ForwardUp (packet, hdr->GetAddr3 (), hdr->GetAddr1 ()); |
|
503 } |
|
504 } |
505 } |
505 else if (hdr->IsProbeReq () || |
506 else if (hdr->IsProbeReq () || |
506 hdr->IsAssocReq ()) |
507 hdr->IsAssocReq ()) |
507 { |
508 { |
508 /* this is a frame aimed at an AP. |
509 /* this is a frame aimed at an AP. |