|
746 |
Ptr<Packet> originalPacket = packet->Copy (); |
746 |
Ptr<Packet> originalPacket = packet->Copy (); |
747 |
|
747 |
|
748 |
EthernetTrailer trailer; |
748 |
EthernetTrailer trailer; |
749 |
packet->RemoveTrailer (trailer); |
|
|
750 |
trailer.CheckFcs (packet); |
751 |
|
749 |
|
752 |
EthernetHeader header (false); |
750 |
EthernetHeader header (false); |
753 |
packet->RemoveHeader (header); |
751 |
packet->PeekHeader (header); |
754 |
|
752 |
|
755 |
NS_LOG_LOGIC ("Pkt source is " << header.GetSource ()); |
753 |
NS_LOG_LOGIC ("Pkt source is " << header.GetSource ()); |
756 |
NS_LOG_LOGIC ("Pkt destination is " << header.GetDestination ()); |
754 |
NS_LOG_LOGIC ("Pkt destination is " << header.GetDestination ()); |
|
758 |
if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) ) |
756 |
if (m_receiveErrorModel && m_receiveErrorModel->IsCorrupt (packet) ) |
759 |
{ |
757 |
{ |
760 |
NS_LOG_LOGIC ("Dropping pkt due to error model "); |
758 |
NS_LOG_LOGIC ("Dropping pkt due to error model "); |
|
|
759 |
packet->RemoveTrailer (trailer); |
760 |
trailer.CheckFcs (packet); |
761 |
packet->RemoveHeader (header); |
761 |
m_phyRxDropTrace (packet); |
762 |
m_phyRxDropTrace (packet); |
762 |
} |
763 |
} |
763 |
else |
764 |
else |
764 |
{ |
765 |
{ |
|
|
766 |
packet->RemoveTrailer (trailer); |
767 |
trailer.CheckFcs (packet); |
768 |
packet->RemoveHeader (header); |
769 |
|
765 |
uint16_t protocol; |
770 |
uint16_t protocol; |
766 |
// |
771 |
// |
767 |
// If the length/type is less than 1500, it corresponds to a length |
772 |
// If the length/type is less than 1500, it corresponds to a length |