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