|
|
| 67 |
#include "ns3/udp-socket-factory.h" |
67 |
#include "ns3/udp-socket-factory.h" |
| 68 |
#include "ns3/tcp-socket-factory.h" |
68 |
#include "ns3/tcp-socket-factory.h" |
| 69 |
#include "ns3/llc-snap-header.h" |
69 |
#include "ns3/llc-snap-header.h" |
| 70 |
#include "ns3/arp-header.h" |
|
|
| 71 |
#include "ns3/ipv6-interface.h" |
70 |
#include "ns3/ipv6-interface.h" |
| 72 |
|
71 |
|
| 73 |
#include "dsr-rreq-table.h" |
72 |
#include "dsr-rreq-table.h" |
|
|
| 549 |
return; |
548 |
return; |
| 550 |
} |
549 |
} |
| 551 |
|
550 |
|
|
|
551 |
if (! hdr.IsData ()) |
| 552 |
{ |
| 553 |
NS_LOG_LOGIC ("WifiMac - not a data packet - skip it"); |
| 554 |
return; |
| 555 |
} |
| 556 |
|
| 557 |
|
| 552 |
LlcSnapHeader llc; |
558 |
LlcSnapHeader llc; |
| 553 |
if(!newP->PeekHeader (llc)) |
559 |
if(!newP->PeekHeader (llc)) |
| 554 |
{ |
560 |
{ |
| 555 |
// NS_LOG_WARN ("llc snap header not present"); |
561 |
// NS_LOG_WARN ("llc snap header not present"); |
| 556 |
NS_ASSERT (newP->GetSize() < 64); |
562 |
NS_ASSERT (newP->GetSize() < 64); |
| 557 |
return; |
563 |
return; |
| 558 |
} |
564 |
} |
| 559 |
newP->RemoveHeader(llc); |
565 |
newP->RemoveHeader(llc); |
| 560 |
/** \internal |
566 |
|
| 561 |
* Tried to use peekheader here, but for ipv4 header here, |
567 |
if (llc.GetType () != Ipv4L3Protocol::PROT_NUMBER) |
| 562 |
* dsr removes the Ipv4Header and then pass the packet and the header |
568 |
{ |
| 563 |
* separately to Ipv4L3Protocol. Ipv4L3Protocol then re-adds them |
569 |
return; |
| 564 |
* together, which causes the problem. Check \bugid{1479} |
570 |
} |
| 565 |
*/ |
571 |
|
| 566 |
ArpHeader arp; |
|
|
| 567 |
if(newP->PeekHeader (arp)) |
| 568 |
{ |
| 569 |
// NS_LOG_WARN ("arp header present, skip this packet"); |
| 570 |
NS_ASSERT (newP->GetSize() < 64); |
| 571 |
return; |
| 572 |
} |
| 573 |
/// Remove the ipv4 header here |
572 |
/// Remove the ipv4 header here |
| 574 |
Ipv4Header ip; |
573 |
Ipv4Header ip; |
| 575 |
newP->RemoveHeader(ip); |
574 |
newP->RemoveHeader(ip); |