diff --git a/doc/WimaxArchitecture.png b/doc/WimaxArchitecture.png new file mode 100644 index 000000000..6eba0b8b3 Binary files /dev/null and b/doc/WimaxArchitecture.png differ diff --git a/examples/wimax/wimax-simple.cc b/examples/wimax/wimax-simple.cc index 25b568878..449588f1b 100644 --- a/examples/wimax/wimax-simple.cc +++ b/examples/wimax/wimax-simple.cc @@ -153,6 +153,8 @@ int main (int argc, char *argv[]) clientApps.Stop (Seconds (duration)); Simulator::Stop (Seconds (duration + 0.1)); + wimax.EnablePcap("ss0", ssNodes.Get (0)->GetId (), ss[0]->GetIfIndex ()); + wimax.EnablePcap("ss1", ssNodes.Get (0)->GetId (), ss[0]->GetIfIndex ()); IpcsClassifierRecord DlClassifierUgs (Ipv4Address ("0.0.0.0"), Ipv4Mask ("0.0.0.0"), diff --git a/src/devices/wimax/wimax-mac-to-mac-header.cc b/src/devices/wimax/wimax-mac-to-mac-header.cc index 3d8029ed2..99d45d67d 100644 --- a/src/devices/wimax/wimax-mac-to-mac-header.cc +++ b/src/devices/wimax/wimax-mac-to-mac-header.cc @@ -74,7 +74,16 @@ WimaxMacToMacHeader::GetSizeOfLen (void) const uint32_t WimaxMacToMacHeader::GetSerializedSize (void) const { - return 20 + GetSizeOfLen () ; + uint8_t sizeOfLen = GetSizeOfLen (); + if (sizeOfLen==1) + { + return 20 ; + } + else + { + return 20 + sizeOfLen -1 ; + } + //return 19+sizeOfLen; } void @@ -112,7 +121,7 @@ WimaxMacToMacHeader::Serialize (Buffer::Iterator i) const } else { - i.WriteU8 ((lenSize - 1) | 0x80); + i.WriteU8 ((lenSize-1) | 0x80); for (int j = 0; j < lenSize - 1; j++) { i.WriteU8 ((uint8_t)(m_len >> ((lenSize - 1 - 1 - j) * 8))); diff --git a/src/devices/wimax/wimax-tlv.cc b/src/devices/wimax/wimax-tlv.cc index 808def7d8..48a470e0f 100644 --- a/src/devices/wimax/wimax-tlv.cc +++ b/src/devices/wimax/wimax-tlv.cc @@ -121,7 +121,7 @@ Tlv::Serialize (Buffer::Iterator i) const } else { - i.WriteU8 ((lenSize - 1) | WIMAX_TLV_EXTENDED_LENGTH_MASK); + i.WriteU8 ((lenSize-1) | WIMAX_TLV_EXTENDED_LENGTH_MASK); for (int j = 0; j < lenSize - 1; j++) { i.WriteU8 ((uint8_t)(m_length >> ((lenSize - 1 - 1 - j) * 8))); diff --git a/src/helper/wimax-helper.cc b/src/helper/wimax-helper.cc index ef83fd10d..98486e681 100644 --- a/src/helper/wimax-helper.cc +++ b/src/helper/wimax-helper.cc @@ -545,7 +545,7 @@ static void PcapSniffTxEvent (Ptr file, std::list > packets = burst->GetPackets (); for (std::list >::iterator iter = packets.begin (); iter != packets.end (); ++iter) { - WimaxMacToMacHeader m2m((*iter)->GetSize()+1); + WimaxMacToMacHeader m2m((*iter)->GetSize()); (*iter)->AddHeader(m2m); file->Write (Simulator::Now (), (*iter)); } @@ -556,7 +556,7 @@ static void PcapSniffRxEvent (Ptr file, Ptr std::list > packets = burst->GetPackets (); for (std::list >::iterator iter = packets.begin (); iter != packets.end (); ++iter) { - WimaxMacToMacHeader m2m((*iter)->GetSize()+1); + WimaxMacToMacHeader m2m((*iter)->GetSize()); (*iter)->AddHeader(m2m); file->Write (Simulator::Now (), (*iter)); }