merge with ns3dev
This commit is contained in:
@@ -106,7 +106,7 @@ PeerLinkManagementElement::SubtypeIsConfirm() const
|
||||
Buffer::Iterator
|
||||
PeerLinkManagementElement::Serialize (Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8(PEER_LINK_MANAGEMENT);
|
||||
i.WriteU8(ElementId());
|
||||
i.WriteU8(m_length);
|
||||
i.WriteU8(m_subtype);
|
||||
i.WriteHtonU16(m_localLinkId);
|
||||
@@ -119,9 +119,7 @@ PeerLinkManagementElement::Serialize (Buffer::Iterator i) const
|
||||
Buffer::Iterator
|
||||
PeerLinkManagementElement::Deserialize (Buffer::Iterator i)
|
||||
{
|
||||
dot11sElementID ElementId;
|
||||
ElementId = (dot11sElementID)i.ReadU8();
|
||||
NS_ASSERT(ElementId == PEER_LINK_MANAGEMENT);
|
||||
NS_ASSERT(ElementId() == i.ReadU8());
|
||||
m_length = i.ReadU8();
|
||||
m_subtype = i.ReadU8();
|
||||
m_localLinkId = i.ReadNtohU16();
|
||||
|
||||
@@ -58,6 +58,7 @@ class PeerLinkManagementElement
|
||||
Buffer::Iterator Serialize (Buffer::Iterator i) const;
|
||||
Buffer::Iterator Deserialize (Buffer::Iterator i);
|
||||
private:
|
||||
static uint8_t ElementId() { return (uint8_t)PEER_LINK_MANAGEMENT; }
|
||||
uint8_t m_length;
|
||||
uint8_t m_subtype;
|
||||
uint16_t m_localLinkId; //always is present
|
||||
@@ -66,4 +67,3 @@ class PeerLinkManagementElement
|
||||
};
|
||||
} //namespace NS3
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "mesh-configuration-element.h"
|
||||
#include "ns3/assert.h"
|
||||
#include "dot11s-codes.h"
|
||||
|
||||
//NS_LOG_COMPONENT_DEFINE ("MeshConfigurationElement");
|
||||
|
||||
@@ -104,7 +103,7 @@ Buffer::Iterator
|
||||
MeshConfigurationElement::Serialize (Buffer::Iterator i) const
|
||||
{
|
||||
|
||||
i.WriteU8 (MESH_CONFIGURATION);
|
||||
i.WriteU8 (ElementId());
|
||||
i.WriteU8 (GetSerializedSize()); // Length
|
||||
i.WriteU8 (1); //Version
|
||||
// Active Path Selection Protocol ID:
|
||||
@@ -123,12 +122,12 @@ Buffer::Iterator
|
||||
MeshConfigurationElement::Deserialize (Buffer::Iterator i)
|
||||
{
|
||||
|
||||
uint8_t elementId;
|
||||
//uint8_t elementId;
|
||||
uint8_t size;
|
||||
uint8_t version;
|
||||
elementId = i.ReadU8 ();
|
||||
//elementId = i.ReadU8 ();
|
||||
|
||||
NS_ASSERT (elementId == MESH_CONFIGURATION);
|
||||
NS_ASSERT (ElementId() == i.ReadU8());
|
||||
|
||||
size = i.ReadU8 ();
|
||||
version = i.ReadU8();
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "ns3/buffer.h"
|
||||
#include "dot11s-codes.h"
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
@@ -100,6 +101,7 @@ class MeshConfigurationElement
|
||||
// TODO: Release and fill other fields in configuration
|
||||
// element
|
||||
private:
|
||||
static uint8_t ElementId() { return (uint8_t)MESH_CONFIGURATION; }
|
||||
/** Active Path Selection Protocol ID */
|
||||
dot11sPathSelectionProtocol m_APSId;
|
||||
/** Active Path Metric ID */
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
|
||||
#include "mesh-wifi-beacon-timing-element.h"
|
||||
#define ELEMENT_ID (19)
|
||||
namespace ns3 {
|
||||
/*******************************************
|
||||
* WifiBeaconTimingElementUnit
|
||||
@@ -153,7 +152,7 @@ WifiBeaconTimingElement::Serialize (Buffer::Iterator i) const
|
||||
{
|
||||
uint8_t can_be_written = (2+5*m_numOfUnits > m_maxSize) ? ((m_maxSize-2)/5) : m_numOfUnits;
|
||||
int actually_written = 0;
|
||||
i.WriteU8 (ELEMENT_ID);
|
||||
i.WriteU8 (ElementId());
|
||||
i.WriteU8 (can_be_written);
|
||||
for(NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin(); j!= m_neighbours.end(); j++)
|
||||
{
|
||||
@@ -176,13 +175,9 @@ WifiBeaconTimingElement::Serialize (Buffer::Iterator i) const
|
||||
Buffer::Iterator
|
||||
WifiBeaconTimingElement::Deserialize (Buffer::Iterator i)
|
||||
{
|
||||
uint8_t elementId;
|
||||
uint8_t num_to_read = 0;
|
||||
int j;
|
||||
elementId = i.ReadU8();
|
||||
NS_ASSERT(elementId == ELEMENT_ID);
|
||||
num_to_read = i.ReadU8();
|
||||
for(j=0;j<num_to_read; j++)
|
||||
NS_ASSERT(ElementId() == i.ReadU8());
|
||||
uint8_t num_to_read = i.ReadU8();
|
||||
for(int j = 0; j < num_to_read; j ++)
|
||||
{
|
||||
Ptr<WifiBeaconTimingElementUnit> new_element = Create<WifiBeaconTimingElementUnit>();
|
||||
new_element->SetAID(i.ReadU8());
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "ns3/buffer.h"
|
||||
#include "ns3/nstime.h"
|
||||
#include <list>
|
||||
#include "dot11s-codes.h"
|
||||
namespace ns3
|
||||
{
|
||||
/**
|
||||
@@ -106,6 +107,7 @@ class WifiBeaconTimingElement
|
||||
Buffer::Iterator Serialize (Buffer::Iterator i) const;
|
||||
Buffer::Iterator Deserialize (Buffer::Iterator i);
|
||||
private:
|
||||
static uint8_t ElementId() { return (uint8_t)BEACON_TIMING; }
|
||||
NeighboursTimingUnitsList m_neighbours;
|
||||
//The maximum size of this element:
|
||||
const static uint16_t DEFAULT_MAX_SIZE = 255*5 +2;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "mesh-wifi-perr-information-element.h"
|
||||
#include "ns3/address-utils.h"
|
||||
#define ELEMENT_ID (21)
|
||||
|
||||
namespace ns3 {
|
||||
WifiPerrInformationElement::~WifiPerrInformationElement()
|
||||
@@ -58,7 +57,7 @@ WifiPerrInformationElement::GetNumOfDest()
|
||||
void
|
||||
WifiPerrInformationElement::Serialize(Buffer::Iterator i)const
|
||||
{
|
||||
i.WriteU8 (ELEMENT_ID);
|
||||
i.WriteU8 (ElementId());
|
||||
i.WriteU8 (2+10*m_numOfDest);
|
||||
i.WriteU8(0);
|
||||
i.WriteU8 (m_numOfDest);
|
||||
@@ -73,9 +72,7 @@ uint32_t
|
||||
WifiPerrInformationElement::Deserialize(Buffer::Iterator start)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
uint8_t ElementId;
|
||||
ElementId = i.ReadU8();
|
||||
NS_ASSERT (ElementId = ELEMENT_ID);
|
||||
NS_ASSERT (ElementId() == i.ReadU8());
|
||||
int length = i.ReadU8();
|
||||
i.Next(1); //Mode flags is not used now
|
||||
m_numOfDest = i.ReadU8();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "ns3/mac48-address.h"
|
||||
#include "ns3/hwmp-rtable.h"
|
||||
#include "ns3/header.h"
|
||||
#include "dot11s-codes.h"
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
@@ -59,6 +60,7 @@ class WifiPerrInformationElement : public Header
|
||||
void DeleteAddressUnit(Mac48Address address);
|
||||
void ResetPerr();
|
||||
private:
|
||||
static uint8_t ElementId() { return (uint8_t)PATH_ERROR; }
|
||||
uint8_t m_numOfDest;
|
||||
std::vector<HwmpRtable::FailedDestination>
|
||||
m_addressUnits;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "mesh-wifi-prep-information-element.h"
|
||||
#include "ns3/address-utils.h"
|
||||
#include "ns3/assert.h"
|
||||
#define ELEMENT_ID (30)
|
||||
namespace ns3{
|
||||
/********************************
|
||||
* WifiPrepInformationElement
|
||||
@@ -167,7 +166,7 @@ WifiPrepInformationElement::IncrementMetric(uint32_t metric)
|
||||
void
|
||||
WifiPrepInformationElement::Serialize(Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (ELEMENT_ID);
|
||||
i.WriteU8 (ElementId());
|
||||
i.WriteU8 (32);//length = 32
|
||||
i.WriteU8 (m_flags);
|
||||
i.WriteU8 (m_hopcount);
|
||||
@@ -183,9 +182,7 @@ uint32_t
|
||||
WifiPrepInformationElement::Deserialize(Buffer::Iterator start)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
uint8_t ElementId;
|
||||
ElementId = i.ReadU8();
|
||||
NS_ASSERT (ElementId == ELEMENT_ID);
|
||||
NS_ASSERT (ElementId() == i.ReadU8());
|
||||
i.Next(1); // length is constatnt
|
||||
m_flags = i.ReadU8();
|
||||
m_hopcount = i.ReadU8();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "ns3/buffer.h"
|
||||
#include "ns3/mac48-address.h"
|
||||
#include "ns3/header.h"
|
||||
#include "dot11s-codes.h"
|
||||
namespace ns3
|
||||
{
|
||||
/**
|
||||
@@ -68,7 +69,7 @@ class WifiPrepInformationElement : public Header
|
||||
void DecrementTtl();
|
||||
void IncrementMetric(uint32_t metric);
|
||||
private:
|
||||
|
||||
static uint8_t ElementId() { return (uint8_t)PATH_REPLY; }
|
||||
uint8_t m_flags;
|
||||
uint8_t m_hopcount;
|
||||
uint8_t m_ttl;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "mesh-wifi-preq-information-element.h"
|
||||
#include "ns3/address-utils.h"
|
||||
#include "ns3/assert.h"
|
||||
#define ELEMENT_ID (22)
|
||||
namespace ns3{
|
||||
/*************************
|
||||
* DestinationAddressUnit
|
||||
@@ -250,7 +249,7 @@ WifiPreqInformationElement::IncrementMetric(uint32_t metric)
|
||||
void
|
||||
WifiPreqInformationElement::Serialize(Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (ELEMENT_ID);
|
||||
i.WriteU8 (ElementId());
|
||||
//TODO:Check maxsize
|
||||
uint8_t length = m_destCount*11+28;
|
||||
if(m_destCount> m_maxSize)
|
||||
@@ -286,9 +285,7 @@ uint32_t
|
||||
WifiPreqInformationElement::Deserialize(Buffer::Iterator start)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
uint8_t ElementId;
|
||||
ElementId = i.ReadU8();
|
||||
NS_ASSERT (ElementId == ELEMENT_ID);
|
||||
NS_ASSERT (ElementId() == i.ReadU8());
|
||||
uint8_t length;
|
||||
length = i.ReadU8();
|
||||
m_flags = i.ReadU8();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "ns3/mac48-address.h"
|
||||
#include "ns3/header.h"
|
||||
#include <vector>
|
||||
#include "dot11s-codes.h"
|
||||
namespace ns3
|
||||
{
|
||||
/**
|
||||
@@ -107,6 +108,7 @@ class WifiPreqInformationElement : public Header
|
||||
void IncrementMetric(uint32_t metric);
|
||||
|
||||
private:
|
||||
static uint8_t ElementId() { return (uint8_t)PATH_REQUEST; }
|
||||
//how many destinations we support
|
||||
uint8_t m_maxSize; //TODO: make as an attrubute
|
||||
//Fields:
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "mesh-wifi-rann-information-element.h"
|
||||
#include "ns3/assert.h"
|
||||
#include "ns3/address-utils.h"
|
||||
#define ELEMENT_ID (20)
|
||||
|
||||
namespace ns3{
|
||||
|
||||
@@ -46,15 +45,14 @@ WifiRannInformationElement::Print(std::ostream &os)const
|
||||
{
|
||||
// FILL
|
||||
}
|
||||
WifiRannInformationElement::WifiRannInformationElement()
|
||||
{ m_flags = 0;
|
||||
m_hopcount = 0;
|
||||
m_ttl = 0;
|
||||
m_destSeqNumber = 0;
|
||||
m_metric = 0;
|
||||
m_originatorAddress = Mac48Address::GetBroadcast();
|
||||
m_destSeqNumber = 0;
|
||||
|
||||
WifiRannInformationElement::WifiRannInformationElement():
|
||||
m_flags(0),
|
||||
m_hopcount(0),
|
||||
m_ttl(0),
|
||||
m_originatorAddress(Mac48Address::GetBroadcast()),
|
||||
m_destSeqNumber(0),
|
||||
m_metric(0)
|
||||
{
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetFlags(uint8_t flags)
|
||||
@@ -120,7 +118,7 @@ WifiRannInformationElement::GetOriginatorAddress()
|
||||
void
|
||||
WifiRannInformationElement::Serialize(Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (ELEMENT_ID);
|
||||
i.WriteU8 (ElementId());
|
||||
i.WriteU8 (21);//length = 21
|
||||
i.WriteU8 (m_flags);
|
||||
i.WriteU8 (m_hopcount);
|
||||
@@ -133,9 +131,7 @@ uint32_t
|
||||
WifiRannInformationElement::Deserialize(Buffer::Iterator start)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
uint8_t ElementId;
|
||||
ElementId = i.ReadU8();
|
||||
NS_ASSERT (ElementId == ELEMENT_ID);
|
||||
NS_ASSERT (ElementId() == i.ReadU8());
|
||||
i.Next(1);// length is constant
|
||||
m_flags = i.ReadU8();
|
||||
m_hopcount = i.ReadU8();
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "ns3/mac48-address.h"
|
||||
#include "ns3/node.h"
|
||||
#include "ns3/header.h"
|
||||
#include "dot11s-codes.h"
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
@@ -63,6 +64,7 @@ class WifiRannInformationElement
|
||||
void IncrementMetric(uint32_t metric);
|
||||
|
||||
private:
|
||||
static uint8_t ElementId() { return (uint8_t)ROOT_ANNOUCEMENT; }
|
||||
uint8_t m_flags;
|
||||
uint8_t m_hopcount;
|
||||
uint8_t m_ttl;
|
||||
|
||||
Reference in New Issue
Block a user