A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
block-ack-type.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Universita' di Napoli
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: Stefano Avallone <stavallo@unina.it>
18
*/
19
20
#include "
block-ack-type.h
"
21
22
#include "ns3/fatal-error.h"
23
24
namespace
ns3
25
{
26
27
BlockAckType::BlockAckType
(
Variant
v)
28
: m_variant(v)
29
{
30
switch
(
m_variant
)
31
{
32
case
BASIC
:
33
m_bitmapLen
.push_back(128);
34
break
;
35
case
COMPRESSED
:
36
case
EXTENDED_COMPRESSED
:
37
m_bitmapLen
.push_back(8);
38
break
;
39
case
MULTI_TID
:
40
case
MULTI_STA
:
41
// m_bitmapLen is left empty.
42
break
;
43
default
:
44
NS_FATAL_ERROR
(
"Unknown block ack type"
);
45
}
46
}
47
48
BlockAckType::BlockAckType
()
49
:
BlockAckType
(BASIC)
50
{
51
}
52
53
BlockAckType::BlockAckType
(
Variant
v, std::vector<uint8_t> l)
54
: m_variant(v),
55
m_bitmapLen(l)
56
{
57
}
58
59
BlockAckReqType::BlockAckReqType
(
Variant
v)
60
: m_variant(v)
61
{
62
switch
(
m_variant
)
63
{
64
case
BASIC
:
65
case
COMPRESSED
:
66
case
EXTENDED_COMPRESSED
:
67
m_nSeqControls
= 1;
68
break
;
69
case
MULTI_TID
:
70
m_nSeqControls
= 0;
71
break
;
72
default
:
73
NS_FATAL_ERROR
(
"Unknown block ack request type"
);
74
}
75
}
76
77
BlockAckReqType::BlockAckReqType
()
78
:
BlockAckReqType
(BASIC)
79
{
80
}
81
82
BlockAckReqType::BlockAckReqType
(
Variant
v, uint8_t nSeqControls)
83
: m_variant(v),
84
m_nSeqControls(nSeqControls)
85
{
86
}
87
88
std::ostream&
89
operator<<
(std::ostream& os,
const
BlockAckType
&
type
)
90
{
91
switch
(
type
.m_variant)
92
{
93
case
BlockAckType::BASIC
:
94
os <<
"basic-block-ack"
;
95
break
;
96
case
BlockAckType::COMPRESSED
:
97
os <<
"compressed-block-ack"
;
98
break
;
99
case
BlockAckType::EXTENDED_COMPRESSED
:
100
os <<
"extended-compressed-block-ack"
;
101
break
;
102
case
BlockAckType::MULTI_TID
:
103
os <<
"multi-tid-block-ack["
<<
type
.m_bitmapLen.size() <<
"]"
;
104
break
;
105
case
BlockAckType::MULTI_STA
:
106
os <<
"multi-sta-block-ack["
<<
type
.m_bitmapLen.size() <<
"]"
;
107
break
;
108
default
:
109
NS_FATAL_ERROR
(
"Unknown block ack type"
);
110
}
111
return
os;
112
}
113
114
std::ostream&
115
operator<<
(std::ostream& os,
const
BlockAckReqType
&
type
)
116
{
117
switch
(
type
.m_variant)
118
{
119
case
BlockAckReqType::BASIC
:
120
os <<
"basic-block-ack-req"
;
121
break
;
122
case
BlockAckReqType::COMPRESSED
:
123
os <<
"compressed-block-ack-req"
;
124
break
;
125
case
BlockAckReqType::EXTENDED_COMPRESSED
:
126
os <<
"extended-compressed-block-ack-req"
;
127
break
;
128
case
BlockAckReqType::MULTI_TID
:
129
os <<
"multi-tid-block-ack-req["
<<
type
.m_nSeqControls <<
"]"
;
130
break
;
131
default
:
132
NS_FATAL_ERROR
(
"Unknown block ack request type"
);
133
}
134
return
os;
135
}
136
137
}
// 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:179
check-style-clang-format.type
type
Definition:
check-style-clang-format.py:704
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:159
ns3::BlockAckReqType
The different BlockAckRequest variants.
Definition:
block-ack-type.h:77
ns3::BlockAckReqType::m_nSeqControls
uint8_t m_nSeqControls
Number of included Starting Sequence Control fields.
Definition:
block-ack-type.h:91
ns3::BlockAckReqType::BlockAckReqType
BlockAckReqType()
Default constructor for BlockAckReqType.
Definition:
block-ack-type.cc:77
ns3::BlockAckReqType::Variant
Variant
The BlockAckReq variants.
Definition:
block-ack-type.h:83
ns3::BlockAckReqType::EXTENDED_COMPRESSED
@ EXTENDED_COMPRESSED
Definition:
block-ack-type.h:86
ns3::BlockAckReqType::BASIC
@ BASIC
Definition:
block-ack-type.h:84
ns3::BlockAckReqType::MULTI_TID
@ MULTI_TID
Definition:
block-ack-type.h:87
ns3::BlockAckReqType::COMPRESSED
@ COMPRESSED
Definition:
block-ack-type.h:85
ns3::BlockAckReqType::m_variant
Variant m_variant
Block Ack Request variant.
Definition:
block-ack-type.h:90
ns3::BlockAckType
The different BlockAck variants.
Definition:
block-ack-type.h:35
ns3::BlockAckType::BlockAckType
BlockAckType()
Default constructor for BlockAckType.
Definition:
block-ack-type.cc:48
ns3::BlockAckType::Variant
Variant
The BlockAck variants.
Definition:
block-ack-type.h:41
ns3::BlockAckType::COMPRESSED
@ COMPRESSED
Definition:
block-ack-type.h:43
ns3::BlockAckType::MULTI_STA
@ MULTI_STA
Definition:
block-ack-type.h:46
ns3::BlockAckType::BASIC
@ BASIC
Definition:
block-ack-type.h:42
ns3::BlockAckType::MULTI_TID
@ MULTI_TID
Definition:
block-ack-type.h:45
ns3::BlockAckType::EXTENDED_COMPRESSED
@ EXTENDED_COMPRESSED
Definition:
block-ack-type.h:44
ns3::BlockAckType::m_variant
Variant m_variant
Block Ack variant.
Definition:
block-ack-type.h:49
ns3::BlockAckType::m_bitmapLen
std::vector< uint8_t > m_bitmapLen
Length (bytes) of included bitmaps.
Definition:
block-ack-type.h:50
src
wifi
model
block-ack-type.cc
Generated on Sun Mar 3 2024 17:11:10 for ns-3 by
1.9.1