A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
wifi-utils.h
Go to the documentation of this file.
1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2016
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
*/
20
21
#ifndef WIFI_UTILS_H
22
#define WIFI_UTILS_H
23
24
#include <list>
25
#include "ns3/ptr.h"
26
#include "
block-ack-type.h
"
27
28
namespace
ns3
{
29
30
class
WifiMacHeader;
31
class
Packet;
32
40
double
DbmToW
(
double
dbm);
48
double
DbToRatio
(
double
db);
56
double
WToDbm
(
double
w);
64
double
RatioToDb
(
double
ratio);
70
uint32_t
GetAckSize
(
void
);
77
uint32_t
GetBlockAckSize
(BlockAckType type);
84
uint32_t
GetBlockAckRequestSize
(BlockAckReqType type);
91
uint32_t
GetMuBarSize
(std::list<BlockAckReqType> types);
97
uint32_t
GetRtsSize
(
void
);
103
uint32_t
GetCtsSize
(
void
);
112
bool
IsInWindow
(uint16_t seq, uint16_t winstart, uint16_t winsize);
118
void
AddWifiMacTrailer
(Ptr<Packet> packet);
128
uint32_t
GetSize
(Ptr<const Packet> packet,
const
WifiMacHeader *hdr,
bool
isAmpdu);
129
131
const
uint16_t
SEQNO_SPACE_SIZE
= 4096;
132
134
const
uint16_t
SEQNO_SPACE_HALF_SIZE
=
SEQNO_SPACE_SIZE
/ 2;
135
}
// namespace ns3
136
137
#endif
/* WIFI_UTILS_H */
ns3::GetBlockAckSize
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
Definition:
wifi-utils.cc:63
ns3::GetRtsSize
uint32_t GetRtsSize(void)
Return the total RTS size (including FCS trailer).
Definition:
wifi-utils.cc:100
block-ack-type.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WToDbm
double WToDbm(double w)
Convert from Watts to dBm.
Definition:
wifi-utils.cc:43
ns3::GetSize
uint32_t GetSize(Ptr< const Packet > packet, const WifiMacHeader *hdr, bool isAmpdu)
Return the total size of the packet after WifiMacHeader and FCS trailer have been added.
Definition:
wifi-utils.cc:129
ns3::GetAckSize
uint32_t GetAckSize(void)
Return the total Ack size (including FCS trailer).
Definition:
wifi-utils.cc:55
ns3::GetBlockAckRequestSize
uint32_t GetBlockAckRequestSize(BlockAckReqType type)
Return the total BlockAckRequest size (including FCS trailer).
Definition:
wifi-utils.cc:73
ns3::RatioToDb
double RatioToDb(double ratio)
Convert from ratio to dB.
Definition:
wifi-utils.cc:49
ns3::IsInWindow
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
Definition:
wifi-utils.cc:116
ns3::SEQNO_SPACE_SIZE
const uint16_t SEQNO_SPACE_SIZE
Size of the space of sequence numbers.
Definition:
wifi-utils.h:131
ns3::AddWifiMacTrailer
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
Definition:
wifi-utils.cc:122
ns3::DbmToW
double DbmToW(double dBm)
Convert from dBm to Watts.
Definition:
wifi-utils.cc:37
ns3::SEQNO_SPACE_HALF_SIZE
const uint16_t SEQNO_SPACE_HALF_SIZE
Size of the half the space of sequence numbers (used to determine old packets)
Definition:
wifi-utils.h:134
ns3::DbToRatio
double DbToRatio(double dB)
Convert from dB to ratio.
Definition:
wifi-utils.cc:31
ns3::GetMuBarSize
uint32_t GetMuBarSize(std::list< BlockAckReqType > types)
Return the total MU-BAR size (including FCS trailer).
Definition:
wifi-utils.cc:83
ns3::GetCtsSize
uint32_t GetCtsSize(void)
Return the total CTS size (including FCS trailer).
Definition:
wifi-utils.cc:108
src
wifi
model
wifi-utils.h
Generated on Fri Oct 1 2021 17:03:50 for ns-3 by
1.8.20