Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(872)

Unified Diff: src/mesh/model/dot11s/ie-dot11s-perr.cc

Issue 217910043: mesh module compliant to IEEE802.11-2012
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/mesh/model/dot11s/ie-dot11s-perr.cc
===================================================================
old mode 100644
new mode 100755
--- a/src/mesh/model/dot11s/ie-dot11s-perr.cc
+++ b/src/mesh/model/dot11s/ie-dot11s-perr.cc
@@ -54,28 +54,33 @@
void
IePerr::SerializeInformationField (Buffer::Iterator i) const
{
- i.WriteU8 (0);
- i.WriteU8 (m_addressUnits.size ());
+ i.WriteU8 (0);// TTL
+ i.WriteU8 (m_addressUnits.size ()); // number of Destinations
for (unsigned int j = 0; j < m_addressUnits.size (); j++)
{
+ i.WriteU8 (0); // not used // Bit 6: AE (Address Extension) subfield (1 = destination external address is present, 0 = otherwise).
WriteTo (i, m_addressUnits[j].destination);
i.WriteHtolsbU32 (m_addressUnits[j].seqnum);
+ i.WriteU8 (0);
+ i.WriteU8 (0);
}
}
uint8_t
IePerr::DeserializeInformationField (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
- i.Next (1); //Mode flags is not used now
+ i.Next (1); //TTL //Mode flags is not used now
uint8_t numOfDest = i.ReadU8 ();
- NS_ASSERT ((2 + 10 * numOfDest ) == length);
+ NS_ASSERT ((2 + 13 * numOfDest ) == length);
length = 0; //to avoid compiler warning in optimized builds
for (unsigned int j = 0; j < numOfDest; j++)
{
+ i.Next (1); // flags is not used now
HwmpProtocol::FailedDestination unit;
ReadFrom (i, unit.destination);
unit.seqnum = i.ReadLsbtohU32 ();
m_addressUnits.push_back (unit);
+ i.Next (2); // Reason
}
return i.GetDistanceFrom (start);
}
@@ -83,9 +88,11 @@
uint8_t
IePerr::GetInformationFieldSize () const
{
- uint8_t retval = 1 //ModeFlags
+ uint8_t retval = 1 //TTL //ModeFlags
+ 1 //NumOfDests
- + (6 + 4) * m_addressUnits.size ();
+ + 1 * m_addressUnits.size () //ModeFlags
+ + (6 + 4) * m_addressUnits.size ()
+ + 2* m_addressUnits.size (); // Reason Code
return retval;
}
@@ -99,7 +106,7 @@
return;
}
}
- if ((m_addressUnits.size () + 1) * 10 + 2 > 255)
+ if ((m_addressUnits.size () + 1) * 13 + 2 > 255)
{
return;
}
@@ -112,7 +119,7 @@
return (GetInformationFieldSize ()
> 255
- 2 /* ID + LENGTH*/
- - 10 /* Size of Mac48Address + uint32_t (one unit)*/
+ - 13// 10 /* Size of Mac48Address + uint32_t (one unit)*/
);
}
std::vector<HwmpProtocol::FailedDestination>

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b