A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
block-ack-type.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Universita' di Napoli
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Stefano Avallone <stavallo@unina.it>
7
*/
8
9
#include "
block-ack-type.h
"
10
11
#include "ns3/fatal-error.h"
12
13
namespace
ns3
14
{
15
16
BlockAckType::BlockAckType
(
Variant
v)
17
: m_variant(v)
18
{
19
switch
(
m_variant
)
20
{
21
case
BASIC
:
22
m_bitmapLen
.push_back(128);
23
break
;
24
case
COMPRESSED
:
25
case
EXTENDED_COMPRESSED
:
26
m_bitmapLen
.push_back(8);
27
break
;
28
case
MULTI_TID
:
29
case
MULTI_STA
:
30
// m_bitmapLen is left empty.
31
break
;
32
default
:
33
NS_FATAL_ERROR
(
"Unknown block ack type"
);
34
}
35
}
36
37
BlockAckType::BlockAckType
()
38
:
BlockAckType
(BASIC)
39
{
40
}
41
42
BlockAckType::BlockAckType
(
Variant
v, std::vector<uint8_t> l)
43
: m_variant(v),
44
m_bitmapLen(l)
45
{
46
}
47
48
BlockAckReqType::BlockAckReqType
(
Variant
v)
49
: m_variant(v)
50
{
51
switch
(
m_variant
)
52
{
53
case
BASIC
:
54
case
COMPRESSED
:
55
case
EXTENDED_COMPRESSED
:
56
m_nSeqControls
= 1;
57
break
;
58
case
MULTI_TID
:
59
m_nSeqControls
= 0;
60
break
;
61
default
:
62
NS_FATAL_ERROR
(
"Unknown block ack request type"
);
63
}
64
}
65
66
BlockAckReqType::BlockAckReqType
()
67
:
BlockAckReqType
(BASIC)
68
{
69
}
70
71
BlockAckReqType::BlockAckReqType
(
Variant
v, uint8_t nSeqControls)
72
: m_variant(v),
73
m_nSeqControls(nSeqControls)
74
{
75
}
76
77
std::ostream&
78
operator<<
(std::ostream& os,
const
BlockAckType
& type)
79
{
80
switch
(type.m_variant)
81
{
82
case
BlockAckType::BASIC
:
83
os <<
"basic-block-ack"
;
84
break
;
85
case
BlockAckType::COMPRESSED
:
86
os <<
"compressed-block-ack"
;
87
break
;
88
case
BlockAckType::EXTENDED_COMPRESSED
:
89
os <<
"extended-compressed-block-ack"
;
90
break
;
91
case
BlockAckType::MULTI_TID
:
92
os <<
"multi-tid-block-ack["
<< type.m_bitmapLen.size() <<
"]"
;
93
break
;
94
case
BlockAckType::MULTI_STA
:
95
os <<
"multi-sta-block-ack["
<< type.m_bitmapLen.size() <<
"]"
;
96
break
;
97
default
:
98
NS_FATAL_ERROR
(
"Unknown block ack type"
);
99
}
100
return
os;
101
}
102
103
std::ostream&
104
operator<<
(std::ostream& os,
const
BlockAckReqType
& type)
105
{
106
switch
(type.m_variant)
107
{
108
case
BlockAckReqType::BASIC
:
109
os <<
"basic-block-ack-req"
;
110
break
;
111
case
BlockAckReqType::COMPRESSED
:
112
os <<
"compressed-block-ack-req"
;
113
break
;
114
case
BlockAckReqType::EXTENDED_COMPRESSED
:
115
os <<
"extended-compressed-block-ack-req"
;
116
break
;
117
case
BlockAckReqType::MULTI_TID
:
118
os <<
"multi-tid-block-ack-req["
<< type.m_nSeqControls <<
"]"
;
119
break
;
120
default
:
121
NS_FATAL_ERROR
(
"Unknown block ack request type"
);
122
}
123
return
os;
124
}
125
126
}
// namespace ns3
block-ack-type.h
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition
fatal-error.h:168
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition
angles.cc:148
ns3::BlockAckReqType
The different BlockAckRequest variants.
Definition
block-ack-type.h:66
ns3::BlockAckReqType::m_nSeqControls
uint8_t m_nSeqControls
Number of included Starting Sequence Control fields.
Definition
block-ack-type.h:80
ns3::BlockAckReqType::BlockAckReqType
BlockAckReqType()
Default constructor for BlockAckReqType.
Definition
block-ack-type.cc:66
ns3::BlockAckReqType::Variant
Variant
The BlockAckReq variants.
Definition
block-ack-type.h:72
ns3::BlockAckReqType::EXTENDED_COMPRESSED
@ EXTENDED_COMPRESSED
Definition
block-ack-type.h:75
ns3::BlockAckReqType::BASIC
@ BASIC
Definition
block-ack-type.h:73
ns3::BlockAckReqType::MULTI_TID
@ MULTI_TID
Definition
block-ack-type.h:76
ns3::BlockAckReqType::COMPRESSED
@ COMPRESSED
Definition
block-ack-type.h:74
ns3::BlockAckReqType::m_variant
Variant m_variant
Block Ack Request variant.
Definition
block-ack-type.h:79
ns3::BlockAckType
The different BlockAck variants.
Definition
block-ack-type.h:24
ns3::BlockAckType::BlockAckType
BlockAckType()
Default constructor for BlockAckType.
Definition
block-ack-type.cc:37
ns3::BlockAckType::Variant
Variant
The BlockAck variants.
Definition
block-ack-type.h:30
ns3::BlockAckType::COMPRESSED
@ COMPRESSED
Definition
block-ack-type.h:32
ns3::BlockAckType::MULTI_STA
@ MULTI_STA
Definition
block-ack-type.h:35
ns3::BlockAckType::BASIC
@ BASIC
Definition
block-ack-type.h:31
ns3::BlockAckType::MULTI_TID
@ MULTI_TID
Definition
block-ack-type.h:34
ns3::BlockAckType::EXTENDED_COMPRESSED
@ EXTENDED_COMPRESSED
Definition
block-ack-type.h:33
ns3::BlockAckType::m_variant
Variant m_variant
Block Ack variant.
Definition
block-ack-type.h:38
ns3::BlockAckType::m_bitmapLen
std::vector< uint8_t > m_bitmapLen
Length (bytes) of included bitmaps.
Definition
block-ack-type.h:39
src
wifi
model
block-ack-type.cc
Generated on Fri Nov 8 2024 13:59:07 for ns-3 by
1.11.0