diff --git a/src/wifi/model/wifi-information-element-vector.cc b/src/wifi/model/wifi-information-element-vector.cc index 8081dac68..db4c70138 100644 --- a/src/wifi/model/wifi-information-element-vector.cc +++ b/src/wifi/model/wifi-information-element-vector.cc @@ -146,7 +146,7 @@ WifiInformationElementVector::End () bool WifiInformationElementVector::AddInformationElement (Ptr element) { - if (element->GetInformationFieldSize () + 2 + GetSize () > m_maxSize) + if (element->GetSerializedSize () + GetSize () > m_maxSize) { return false; } @@ -173,7 +173,7 @@ WifiInformationElementVector::GetSize () const uint32_t size = 0; for (IE_VECTOR::const_iterator i = m_elements.begin (); i != m_elements.end (); i++) { - size += ((*i)->GetInformationFieldSize () + 2); + size += (*i)->GetSerializedSize (); } return size; } diff --git a/src/wifi/model/wifi-information-element.h b/src/wifi/model/wifi-information-element.h index 795fed903..ca8099f5f 100644 --- a/src/wifi/model/wifi-information-element.h +++ b/src/wifi/model/wifi-information-element.h @@ -291,15 +291,6 @@ public: * \returns the wifi information element ID */ virtual WifiInformationElementId ElementId () const = 0; - /** - * Length of serialized information (i.e., the length of the body - * of the IE, not including the Element ID and length octets. This - * is the value that will appear in the second octet of the entire - * IE - the length field) - * - * \return the length of serialized information - */ - virtual uint8_t GetInformationFieldSize () const = 0; /** * Get the wifi information element ID extension @@ -337,6 +328,15 @@ private: * \return an iterator */ Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i); + /** + * Length of serialized information (i.e., the length of the body + * of the IE, not including the Element ID and length octets. This + * is the value that will appear in the second octet of the entire + * IE - the length field) + * + * \return the length of serialized information + */ + virtual uint8_t GetInformationFieldSize () const = 0; /** * Serialize information (i.e., the body of the IE, not including * the Element ID and length octets)