A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
supported-rates.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2006 INRIA
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef SUPPORTED_RATES_H
21
#define SUPPORTED_RATES_H
22
23
#include <stdint.h>
24
#include <ostream>
25
#include "ns3/buffer.h"
26
#include "ns3/wifi-information-element.h"
27
28
namespace
ns3 {
29
36
#define MAX_SUPPORTED_RATES (32)
37
38
class
SupportedRates;
39
52
class
ExtendedSupportedRatesIE
:
public
WifiInformationElement
53
{
54
public
:
55
ExtendedSupportedRatesIE
();
56
ExtendedSupportedRatesIE
(
SupportedRates
*rates);
57
58
WifiInformationElementId
ElementId
()
const
;
59
uint8_t
GetInformationFieldSize
()
const
;
60
void
SerializeInformationField
(
Buffer::Iterator
start
)
const
;
61
uint8_t
DeserializeInformationField
(
Buffer::Iterator
start,
62
uint8_t length);
63
64
/*
65
* This information element is a bit special in that it is only
66
* included if there are more than 8 rates. To support this we
67
* override the Serialize and GetSerializedSize methods of
68
* WifiInformationElement.
69
*/
70
Buffer::Iterator
Serialize
(
Buffer::Iterator
start)
const
;
71
uint16_t
GetSerializedSize
()
const
;
72
private
:
78
SupportedRates
*
m_supportedRates
;
79
};
80
81
92
class
SupportedRates
:
public
WifiInformationElement
93
{
94
public
:
95
SupportedRates
();
96
97
void
AddSupportedRate
(uint32_t bs);
98
void
SetBasicRate
(uint32_t bs);
99
100
bool
IsSupportedRate
(uint32_t bs)
const
;
101
bool
IsBasicRate
(uint32_t bs)
const
;
102
103
uint8_t
GetNRates
(
void
)
const
;
104
uint32_t
GetRate
(uint8_t i)
const
;
105
106
WifiInformationElementId
ElementId
()
const
;
107
uint8_t
GetInformationFieldSize
()
const
;
108
void
SerializeInformationField
(
Buffer::Iterator
start
)
const
;
109
uint8_t
DeserializeInformationField
(
Buffer::Iterator
start,
110
uint8_t length);
111
112
/*
113
* We support the Extended Supported Rates Information Element
114
* through the ExtendedSupportedRatesIE object which is declared
115
* above. We allow this class to be a friend so that it can access
116
* our private data detailing the rates, and create an instance as
117
* extended.
118
*/
119
friend
class
ExtendedSupportedRatesIE
;
120
ExtendedSupportedRatesIE
extended
;
121
private
:
122
uint8_t
m_nRates
;
123
uint8_t
m_rates
[
MAX_SUPPORTED_RATES
];
124
};
125
126
std::ostream &
operator <<
(std::ostream &os,
const
SupportedRates
&rates);
127
128
}
// namespace ns3
129
130
#endif
/* SUPPORTED_RATES_H */
ns3::SupportedRates::SupportedRates
SupportedRates()
Definition:
supported-rates.cc:29
ns3::SupportedRates::GetRate
uint32_t GetRate(uint8_t i) const
Definition:
supported-rates.cc:100
MAX_SUPPORTED_RATES
#define MAX_SUPPORTED_RATES
Definition:
supported-rates.h:36
ns3::SupportedRates::AddSupportedRate
void AddSupportedRate(uint32_t bs)
Definition:
supported-rates.cc:36
ns3::ExtendedSupportedRatesIE::DeserializeInformationField
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Definition:
supported-rates.cc:210
ns3::ExtendedSupportedRatesIE::GetSerializedSize
uint16_t GetSerializedSize() const
Definition:
supported-rates.cc:195
visualizer.core.start
def start
Definition:
core.py:1482
ns3::SupportedRates::GetNRates
uint8_t GetNRates(void) const
Definition:
supported-rates.cc:95
ns3::SupportedRates::SerializeInformationField
void SerializeInformationField(Buffer::Iterator start) const
Definition:
supported-rates.cc:119
ns3::SupportedRates
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Definition:
supported-rates.h:92
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::SupportedRates::extended
ExtendedSupportedRatesIE extended
Definition:
supported-rates.h:120
ns3::WifiInformationElement
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
Definition:
wifi-information-element.h:130
ns3::ExtendedSupportedRatesIE::Serialize
Buffer::Iterator Serialize(Buffer::Iterator start) const
Definition:
supported-rates.cc:181
ns3::ExtendedSupportedRatesIE::ElementId
WifiInformationElementId ElementId() const
Own unique Element ID.
Definition:
supported-rates.cc:146
ns3::ExtendedSupportedRatesIE::GetInformationFieldSize
uint8_t GetInformationFieldSize() const
Definition:
supported-rates.cc:152
ns3::SupportedRates::SetBasicRate
void SetBasicRate(uint32_t bs)
Definition:
supported-rates.cc:48
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:43
ns3::SupportedRates::IsBasicRate
bool IsBasicRate(uint32_t bs) const
Definition:
supported-rates.cc:68
ns3::SupportedRates::m_nRates
uint8_t m_nRates
Definition:
supported-rates.h:122
ns3::ExtendedSupportedRatesIE::ExtendedSupportedRatesIE
ExtendedSupportedRatesIE()
Definition:
supported-rates.cc:136
ns3::ExtendedSupportedRatesIE
The Extended Supported Rates Information ElementThis class knows how to serialise and deserialise the...
Definition:
supported-rates.h:52
ns3::SupportedRates::m_rates
uint8_t m_rates[MAX_SUPPORTED_RATES]
Definition:
supported-rates.h:123
ns3::SupportedRates::DeserializeInformationField
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Definition:
supported-rates.cc:127
ns3::ExtendedSupportedRatesIE::m_supportedRates
SupportedRates * m_supportedRates
Definition:
supported-rates.h:78
ns3::SupportedRates::ElementId
WifiInformationElementId ElementId() const
Own unique Element ID.
Definition:
supported-rates.cc:106
ns3::SupportedRates::IsSupportedRate
bool IsSupportedRate(uint32_t bs) const
Definition:
supported-rates.cc:81
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
Definition:
wifi-information-element.h:41
ns3::SupportedRates::GetInformationFieldSize
uint8_t GetInformationFieldSize() const
Definition:
supported-rates.cc:111
ns3::ExtendedSupportedRatesIE::SerializeInformationField
void SerializeInformationField(Buffer::Iterator start) const
Definition:
supported-rates.cc:167
src
wifi
model
supported-rates.h
Generated on Sat Nov 16 2013 12:55:40 for ns-3 by
1.8.5