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 (12)
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 */
src
wifi
model
supported-rates.h
Generated on Tue Nov 13 2012 10:32:25 for ns-3 by
1.8.1.2