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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
radiotap-header.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 CTTC
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, Include., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#ifndef RADIOTAP_HEADER_H
22
#define RADIOTAP_HEADER_H
23
24
25
#include <ns3/header.h>
26
27
namespace
ns3 {
28
48
class
RadiotapHeader
:
public
Header
49
{
50
public
:
51
RadiotapHeader
();
52
static
TypeId
GetTypeId (
void
);
53
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
54
62
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
63
72
virtual
void
Serialize
(
Buffer::Iterator
start)
const
;
73
83
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
84
98
virtual
void
Print
(std::ostream &os)
const
;
99
108
void
SetTsft
(uint64_t tsft);
109
118
uint64_t
GetTsft
(
void
)
const
;
119
120
enum
{
121
FRAME_FLAG_NONE
= 0x00,
122
FRAME_FLAG_CFP
= 0x01,
123
FRAME_FLAG_SHORT_PREAMBLE
= 0x02,
124
FRAME_FLAG_WEP
= 0x04,
125
FRAME_FLAG_FRAGMENTED
= 0x08,
126
FRAME_FLAG_FCS_INCLUDED
= 0x10,
127
FRAME_FLAG_DATA_PADDING
= 0x20,
128
FRAME_FLAG_BAD_FCS
= 0x40,
129
FRAME_FLAG_SHORT_GUARD
= 0x80
130
};
131
136
void
SetFrameFlags
(uint8_t flags);
137
143
uint8_t
GetFrameFlags
(
void
)
const
;
144
149
void
SetRate
(uint8_t rate);
150
155
uint8_t
GetRate
(
void
)
const
;
156
157
enum
{
158
CHANNEL_FLAG_NONE
= 0x0000,
159
CHANNEL_FLAG_TURBO
= 0x0010,
160
CHANNEL_FLAG_CCK
= 0x0020,
161
CHANNEL_FLAG_OFDM
= 0x0040,
162
CHANNEL_FLAG_SPECTRUM_2GHZ
= 0x0080,
163
CHANNEL_FLAG_SPECTRUM_5GHZ
= 0x0100,
164
CHANNEL_FLAG_PASSIVE
= 0x0200,
165
CHANNEL_FLAG_DYNAMIC
= 0x0400,
166
CHANNEL_FLAG_GFSK
= 0x0800
167
};
168
175
void
SetChannelFrequencyAndFlags
(uint16_t frequency, uint16_t flags);
176
181
uint16_t
GetChannelFrequency
(
void
)
const
;
182
188
uint16_t
GetChannelFlags
(
void
)
const
;
189
197
void
SetAntennaSignalPower
(
double
signal);
198
206
uint8_t
GetAntennaSignalPower
(
void
)
const
;
207
215
void
SetAntennaNoisePower
(
double
noise);
216
224
uint8_t
GetAntennaNoisePower
(
void
)
const
;
225
226
private
:
227
enum
{
228
RADIOTAP_TSFT = 0x00000001,
229
RADIOTAP_FLAGS = 0x00000002,
230
RADIOTAP_RATE = 0x00000004,
231
RADIOTAP_CHANNEL = 0x00000008,
232
RADIOTAP_FHSS = 0x00000010,
233
RADIOTAP_DBM_ANTSIGNAL = 0x00000020,
234
RADIOTAP_DBM_ANTNOISE = 0x00000040,
235
RADIOTAP_LOCK_QUALITY = 0x00000080,
236
RADIOTAP_TX_ATTENUATION = 0x00000100,
237
RADIOTAP_DB_TX_ATTENUATION = 0x00000200,
238
RADIOTAP_DBM_TX_POWER = 0x00000200,
239
RADIOTAP_ANTENNA = 0x00000400,
240
RADIOTAP_DB_ANTSIGNAL = 0x00000800,
241
RADIOTAP_DB_ANTNOISE = 0x00001000,
242
RADIOTAP_EXT = 0x10000000
243
};
244
245
void
CheckAddChannelField ();
246
247
uint16_t m_length;
248
uint32_t m_present;
249
250
uint64_t m_tsft;
251
uint8_t m_flags;
252
uint8_t m_rate;
253
uint16_t m_channelFreq;
254
uint16_t m_channelFlags;
255
int8_t m_antennaSignal;
256
int8_t m_antennaNoise;
257
};
258
259
}
// namespace ns3
260
261
#endif
/* RADIOTAP_HEADER_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::RadiotapHeader::FRAME_FLAG_FCS_INCLUDED
Definition:
radiotap-header.h:126
ns3::RadiotapHeader::FRAME_FLAG_WEP
Definition:
radiotap-header.h:124
ns3::RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE
Definition:
radiotap-header.h:123
ns3::RadiotapHeader
Radiotap header implementation.
Definition:
radiotap-header.h:48
ns3::RadiotapHeader::GetTsft
uint64_t GetTsft(void) const
Get the Time Synchronization Function Timer (TSFT) value. Valid for received frames only...
Definition:
radiotap-header.cc:245
ns3::RadiotapHeader::Print
virtual void Print(std::ostream &os) const
Definition:
radiotap-header.cc:217
ns3::RadiotapHeader::CHANNEL_FLAG_OFDM
Definition:
radiotap-header.h:161
ns3::RadiotapHeader::GetRate
uint8_t GetRate(void) const
Get the transmit/receive channel frequency in units of megahertz.
Definition:
radiotap-header.cc:289
ns3::RadiotapHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
radiotap-header.cc:132
ns3::RadiotapHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
radiotap-header.cc:62
ns3::RadiotapHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
radiotap-header.cc:56
ns3::RadiotapHeader::SetAntennaNoisePower
void SetAntennaNoisePower(double noise)
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference...
Definition:
radiotap-header.cc:359
ns3::RadiotapHeader::GetAntennaNoisePower
uint8_t GetAntennaNoisePower(void) const
Get the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference...
Definition:
radiotap-header.cc:385
ns3::RadiotapHeader::FRAME_FLAG_FRAGMENTED
Definition:
radiotap-header.h:125
ns3::RadiotapHeader::SetTsft
void SetTsft(uint64_t tsft)
Set the Time Synchronization Function Timer (TSFT) value. Valid for received frames only...
Definition:
radiotap-header.cc:230
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::RadiotapHeader::CHANNEL_FLAG_GFSK
Definition:
radiotap-header.h:166
ns3::RadiotapHeader::SetChannelFrequencyAndFlags
void SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags)
Set the transmit/receive channel frequency and flags.
Definition:
radiotap-header.cc:296
ns3::RadiotapHeader::CHANNEL_FLAG_CCK
Definition:
radiotap-header.h:160
ns3::RadiotapHeader::SetFrameFlags
void SetFrameFlags(uint8_t flags)
Set the frame flags of the transmitted or received frame.
Definition:
radiotap-header.cc:252
ns3::RadiotapHeader::CHANNEL_FLAG_PASSIVE
Definition:
radiotap-header.h:164
ns3::RadiotapHeader::SetRate
void SetRate(uint8_t rate)
Set the transmit/receive channel frequency in units of megahertz.
Definition:
radiotap-header.cc:274
ns3::RadiotapHeader::FRAME_FLAG_CFP
Definition:
radiotap-header.h:122
ns3::RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ
Definition:
radiotap-header.h:162
ns3::RadiotapHeader::GetFrameFlags
uint8_t GetFrameFlags(void) const
Get the frame flags of the transmitted or received frame.
Definition:
radiotap-header.cc:267
ns3::RadiotapHeader::CHANNEL_FLAG_DYNAMIC
Definition:
radiotap-header.h:165
ns3::RadiotapHeader::FRAME_FLAG_NONE
Definition:
radiotap-header.h:121
ns3::RadiotapHeader::GetChannelFlags
uint16_t GetChannelFlags(void) const
Get the channel flags of the transmitted or received frame.
Definition:
radiotap-header.cc:319
ns3::RadiotapHeader::FRAME_FLAG_SHORT_GUARD
Definition:
radiotap-header.h:129
ns3::RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ
Definition:
radiotap-header.h:163
ns3::RadiotapHeader::CHANNEL_FLAG_TURBO
Definition:
radiotap-header.h:159
ns3::RadiotapHeader::GetAntennaSignalPower
uint8_t GetAntennaSignalPower(void) const
Get the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference...
Definition:
radiotap-header.cc:352
ns3::RadiotapHeader::FRAME_FLAG_BAD_FCS
Definition:
radiotap-header.h:128
ns3::RadiotapHeader::FRAME_FLAG_DATA_PADDING
Definition:
radiotap-header.h:127
ns3::RadiotapHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
radiotap-header.cc:69
ns3::RadiotapHeader::GetChannelFrequency
uint16_t GetChannelFrequency(void) const
Get the transmit/receive data rate in units of 500 kbps.
Definition:
radiotap-header.cc:312
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
ns3::RadiotapHeader::SetAntennaSignalPower
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference...
Definition:
radiotap-header.cc:326
ns3::RadiotapHeader::CHANNEL_FLAG_NONE
Definition:
radiotap-header.h:158
src
network
utils
radiotap-header.h
Generated on Sun Mar 16 2014 11:25:09 for ns-3 by
1.8.6