Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006, 2009 INRIA | 3 * Copyright (c) 2006, 2009 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 if (resetToDsFromDs) | 262 if (resetToDsFromDs) |
263 { | 263 { |
264 m_ctrlToDs = 0; | 264 m_ctrlToDs = 0; |
265 m_ctrlFromDs = 0; | 265 m_ctrlFromDs = 0; |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 void | 269 void |
270 WifiMacHeader::SetRawDuration (uint16_t duration) | 270 WifiMacHeader::SetRawDuration (uint16_t duration) |
271 { | 271 { |
272 m_duration = duration; | 272 m_duration = duration; |
Rediet
2018/03/29 16:40:22
A verification on the max duration could be useful
S. Deronne
2018/03/30 08:58:43
This is implicit by the uint16_t boundary.
Do you
Rediet
2018/04/03 07:24:01
I thought that the value was set to 32 768 during
S. Deronne
2018/04/11 20:00:30
Correct, so you want to check here that raw durati
Rediet
2018/04/12 07:32:03
I think it would be better (just like what's done
| |
273 } | 273 } |
274 | 274 |
275 void | 275 void |
276 WifiMacHeader::SetDuration (Time duration) | 276 WifiMacHeader::SetDuration (Time duration) |
277 { | 277 { |
278 int64_t duration_us = ceil (static_cast<double> (duration.GetNanoSeconds ()) / 1000); | 278 int64_t duration_us = ceil (static_cast<double> (duration.GetNanoSeconds ()) / 1000); |
279 NS_ASSERT (duration_us >= 0 && duration_us <= 0x7fff); | 279 NS_ASSERT (duration_us >= 0 && duration_us <= 0x7fff); |
280 m_duration = static_cast<uint16_t> (duration_us); | 280 m_duration = static_cast<uint16_t> (duration_us); |
281 } | 281 } |
282 | 282 |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
793 return (m_amsduPresent == 1); | 793 return (m_amsduPresent == 1); |
794 } | 794 } |
795 | 795 |
796 uint8_t | 796 uint8_t |
797 WifiMacHeader::GetQosTid (void) const | 797 WifiMacHeader::GetQosTid (void) const |
798 { | 798 { |
799 NS_ASSERT (IsQosData ()); | 799 NS_ASSERT (IsQosData ()); |
800 return m_qosTid; | 800 return m_qosTid; |
801 } | 801 } |
802 | 802 |
803 uint8_t | |
804 WifiMacHeader::GetQosTxopLimit (void) const | |
805 { | |
806 NS_ASSERT (IsQosData ()); | |
807 return m_qosStuff; | |
808 } | |
809 | |
810 uint16_t | 803 uint16_t |
811 WifiMacHeader::GetFrameControl (void) const | 804 WifiMacHeader::GetFrameControl (void) const |
812 { | 805 { |
813 uint16_t val = 0; | 806 uint16_t val = 0; |
814 val |= (m_ctrlType << 2) & (0x3 << 2); | 807 val |= (m_ctrlType << 2) & (0x3 << 2); |
815 val |= (m_ctrlSubtype << 4) & (0xf << 4); | 808 val |= (m_ctrlSubtype << 4) & (0xf << 4); |
816 val |= (m_ctrlToDs << 8) & (0x1 << 8); | 809 val |= (m_ctrlToDs << 8) & (0x1 << 8); |
817 val |= (m_ctrlFromDs << 9) & (0x1 << 9); | 810 val |= (m_ctrlFromDs << 9) & (0x1 << 9); |
818 val |= (m_ctrlMoreFrag << 10) & (0x1 << 10); | 811 val |= (m_ctrlMoreFrag << 10) & (0x1 << 10); |
819 val |= (m_ctrlRetry << 11) & (0x1 << 11); | 812 val |= (m_ctrlRetry << 11) & (0x1 << 11); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1181 if (m_ctrlSubtype & 0x08) | 1174 if (m_ctrlSubtype & 0x08) |
1182 { | 1175 { |
1183 SetQosControl (i.ReadLsbtohU16 ()); | 1176 SetQosControl (i.ReadLsbtohU16 ()); |
1184 } | 1177 } |
1185 break; | 1178 break; |
1186 } | 1179 } |
1187 return i.GetDistanceFrom (start); | 1180 return i.GetDistanceFrom (start); |
1188 } | 1181 } |
1189 | 1182 |
1190 } //namespace ns3 | 1183 } //namespace ns3 |
LEFT | RIGHT |