|
579 |
} |
579 |
} |
580 |
|
580 |
|
581 |
void |
581 |
void |
582 |
PyViz::TraceNetDevTxWifi (std::string context, Ptr<const Packet> packet) |
582 |
PyViz::TraceNetDevTxWifi (std::string context, Ptr<const Packet> packet, Mac48Address destination, Mac48Address source) |
583 |
{ |
583 |
{ |
584 |
NS_LOG_FUNCTION (context << packet->GetUid () << *packet); |
584 |
NS_LOG_FUNCTION (context << packet->GetUid () << destination << source); |
585 |
|
585 |
TraceNetDevTxCommon (context, packet, destination); |
586 |
/* |
|
|
587 |
* To DS From DS Address 1 Address 2 Address 3 Address 4 |
588 |
*---------------------------------------------------------------------- |
589 |
* 0 0 Destination Source BSSID N/A |
590 |
* 0 1 Destination BSSID Source N/A |
591 |
* 1 0 BSSID Source Destination N/A |
592 |
* 1 1 Receiver Transmitter Destination Source |
593 |
*/ |
594 |
WifiMacHeader hdr; |
595 |
NS_ABORT_IF (packet->PeekHeader (hdr) == 0); |
596 |
Mac48Address destinationAddress; |
597 |
if (hdr.IsToDs () && !hdr.IsFromDs ()) |
598 |
{ |
599 |
destinationAddress = hdr.GetAddr3 (); |
600 |
} |
601 |
else if (!hdr.IsToDs () && hdr.IsFromDs ()) |
602 |
{ |
603 |
destinationAddress = hdr.GetAddr1 (); |
604 |
} |
605 |
else if (!hdr.IsToDs () && !hdr.IsFromDs ()) |
606 |
{ |
607 |
destinationAddress = hdr.GetAddr1 (); |
608 |
} |
609 |
else |
610 |
{ |
611 |
destinationAddress = hdr.GetAddr3 (); |
612 |
} |
613 |
TraceNetDevTxCommon (context, packet, destinationAddress); |
614 |
} |
586 |
} |
615 |
|
587 |
|
616 |
|
588 |
|
|
748 |
} |
720 |
} |
749 |
|
721 |
|
750 |
void |
722 |
void |
751 |
PyViz::TraceNetDevRxWifi (std::string context, Ptr<const Packet> packet) |
723 |
PyViz::TraceNetDevRxWifi (std::string context, Ptr<const Packet> packet, Mac48Address destination, Mac48Address source) |
752 |
{ |
724 |
{ |
753 |
NS_LOG_FUNCTION (context << packet->GetUid ()); |
725 |
NS_LOG_FUNCTION (context << packet->GetUid () << destination << source); |
754 |
|
726 |
TraceNetDevRxCommon (context, packet, source); |
755 |
|
|
|
756 |
/* |
757 |
* To DS From DS Address 1 Address 2 Address 3 Address 4 |
758 |
*---------------------------------------------------------------------- |
759 |
* 0 0 Destination Source BSSID N/A |
760 |
* 0 1 Destination BSSID Source N/A |
761 |
* 1 0 BSSID Source Destination N/A |
762 |
* 1 1 Receiver Transmitter Destination Source |
763 |
*/ |
764 |
WifiMacHeader hdr; |
765 |
NS_ABORT_IF (packet->PeekHeader (hdr) == 0); |
766 |
Mac48Address sourceAddress; |
767 |
if (hdr.IsToDs () && !hdr.IsFromDs ()) |
768 |
{ |
769 |
sourceAddress = hdr.GetAddr2 (); |
770 |
} |
771 |
else if (!hdr.IsToDs () && hdr.IsFromDs ()) |
772 |
{ |
773 |
sourceAddress = hdr.GetAddr3 (); |
774 |
} |
775 |
else if (!hdr.IsToDs () && !hdr.IsFromDs ()) |
776 |
{ |
777 |
sourceAddress = hdr.GetAddr2 (); |
778 |
} |
779 |
else |
780 |
{ |
781 |
sourceAddress = hdr.GetAddr4 (); |
782 |
} |
783 |
|
784 |
TraceNetDevRxCommon (context, packet, sourceAddress); |
785 |
} |
727 |
} |
786 |
|
728 |
|
787 |
|
729 |
|