A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-utils.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18 */
19
20#ifndef WIFI_UTILS_H
21#define WIFI_UTILS_H
22
23#include "block-ack-type.h"
24
25#include "ns3/ptr.h"
26
27#include <list>
28
29namespace ns3
30{
31
32class WifiMacHeader;
33class Packet;
34
42double DbmToW(double dbm);
50double DbToRatio(double db);
58double WToDbm(double w);
66double RatioToDb(double ratio);
79uint32_t GetBlockAckSize(BlockAckType type);
86uint32_t GetBlockAckRequestSize(BlockAckReqType type);
93uint32_t GetMuBarSize(std::list<BlockAckReqType> types);
114bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize);
120void AddWifiMacTrailer(Ptr<Packet> packet);
130uint32_t GetSize(Ptr<const Packet> packet, const WifiMacHeader* hdr, bool isAmpdu);
131
133static constexpr uint16_t SEQNO_SPACE_SIZE = 4096;
134
136static constexpr uint16_t SEQNO_SPACE_HALF_SIZE = SEQNO_SPACE_SIZE / 2;
137
140static constexpr uint8_t SINGLE_LINK_OP_ID = 0;
141
143static constexpr uint8_t WIFI_LINKID_UNDEFINED = 0xff;
144
145} // namespace ns3
146
147#endif /* WIFI_UTILS_H */
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static constexpr uint16_t SEQNO_SPACE_HALF_SIZE
Size of the half the space of sequence numbers (used to determine old packets)
Definition: wifi-utils.h:136
double RatioToDb(double ratio)
Convert from ratio to dB.
Definition: wifi-utils.cc:52
double WToDbm(double w)
Convert from Watts to dBm.
Definition: wifi-utils.cc:46
uint32_t GetRtsSize()
Return the total RTS size (including FCS trailer).
Definition: wifi-utils.cc:103
double DbmToW(double dBm)
Convert from dBm to Watts.
Definition: wifi-utils.cc:40
uint32_t GetBlockAckRequestSize(BlockAckReqType type)
Return the total BlockAckRequest size (including FCS trailer).
Definition: wifi-utils.cc:76
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
Definition: wifi-utils.h:140
uint32_t GetMuBarSize(std::list< BlockAckReqType > types)
Return the total MU-BAR size (including FCS trailer).
Definition: wifi-utils.cc:86
static constexpr uint16_t SEQNO_SPACE_SIZE
Size of the space of sequence numbers.
Definition: wifi-utils.h:133
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
Definition: wifi-utils.cc:66
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
Definition: wifi-utils.cc:125
static constexpr uint8_t WIFI_LINKID_UNDEFINED
Invalid link identifier.
Definition: wifi-utils.h:143
uint32_t GetAckSize()
Return the total Ack size (including FCS trailer).
Definition: wifi-utils.cc:58
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:132
double DbToRatio(double dB)
Convert from dB to ratio.
Definition: wifi-utils.cc:34
uint32_t GetCtsSize()
Return the total CTS size (including FCS trailer).
Definition: wifi-utils.cc:111
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
Definition: wifi-utils.cc:119