author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 9783 | 828a38d9c799 |
child 10410 | 4d4eb8097fa3 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7141
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2006 INRIA |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
4 |
* Copyright (c) 2009 MIRKO BANCHI |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* This program is free software; you can redistribute it and/or modify |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
7 |
* it under the terms of the GNU General Public License version 2 as |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* GNU General Public License for more details. |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* along with this program; if not, write to the Free Software |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
20 |
* Author: Mirko Banchi <mk.banchi@gmail.com> |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
*/ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#include "mgt-headers.h" |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "ns3/simulator.h" |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "ns3/assert.h" |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
|
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
namespace ns3 { |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
|
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
/*********************************************************** |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
* Probe Request |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
***********************************************************/ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
|
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
32 |
NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
33 |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
MgtProbeRequestHeader::~MgtProbeRequestHeader () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
35 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
36 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
38 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
MgtProbeRequestHeader::SetSsid (Ssid ssid) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
m_ssid = ssid; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
43 |
Ssid |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
MgtProbeRequestHeader::GetSsid (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
return m_ssid; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
48 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
MgtProbeRequestHeader::SetSupportedRates (SupportedRates rates) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
50 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
m_rates = rates; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
} |
10139 | 53 |
void |
54 |
MgtProbeRequestHeader::SetHtCapabilities(HtCapabilities htcapabilities) |
|
55 |
{ |
|
56 |
m_htCapability=htcapabilities; |
|
57 |
} |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
58 |
|
10139 | 59 |
HtCapabilities |
60 |
MgtProbeRequestHeader::GetHtCapabilities (void) const |
|
61 |
{ |
|
62 |
return m_htCapability; |
|
63 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
64 |
SupportedRates |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
65 |
MgtProbeRequestHeader::GetSupportedRates (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
66 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
67 |
return m_rates; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
68 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
69 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
70 |
MgtProbeRequestHeader::GetSerializedSize (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
71 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
72 |
uint32_t size = 0; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
73 |
size += m_ssid.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
74 |
size += m_rates.GetSerializedSize (); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
75 |
size += m_rates.extended.GetSerializedSize (); |
10139 | 76 |
size += m_htCapability.GetSerializedSize(); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
77 |
return size; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
78 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
79 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
80 |
MgtProbeRequestHeader::GetTypeId (void) |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
81 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
82 |
static TypeId tid = TypeId ("ns3::MgtProbeRequestHeader") |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
83 |
.SetParent<Header> () |
2650
3de4cacb8981
make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2646
diff
changeset
|
84 |
.AddConstructor<MgtProbeRequestHeader> () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
85 |
; |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
86 |
return tid; |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
87 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
88 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
89 |
MgtProbeRequestHeader::GetInstanceTypeId (void) const |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
90 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
91 |
return GetTypeId (); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
92 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
93 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
94 |
MgtProbeRequestHeader::Print (std::ostream &os) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
95 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
96 |
os << "ssid=" << m_ssid << ", " |
10139 | 97 |
<< "rates=" << m_rates << ", " |
98 |
<< "HT Capabilities=" << m_htCapability; |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
99 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
100 |
void |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
101 |
MgtProbeRequestHeader::Serialize (Buffer::Iterator start) const |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
102 |
{ |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
103 |
Buffer::Iterator i = start; |
6389
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
104 |
i = m_ssid.Serialize (i); |
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
105 |
i = m_rates.Serialize (i); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
106 |
i = m_rates.extended.Serialize (i); |
10139 | 107 |
i = m_htCapability.Serialize(i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
108 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
109 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
110 |
MgtProbeRequestHeader::Deserialize (Buffer::Iterator start) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
111 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
112 |
Buffer::Iterator i = start; |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
113 |
i = m_ssid.Deserialize (i); |
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
114 |
i = m_rates.Deserialize (i); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
115 |
i = m_rates.extended.DeserializeIfPresent (i); |
10139 | 116 |
i = m_htCapability.DeserializeIfPresent (i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
117 |
return i.GetDistanceFrom (start); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
118 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
119 |
|
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
120 |
|
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
121 |
/*********************************************************** |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
122 |
* Probe Response |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
123 |
***********************************************************/ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
124 |
|
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
125 |
NS_OBJECT_ENSURE_REGISTERED (MgtProbeResponseHeader); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
126 |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
127 |
MgtProbeResponseHeader::MgtProbeResponseHeader () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
128 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
129 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
130 |
MgtProbeResponseHeader::~MgtProbeResponseHeader () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
131 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
132 |
} |
4692
f4cd995f1718
Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents:
3662
diff
changeset
|
133 |
uint64_t |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
134 |
MgtProbeResponseHeader::GetTimestamp () |
4692
f4cd995f1718
Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents:
3662
diff
changeset
|
135 |
{ |
f4cd995f1718
Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents:
3662
diff
changeset
|
136 |
return m_timestamp; |
f4cd995f1718
Review issue 88093: Minor changes in wifi module needed by 802.11s
Pavel Boyko <boyko@iitp.ru>
parents:
3662
diff
changeset
|
137 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
138 |
Ssid |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
139 |
MgtProbeResponseHeader::GetSsid (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
141 |
return m_ssid; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
142 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
143 |
uint64_t |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
144 |
MgtProbeResponseHeader::GetBeaconIntervalUs (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
145 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
146 |
return m_beaconInterval; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
147 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
148 |
SupportedRates |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
149 |
MgtProbeResponseHeader::GetSupportedRates (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
150 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
151 |
return m_rates; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
152 |
} |
10139 | 153 |
void |
154 |
MgtProbeResponseHeader::SetHtCapabilities(HtCapabilities htcapabilities) |
|
155 |
{ |
|
156 |
m_htCapability=htcapabilities; |
|
157 |
} |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
158 |
|
10139 | 159 |
HtCapabilities |
160 |
MgtProbeResponseHeader::GetHtCapabilities (void) const |
|
161 |
{ |
|
162 |
return m_htCapability; |
|
163 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
164 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
165 |
MgtProbeResponseHeader::SetSsid (Ssid ssid) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
166 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
167 |
m_ssid = ssid; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
168 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
169 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
170 |
MgtProbeResponseHeader::SetBeaconIntervalUs (uint64_t us) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
171 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
172 |
m_beaconInterval = us; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
173 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
174 |
void |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
175 |
MgtProbeResponseHeader::SetSupportedRates (SupportedRates rates) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
176 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
177 |
m_rates = rates; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
178 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
179 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
180 |
MgtProbeResponseHeader::GetTypeId (void) |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
181 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
182 |
static TypeId tid = TypeId ("ns3::MgtProbeResponseHeader") |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
183 |
.SetParent<Header> () |
2650
3de4cacb8981
make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2646
diff
changeset
|
184 |
.AddConstructor<MgtProbeResponseHeader> () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
185 |
; |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
186 |
return tid; |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
187 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
188 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
189 |
MgtProbeResponseHeader::GetInstanceTypeId (void) const |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
190 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
191 |
return GetTypeId (); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
192 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
193 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
194 |
MgtProbeResponseHeader::GetSerializedSize (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
195 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
196 |
uint32_t size = 0; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
197 |
size += 8; // timestamp |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
198 |
size += 2; // beacon interval |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
199 |
size += m_capability.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
200 |
size += m_ssid.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
201 |
size += m_rates.GetSerializedSize (); |
3655
878961da459c
do not reserve space for unwritten data to avoid memory initialization problems
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3636
diff
changeset
|
202 |
//size += 3; // ds parameter set |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
203 |
size += m_rates.extended.GetSerializedSize (); |
10139 | 204 |
size += m_htCapability.GetSerializedSize(); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
205 |
// xxx |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
206 |
return size; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
207 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
208 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
209 |
MgtProbeResponseHeader::Print (std::ostream &os) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
210 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
211 |
os << "ssid=" << m_ssid << ", " |
10139 | 212 |
<< "rates=" << m_rates << ", " |
213 |
<< "HT Capabilities=" << m_htCapability; |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
214 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
215 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
216 |
MgtProbeResponseHeader::Serialize (Buffer::Iterator start) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
217 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
218 |
// timestamp |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
219 |
// beacon interval |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
220 |
// capability information |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
221 |
// ssid |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
222 |
// supported rates |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
223 |
// fh parameter set |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
224 |
// ds parameter set |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
225 |
// cf parameter set |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
226 |
// ibss parameter set |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
227 |
//XXX |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
228 |
Buffer::Iterator i = start; |
6602
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
229 |
i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ()); |
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
230 |
i.WriteHtolsbU16 (m_beaconInterval / 1024); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
231 |
i = m_capability.Serialize (i); |
6389
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
232 |
i = m_ssid.Serialize (i); |
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
233 |
i = m_rates.Serialize (i); |
3655
878961da459c
do not reserve space for unwritten data to avoid memory initialization problems
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3636
diff
changeset
|
234 |
//i.WriteU8 (0, 3); // ds parameter set. |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
235 |
i = m_rates.extended.Serialize (i); |
10139 | 236 |
i = m_htCapability.Serialize(i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
237 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
238 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
239 |
MgtProbeResponseHeader::Deserialize (Buffer::Iterator start) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
240 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
241 |
Buffer::Iterator i = start; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
242 |
m_timestamp = i.ReadLsbtohU64 (); |
6602
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
243 |
m_beaconInterval = i.ReadLsbtohU16 (); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
244 |
m_beaconInterval *= 1024; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
245 |
i = m_capability.Deserialize (i); |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
246 |
i = m_ssid.Deserialize (i); |
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
247 |
i = m_rates.Deserialize (i); |
3655
878961da459c
do not reserve space for unwritten data to avoid memory initialization problems
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3636
diff
changeset
|
248 |
//i.Next (3); // ds parameter set |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
249 |
i = m_rates.extended.DeserializeIfPresent (i); |
10139 | 250 |
i = m_htCapability.DeserializeIfPresent (i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
251 |
return i.GetDistanceFrom (start); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
252 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
253 |
|
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
254 |
/*********************************************************** |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
255 |
* Assoc Request |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
256 |
***********************************************************/ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
257 |
|
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
258 |
NS_OBJECT_ENSURE_REGISTERED (MgtAssocRequestHeader); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
259 |
|
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
260 |
MgtAssocRequestHeader::MgtAssocRequestHeader () |
3662
eb4d8f900458
initialize sta listen interval
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3655
diff
changeset
|
261 |
: m_listenInterval (0) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
262 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
263 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
264 |
MgtAssocRequestHeader::~MgtAssocRequestHeader () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
265 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
266 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
267 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
268 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
269 |
MgtAssocRequestHeader::SetSsid (Ssid ssid) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
270 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
271 |
m_ssid = ssid; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
272 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
273 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
274 |
MgtAssocRequestHeader::SetSupportedRates (SupportedRates rates) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
275 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
276 |
m_rates = rates; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
277 |
} |
10139 | 278 |
void |
279 |
MgtAssocRequestHeader::SetHtCapabilities(HtCapabilities htcapabilities) |
|
280 |
{ |
|
281 |
m_htCapability = htcapabilities; |
|
282 |
} |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
283 |
void |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
284 |
MgtAssocRequestHeader::SetListenInterval (uint16_t interval) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
285 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
286 |
m_listenInterval = interval; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
287 |
} |
10139 | 288 |
HtCapabilities |
289 |
MgtAssocRequestHeader::GetHtCapabilities (void) const |
|
290 |
{ |
|
291 |
return m_htCapability; |
|
292 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
293 |
Ssid |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
294 |
MgtAssocRequestHeader::GetSsid (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
295 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
296 |
return m_ssid; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
297 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
298 |
SupportedRates |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
299 |
MgtAssocRequestHeader::GetSupportedRates (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
300 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
301 |
return m_rates; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
302 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
303 |
uint16_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
304 |
MgtAssocRequestHeader::GetListenInterval (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
305 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
306 |
return m_listenInterval; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
307 |
} |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
308 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
309 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
310 |
MgtAssocRequestHeader::GetTypeId (void) |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
311 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
312 |
static TypeId tid = TypeId ("ns3::MgtAssocRequestHeader") |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
313 |
.SetParent<Header> () |
2650
3de4cacb8981
make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2646
diff
changeset
|
314 |
.AddConstructor<MgtAssocRequestHeader> () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
315 |
; |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
316 |
return tid; |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
317 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
318 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
319 |
MgtAssocRequestHeader::GetInstanceTypeId (void) const |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
320 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
321 |
return GetTypeId (); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
322 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
323 |
uint32_t |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
324 |
MgtAssocRequestHeader::GetSerializedSize (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
325 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
326 |
uint32_t size = 0; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
327 |
size += m_capability.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
328 |
size += 2; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
329 |
size += m_ssid.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
330 |
size += m_rates.GetSerializedSize (); |
10139 | 331 |
size += m_htCapability.GetSerializedSize(); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
332 |
size += m_rates.extended.GetSerializedSize (); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
333 |
return size; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
334 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
335 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
336 |
MgtAssocRequestHeader::Print (std::ostream &os) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
337 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
338 |
os << "ssid=" << m_ssid << ", " |
10139 | 339 |
<< "rates=" << m_rates<< ", " |
340 |
<< "HT Capabilities=" << m_htCapability; |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
341 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
342 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
343 |
MgtAssocRequestHeader::Serialize (Buffer::Iterator start) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
344 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
345 |
Buffer::Iterator i = start; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
346 |
i = m_capability.Serialize (i); |
6602
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
347 |
i.WriteHtolsbU16 (m_listenInterval); |
6389
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
348 |
i = m_ssid.Serialize (i); |
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
349 |
i = m_rates.Serialize (i); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
350 |
i = m_rates.extended.Serialize (i); |
10139 | 351 |
i = m_htCapability.Serialize(i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
352 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
353 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
354 |
MgtAssocRequestHeader::Deserialize (Buffer::Iterator start) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
355 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
356 |
Buffer::Iterator i = start; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
357 |
i = m_capability.Deserialize (i); |
6602
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
358 |
m_listenInterval = i.ReadLsbtohU16 (); |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
359 |
i = m_ssid.Deserialize (i); |
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
360 |
i = m_rates.Deserialize (i); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
361 |
i = m_rates.extended.DeserializeIfPresent (i); |
10139 | 362 |
i = m_htCapability.DeserializeIfPresent (i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
363 |
return i.GetDistanceFrom (start); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
364 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
365 |
|
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
366 |
/*********************************************************** |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
367 |
* Assoc Response |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
368 |
***********************************************************/ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
369 |
|
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
370 |
NS_OBJECT_ENSURE_REGISTERED (MgtAssocResponseHeader); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
371 |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
372 |
MgtAssocResponseHeader::MgtAssocResponseHeader () |
3636
2aee7df86786
make sure aid is initialized
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2650
diff
changeset
|
373 |
: m_aid (0) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
374 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
375 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
376 |
MgtAssocResponseHeader::~MgtAssocResponseHeader () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
377 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
378 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
379 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
380 |
StatusCode |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
381 |
MgtAssocResponseHeader::GetStatusCode (void) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
382 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
383 |
return m_code; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
384 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
385 |
SupportedRates |
2007
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
386 |
MgtAssocResponseHeader::GetSupportedRates (void) |
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
387 |
{ |
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
388 |
return m_rates; |
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
389 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
390 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
391 |
MgtAssocResponseHeader::SetStatusCode (StatusCode code) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
392 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
393 |
m_code = code; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
394 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
395 |
void |
2007
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
396 |
MgtAssocResponseHeader::SetSupportedRates (SupportedRates rates) |
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
397 |
{ |
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
398 |
m_rates = rates; |
a5fefe9916a0
add support for set/get supported rates in assoc resp packets
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1978
diff
changeset
|
399 |
} |
10139 | 400 |
void |
401 |
MgtAssocResponseHeader::SetHtCapabilities(HtCapabilities htcapabilities) |
|
402 |
{ |
|
403 |
m_htCapability=htcapabilities; |
|
404 |
} |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
405 |
|
10139 | 406 |
HtCapabilities |
407 |
MgtAssocResponseHeader::GetHtCapabilities (void) const |
|
408 |
{ |
|
409 |
return m_htCapability; |
|
410 |
} |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
411 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
412 |
MgtAssocResponseHeader::GetTypeId (void) |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
413 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
414 |
static TypeId tid = TypeId ("ns3::MgtAssocResponseHeader") |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
415 |
.SetParent<Header> () |
2650
3de4cacb8981
make sure all headers and trailers gets a constructor registered in their TypeId.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2646
diff
changeset
|
416 |
.AddConstructor<MgtAssocResponseHeader> () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
417 |
; |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
418 |
return tid; |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
419 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
420 |
TypeId |
2643
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
421 |
MgtAssocResponseHeader::GetInstanceTypeId (void) const |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
422 |
{ |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
423 |
return GetTypeId (); |
2a3324f4dabe
define a TypeId for each Header/Trailer.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2016
diff
changeset
|
424 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
425 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
426 |
MgtAssocResponseHeader::GetSerializedSize (void) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
427 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
428 |
uint32_t size = 0; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
429 |
size += m_capability.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
430 |
size += m_code.GetSerializedSize (); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
431 |
size += 2; // aid |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
432 |
size += m_rates.GetSerializedSize (); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
433 |
size += m_rates.extended.GetSerializedSize (); |
10139 | 434 |
size += m_htCapability.GetSerializedSize(); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
435 |
return size; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
436 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
437 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
438 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
439 |
MgtAssocResponseHeader::Print (std::ostream &os) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
440 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
441 |
os << "status code=" << m_code << ", " |
10139 | 442 |
<< "rates=" << m_rates << ", " |
443 |
<< "HT Capabilities=" << m_htCapability; |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
444 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
445 |
void |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
446 |
MgtAssocResponseHeader::Serialize (Buffer::Iterator start) const |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
447 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
448 |
Buffer::Iterator i = start; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
449 |
i = m_capability.Serialize (i); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
450 |
i = m_code.Serialize (i); |
6602
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
451 |
i.WriteHtolsbU16 (m_aid); |
6389
6e83ec53ba0a
Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents:
6382
diff
changeset
|
452 |
i = m_rates.Serialize (i); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
453 |
i = m_rates.extended.Serialize (i); |
10139 | 454 |
i = m_htCapability.Serialize(i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
455 |
} |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
456 |
uint32_t |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
457 |
MgtAssocResponseHeader::Deserialize (Buffer::Iterator start) |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
458 |
{ |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
459 |
Buffer::Iterator i = start; |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
460 |
i = m_capability.Deserialize (i); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
461 |
i = m_code.Deserialize (i); |
6602
0aae670ceff3
Bug 979: Use LSB ordering for multi-octet fields in wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
6596
diff
changeset
|
462 |
m_aid = i.ReadLsbtohU16 (); |
6382
9e5768e48981
Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents:
6381
diff
changeset
|
463 |
i = m_rates.Deserialize (i); |
6596
6c562767d7b5
Bug 852: Implement IEEE 802.11 Extended Supported Rates information element
Dean Armstrong <deanarm@gmail.com>
parents:
6389
diff
changeset
|
464 |
i = m_rates.extended.DeserializeIfPresent (i); |
10139 | 465 |
i = m_htCapability.DeserializeIfPresent (i); |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
466 |
return i.GetDistanceFrom (start); |
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
467 |
} |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
468 |
/********************************************************** |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
469 |
* ActionFrame |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
470 |
**********************************************************/ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
471 |
WifiActionHeader::WifiActionHeader () |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
472 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
473 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
474 |
WifiActionHeader::~WifiActionHeader () |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
475 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
476 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
477 |
void |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
478 |
WifiActionHeader::SetAction (WifiActionHeader::CategoryValue type, |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
479 |
WifiActionHeader::ActionValue action) |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
480 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
481 |
m_category = type; |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
482 |
|
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
483 |
switch (type) |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
484 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
485 |
case BLOCK_ACK: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
486 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
487 |
m_actionValue = action.blockAck; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
488 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
489 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
490 |
case MESH_PEERING_MGT: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
491 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
492 |
m_actionValue = action.peerLink; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
493 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
494 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
495 |
case MESH_PATH_SELECTION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
496 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
497 |
m_actionValue = action.pathSelection; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
498 |
break; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
499 |
} |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
500 |
case MESH_LINK_METRIC: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
501 |
case MESH_INTERWORKING: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
502 |
case MESH_RESOURCE_COORDINATION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
503 |
case MESH_PROXY_FORWARDING: |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
504 |
break; |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
505 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
506 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
507 |
WifiActionHeader::CategoryValue |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
508 |
WifiActionHeader::GetCategory () |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
509 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
510 |
switch (m_category) |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
511 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
512 |
case BLOCK_ACK: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
513 |
return BLOCK_ACK; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
514 |
case MESH_PEERING_MGT: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
515 |
return MESH_PEERING_MGT; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
516 |
case MESH_LINK_METRIC: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
517 |
return MESH_LINK_METRIC; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
518 |
case MESH_PATH_SELECTION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
519 |
return MESH_PATH_SELECTION; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
520 |
case MESH_INTERWORKING: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
521 |
return MESH_INTERWORKING; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
522 |
case MESH_RESOURCE_COORDINATION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
523 |
return MESH_RESOURCE_COORDINATION; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
524 |
case MESH_PROXY_FORWARDING: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
525 |
return MESH_PROXY_FORWARDING; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
526 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
527 |
NS_FATAL_ERROR ("Unknown action value"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
528 |
return MESH_PEERING_MGT; |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
529 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
530 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
531 |
WifiActionHeader::ActionValue |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
532 |
WifiActionHeader::GetAction () |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
533 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
534 |
ActionValue retval; |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
535 |
retval.peerLink = PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
536 |
switch (m_category) |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
537 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
538 |
case BLOCK_ACK: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
539 |
switch (m_actionValue) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
540 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
541 |
case BLOCK_ACK_ADDBA_REQUEST: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
542 |
retval.blockAck = BLOCK_ACK_ADDBA_REQUEST; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
543 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
544 |
case BLOCK_ACK_ADDBA_RESPONSE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
545 |
retval.blockAck = BLOCK_ACK_ADDBA_RESPONSE; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
546 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
547 |
case BLOCK_ACK_DELBA: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
548 |
retval.blockAck = BLOCK_ACK_DELBA; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
549 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
550 |
} |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
551 |
break ; |
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
552 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
553 |
case MESH_PEERING_MGT: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
554 |
switch (m_actionValue) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
555 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
556 |
case PEER_LINK_OPEN: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
557 |
retval.peerLink = PEER_LINK_OPEN; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
558 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
559 |
case PEER_LINK_CONFIRM: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
560 |
retval.peerLink = PEER_LINK_CONFIRM; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
561 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
562 |
case PEER_LINK_CLOSE: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
563 |
retval.peerLink = PEER_LINK_CLOSE; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
564 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
565 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
566 |
NS_FATAL_ERROR ("Unknown mesh peering management action code"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
567 |
retval.peerLink = PEER_LINK_OPEN; /* quiet compiler */ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
568 |
} |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
569 |
break ; |
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
570 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
571 |
case MESH_PATH_SELECTION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
572 |
switch (m_actionValue) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
573 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
574 |
case PATH_SELECTION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
575 |
retval.pathSelection = PATH_SELECTION; |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
576 |
break ; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
577 |
default: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
578 |
NS_FATAL_ERROR ("Unknown mesh path selection action code"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
579 |
retval.peerLink = PEER_LINK_OPEN; /* quiet compiler */ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
580 |
} |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
581 |
break ; |
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
582 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
583 |
case MESH_LINK_METRIC: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
584 |
// not yet supported |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
585 |
case MESH_INTERWORKING: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
586 |
// not yet supported |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
587 |
case MESH_RESOURCE_COORDINATION: |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
588 |
// not yet supported |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
589 |
default: |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
590 |
NS_FATAL_ERROR ("Unsupported mesh action"); |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
591 |
retval.peerLink = PEER_LINK_OPEN; /* quiet compiler */ |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
592 |
} |
9783
828a38d9c799
[Coverity] Missing break in switch (MISSING_BREAK)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7385
diff
changeset
|
593 |
return retval; |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
594 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
595 |
TypeId |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
596 |
WifiActionHeader::GetTypeId () |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
597 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
598 |
static TypeId tid = TypeId ("ns3::WifiActionHeader") |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
599 |
.SetParent<Header> () |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
600 |
.AddConstructor<WifiActionHeader> (); |
5824
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
601 |
return tid; |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
602 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
603 |
TypeId |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
604 |
WifiActionHeader::GetInstanceTypeId () const |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
605 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
606 |
return GetTypeId (); |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
607 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
608 |
void |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
609 |
WifiActionHeader::Print (std::ostream &os) const |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
610 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
611 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
612 |
uint32_t |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
613 |
WifiActionHeader::GetSerializedSize () const |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
614 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
615 |
return 2; |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
616 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
617 |
void |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
618 |
WifiActionHeader::Serialize (Buffer::Iterator start) const |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
619 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
620 |
start.WriteU8 (m_category); |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
621 |
start.WriteU8 (m_actionValue); |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
622 |
} |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
623 |
uint32_t |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
624 |
WifiActionHeader::Deserialize (Buffer::Iterator start) |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
625 |
{ |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
626 |
Buffer::Iterator i = start; |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
627 |
m_category = i.ReadU8 (); |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
628 |
m_actionValue = i.ReadU8 (); |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
629 |
return i.GetDistanceFrom (start); |
5abf274b52d4
Mesh: action header moved from dot11s namespace and placed to
Kirill Andreev <andreev@iitp.ru>
parents:
5133
diff
changeset
|
630 |
} |
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
631 |
|
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
632 |
/*************************************************** |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
633 |
* ADDBARequest |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
634 |
****************************************************/ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
635 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
636 |
NS_OBJECT_ENSURE_REGISTERED (MgtAddBaRequestHeader); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
637 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
638 |
MgtAddBaRequestHeader::MgtAddBaRequestHeader () |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
639 |
: m_dialogToken (1), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
640 |
m_amsduSupport (1), |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
641 |
m_bufferSize (0) |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
642 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
643 |
} |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
644 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
645 |
TypeId |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
646 |
MgtAddBaRequestHeader::GetTypeId (void) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
647 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
648 |
static TypeId tid = TypeId ("ns3::MgtAddBaRequestHeader") |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
649 |
.SetParent<Header> () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
650 |
.AddConstructor<MgtAddBaRequestHeader> (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
651 |
return tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
652 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
653 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
654 |
TypeId |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
655 |
MgtAddBaRequestHeader::GetInstanceTypeId (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
656 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
657 |
return GetTypeId (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
658 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
659 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
660 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
661 |
MgtAddBaRequestHeader::Print (std::ostream &os) const |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
662 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
663 |
} |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
664 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
665 |
uint32_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
666 |
MgtAddBaRequestHeader::GetSerializedSize (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
667 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
668 |
uint32_t size = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
669 |
size += 1; //Dialog token |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
670 |
size += 2; //Block ack parameter set |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
671 |
size += 2; //Block ack timeout value |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
672 |
size += 2; //Starting sequence control |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
673 |
return size; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
674 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
675 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
676 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
677 |
MgtAddBaRequestHeader::Serialize (Buffer::Iterator start) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
678 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
679 |
Buffer::Iterator i = start; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
680 |
i.WriteU8 (m_dialogToken); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
681 |
i.WriteHtolsbU16 (GetParameterSet ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
682 |
i.WriteHtolsbU16 (m_timeoutValue); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
683 |
i.WriteHtolsbU16 (GetStartingSequenceControl ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
684 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
685 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
686 |
uint32_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
687 |
MgtAddBaRequestHeader::Deserialize (Buffer::Iterator start) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
688 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
689 |
Buffer::Iterator i = start; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
690 |
m_dialogToken = i.ReadU8 (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
691 |
SetParameterSet (i.ReadLsbtohU16 ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
692 |
m_timeoutValue = i.ReadLsbtohU16 (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
693 |
SetStartingSequenceControl (i.ReadLsbtohU16 ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
694 |
return i.GetDistanceFrom (start); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
695 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
696 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
697 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
698 |
MgtAddBaRequestHeader::SetDelayedBlockAck () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
699 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
700 |
m_policy = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
701 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
702 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
703 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
704 |
MgtAddBaRequestHeader::SetImmediateBlockAck () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
705 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
706 |
m_policy = 1; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
707 |
} |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
708 |
|
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
709 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
710 |
MgtAddBaRequestHeader::SetTid (uint8_t tid) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
711 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
712 |
NS_ASSERT (tid < 16); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
713 |
m_tid = tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
714 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
715 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
716 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
717 |
MgtAddBaRequestHeader::SetTimeout (uint16_t timeout) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
718 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
719 |
m_timeoutValue = timeout; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
720 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
721 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
722 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
723 |
MgtAddBaRequestHeader::SetBufferSize (uint16_t size) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
724 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
725 |
m_bufferSize = size; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
726 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
727 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
728 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
729 |
MgtAddBaRequestHeader::SetStartingSequence (uint16_t seq) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
730 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
731 |
m_startingSeq = seq; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
732 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
733 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
734 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
735 |
MgtAddBaRequestHeader::SetAmsduSupport (bool supported) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
736 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
737 |
m_amsduSupport = supported; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
738 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
739 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
740 |
uint8_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
741 |
MgtAddBaRequestHeader::GetTid (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
742 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
743 |
return m_tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
744 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
745 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
746 |
bool |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
747 |
MgtAddBaRequestHeader::IsImmediateBlockAck (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
748 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
749 |
return (m_policy == 1) ? true : false; |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
750 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
751 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
752 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
753 |
MgtAddBaRequestHeader::GetTimeout (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
754 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
755 |
return m_timeoutValue; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
756 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
757 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
758 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
759 |
MgtAddBaRequestHeader::GetBufferSize (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
760 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
761 |
return m_bufferSize; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
762 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
763 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
764 |
bool |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
765 |
MgtAddBaRequestHeader::IsAmsduSupported (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
766 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
767 |
return (m_amsduSupport == 1) ? true : false; |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
768 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
769 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
770 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
771 |
MgtAddBaRequestHeader::GetStartingSequence (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
772 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
773 |
return m_startingSeq; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
774 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
775 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
776 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
777 |
MgtAddBaRequestHeader::GetStartingSequenceControl (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
778 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
779 |
return (m_startingSeq << 4) & 0xfff0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
780 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
781 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
782 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
783 |
MgtAddBaRequestHeader::SetStartingSequenceControl (uint16_t seqControl) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
784 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
785 |
m_startingSeq = (seqControl >> 4) & 0x0fff; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
786 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
787 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
788 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
789 |
MgtAddBaRequestHeader::GetParameterSet (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
790 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
791 |
uint16_t res = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
792 |
res |= m_amsduSupport; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
793 |
res |= m_policy << 1; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
794 |
res |= m_tid << 2; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
795 |
res |= m_bufferSize << 6; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
796 |
return res; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
797 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
798 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
799 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
800 |
MgtAddBaRequestHeader::SetParameterSet (uint16_t params) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
801 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
802 |
m_amsduSupport = (params) & 0x01; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
803 |
m_policy = (params >> 1) & 0x01; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
804 |
m_tid = (params >> 2) & 0x0f; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
805 |
m_bufferSize = (params >> 6) & 0x03ff; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
806 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
807 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
808 |
/*************************************************** |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
809 |
* ADDBAResponse |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
810 |
****************************************************/ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
811 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
812 |
NS_OBJECT_ENSURE_REGISTERED (MgtAddBaResponseHeader); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
813 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
814 |
MgtAddBaResponseHeader::MgtAddBaResponseHeader () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
815 |
: m_dialogToken (1), |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
816 |
m_amsduSupport (1), |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
817 |
m_bufferSize (0) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
818 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
819 |
} |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
820 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
821 |
TypeId |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
822 |
MgtAddBaResponseHeader::GetTypeId () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
823 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
824 |
static TypeId tid = TypeId ("ns3::MgtAddBaResponseHeader") |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
825 |
.SetParent<Header> () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
826 |
.AddConstructor<MgtAddBaResponseHeader> () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
827 |
; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
828 |
return tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
829 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
830 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
831 |
TypeId |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
832 |
MgtAddBaResponseHeader::GetInstanceTypeId (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
833 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
834 |
return GetTypeId (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
835 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
836 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
837 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
838 |
MgtAddBaResponseHeader::Print (std::ostream &os) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
839 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
840 |
os << "status code=" << m_code; |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
841 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
842 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
843 |
uint32_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
844 |
MgtAddBaResponseHeader::GetSerializedSize (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
845 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
846 |
uint32_t size = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
847 |
size += 1; //Dialog token |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
848 |
size += m_code.GetSerializedSize (); //Status code |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
849 |
size += 2; //Block ack parameter set |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
850 |
size += 2; //Block ack timeout value |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
851 |
return size; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
852 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
853 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
854 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
855 |
MgtAddBaResponseHeader::Serialize (Buffer::Iterator start) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
856 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
857 |
Buffer::Iterator i = start; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
858 |
i.WriteU8 (m_dialogToken); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
859 |
i = m_code.Serialize (i); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
860 |
i.WriteHtolsbU16 (GetParameterSet ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
861 |
i.WriteHtolsbU16 (m_timeoutValue); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
862 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
863 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
864 |
uint32_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
865 |
MgtAddBaResponseHeader::Deserialize (Buffer::Iterator start) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
866 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
867 |
Buffer::Iterator i = start; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
868 |
m_dialogToken = i.ReadU8 (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
869 |
i = m_code.Deserialize (i); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
870 |
SetParameterSet (i.ReadLsbtohU16 ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
871 |
m_timeoutValue = i.ReadLsbtohU16 (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
872 |
return i.GetDistanceFrom (start); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
873 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
874 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
875 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
876 |
MgtAddBaResponseHeader::SetDelayedBlockAck () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
877 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
878 |
m_policy = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
879 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
880 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
881 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
882 |
MgtAddBaResponseHeader::SetImmediateBlockAck () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
883 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
884 |
m_policy = 1; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
885 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
886 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
887 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
888 |
MgtAddBaResponseHeader::SetTid (uint8_t tid) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
889 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
890 |
NS_ASSERT (tid < 16); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
891 |
m_tid = tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
892 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
893 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
894 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
895 |
MgtAddBaResponseHeader::SetTimeout (uint16_t timeout) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
896 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
897 |
m_timeoutValue = timeout; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
898 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
899 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
900 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
901 |
MgtAddBaResponseHeader::SetBufferSize (uint16_t size) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
902 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
903 |
m_bufferSize = size; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
904 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
905 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
906 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
907 |
MgtAddBaResponseHeader::SetStatusCode (StatusCode code) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
908 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
909 |
m_code = code; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
910 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
911 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
912 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
913 |
MgtAddBaResponseHeader::SetAmsduSupport (bool supported) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
914 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
915 |
m_amsduSupport = supported; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
916 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
917 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
918 |
StatusCode |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
919 |
MgtAddBaResponseHeader::GetStatusCode (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
920 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
921 |
return m_code; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
922 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
923 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
924 |
uint8_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
925 |
MgtAddBaResponseHeader::GetTid (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
926 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
927 |
return m_tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
928 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
929 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
930 |
bool |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
931 |
MgtAddBaResponseHeader::IsImmediateBlockAck (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
932 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
933 |
return (m_policy == 1) ? true : false; |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
934 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
935 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
936 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
937 |
MgtAddBaResponseHeader::GetTimeout (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
938 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
939 |
return m_timeoutValue; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
940 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
941 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
942 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
943 |
MgtAddBaResponseHeader::GetBufferSize (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
944 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
945 |
return m_bufferSize; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
946 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
947 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
948 |
bool |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
949 |
MgtAddBaResponseHeader::IsAmsduSupported (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
950 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
951 |
return (m_amsduSupport == 1) ? true : false; |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
952 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
953 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
954 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
955 |
MgtAddBaResponseHeader::GetParameterSet (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
956 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
957 |
uint16_t res = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
958 |
res |= m_amsduSupport; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
959 |
res |= m_policy << 1; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
960 |
res |= m_tid << 2; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
961 |
res |= m_bufferSize << 6; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
962 |
return res; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
963 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
964 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
965 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
966 |
MgtAddBaResponseHeader::SetParameterSet (uint16_t params) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
967 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
968 |
m_amsduSupport = (params) & 0x01; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
969 |
m_policy = (params >> 1) & 0x01; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
970 |
m_tid = (params >> 2) & 0x0f; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
971 |
m_bufferSize = (params >> 6) & 0x03ff; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
972 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
973 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
974 |
/*************************************************** |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
975 |
* DelBa |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
976 |
****************************************************/ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
977 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
978 |
NS_OBJECT_ENSURE_REGISTERED (MgtDelBaHeader); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
979 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
980 |
MgtDelBaHeader::MgtDelBaHeader () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
981 |
: m_reasonCode (1) |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
982 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
983 |
} |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
984 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
985 |
TypeId |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
986 |
MgtDelBaHeader::GetTypeId (void) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
987 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
988 |
static TypeId tid = TypeId ("ns3::MgtDelBaHeader") |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
989 |
.SetParent<Header> () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
990 |
.AddConstructor<MgtDelBaHeader> () |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
991 |
; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
992 |
return tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
993 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
994 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
995 |
TypeId |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
996 |
MgtDelBaHeader::GetInstanceTypeId (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
997 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
998 |
return GetTypeId (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
999 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1000 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1001 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1002 |
MgtDelBaHeader::Print (std::ostream &os) const |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1003 |
{ |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1004 |
} |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1005 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1006 |
uint32_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1007 |
MgtDelBaHeader::GetSerializedSize (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1008 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1009 |
uint32_t size = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1010 |
size += 2; //DelBa parameter set |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1011 |
size += 2; //Reason code |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1012 |
return size; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1013 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1014 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1015 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1016 |
MgtDelBaHeader::Serialize (Buffer::Iterator start) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1017 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1018 |
Buffer::Iterator i = start; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1019 |
i.WriteHtolsbU16 (GetParameterSet ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1020 |
i.WriteHtolsbU16 (m_reasonCode); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1021 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1022 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1023 |
uint32_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1024 |
MgtDelBaHeader::Deserialize (Buffer::Iterator start) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1025 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1026 |
Buffer::Iterator i = start; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1027 |
SetParameterSet (i.ReadLsbtohU16 ()); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1028 |
m_reasonCode = i.ReadLsbtohU16 (); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1029 |
return i.GetDistanceFrom (start); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1030 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1031 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1032 |
bool |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1033 |
MgtDelBaHeader::IsByOriginator (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1034 |
{ |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
1035 |
return (m_initiator == 1) ? true : false; |
5949
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1036 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1037 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1038 |
uint8_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1039 |
MgtDelBaHeader::GetTid (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1040 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1041 |
NS_ASSERT (m_tid < 16); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1042 |
uint8_t tid = static_cast<uint8_t> (m_tid); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1043 |
return tid; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1044 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1045 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1046 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1047 |
MgtDelBaHeader::SetByOriginator (void) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1048 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1049 |
m_initiator = 1; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1050 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1051 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1052 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1053 |
MgtDelBaHeader::SetByRecipient (void) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1054 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1055 |
m_initiator = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1056 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1057 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1058 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1059 |
MgtDelBaHeader::SetTid (uint8_t tid) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1060 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1061 |
NS_ASSERT (tid < 16); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1062 |
m_tid = static_cast<uint16_t> (tid); |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1063 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1064 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1065 |
uint16_t |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1066 |
MgtDelBaHeader::GetParameterSet (void) const |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1067 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1068 |
uint16_t res = 0; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1069 |
res |= m_initiator << 11; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1070 |
res |= m_tid << 12; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1071 |
return res; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1072 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1073 |
|
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1074 |
void |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1075 |
MgtDelBaHeader::SetParameterSet (uint16_t params) |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1076 |
{ |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1077 |
m_initiator = (params >> 11) & 0x01; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1078 |
m_tid = (params >> 12) & 0x0f; |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1079 |
} |
66f939e7aaec
add action frames needed by block ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
5824
diff
changeset
|
1080 |
|
1939
40af0232df83
add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1081 |
} // namespace ns3 |