author | Sébastien Deronne <sebastien.deronne@gmail.com> |
Sat, 08 Dec 2018 16:56:04 +0100 | |
changeset 13893 | 83b0217cbb13 |
parent 13892 | 53fa9b4b8c09 |
permissions | -rw-r--r-- |
2833
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
2 |
/* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
4406 | 4 |
* Copyright (c) 2009 MIRKO BANCHI |
2833
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
5 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
6 |
* This program is free software; you can redistribute it and/or modify |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
7 |
* it under the terms of the GNU General Public License version 2 as |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
8 |
* published by the Free Software Foundation; |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
9 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
13 |
* GNU General Public License for more details. |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
14 |
* |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
16 |
* along with this program; if not, write to the Free Software |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
18 |
* |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
19 |
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
20 |
* Mirko Banchi <mk.banchi@gmail.com> |
2833
f3474fd850b2
add missing license headers
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2822
diff
changeset
|
21 |
*/ |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
22 |
|
2603
1308da4cb3bf
move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2602
diff
changeset
|
23 |
#include "ns3/wifi-net-device.h" |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
24 |
#include "ns3/minstrel-wifi-manager.h" |
13270
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
25 |
#include "ns3/minstrel-ht-wifi-manager.h" |
10206
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
26 |
#include "ns3/ap-wifi-mac.h" |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
27 |
#include "ns3/ampdu-subframe-header.h" |
13486
322626b344d3
wifi: Use forward declaration as often as possible (part 10)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
28 |
#include "ns3/mobility-model.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
#include "ns3/log.h" |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
30 |
#include "ns3/pointer.h" |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
31 |
#include "ns3/radiotap-header.h" |
2791
a2ab6517516e
basic pcap output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2656
diff
changeset
|
32 |
#include "ns3/config.h" |
4147
5d8530130930
rename object-names.{cc,h} to names.{cc,h} per convention
Craig Dowell <craigdo@ee.washington.edu>
parents:
4140
diff
changeset
|
33 |
#include "ns3/names.h" |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
34 |
#include "ns3/net-device-queue-interface.h" |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
35 |
#include "ns3/wifi-mac-queue.h" |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
36 |
#include "ns3/qos-utils.h" |
13834
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
37 |
#include "ns3/ht-configuration.h" |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
38 |
#include "ns3/vht-configuration.h" |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
39 |
#include "ns3/he-configuration.h" |
13486
322626b344d3
wifi: Use forward declaration as often as possible (part 10)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13431
diff
changeset
|
40 |
#include "wifi-helper.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10466
diff
changeset
|
42 |
namespace ns3 { |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10466
diff
changeset
|
44 |
NS_LOG_COMPONENT_DEFINE ("WifiHelper"); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
|
12688
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
46 |
/** |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
47 |
* ASCII trace Phy transmit sink with context |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
48 |
* \param stream the output stream |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
49 |
* \param context the context name |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
50 |
* \param p the packet |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
51 |
* \param mode the wifi mode |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
52 |
* \param preamble the wifi preamble |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
53 |
* \param txLevel the transmit power level |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
54 |
*/ |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
55 |
static void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
56 |
AsciiPhyTransmitSinkWithContext ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
57 |
Ptr<OutputStreamWrapper> stream, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
58 |
std::string context, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
59 |
Ptr<const Packet> p, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
60 |
WifiMode mode, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
61 |
WifiPreamble preamble, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
62 |
uint8_t txLevel) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
63 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
64 |
NS_LOG_FUNCTION (stream << context << p << mode << preamble << txLevel); |
13424
baacb98eee20
wifi: Add WifiMode to ascii traces
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13354
diff
changeset
|
65 |
*stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << context << " " << mode << " " << *p << std::endl; |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
66 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
67 |
|
12688
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
68 |
/** |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
69 |
* ASCII trace Phy transmit sink without context |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
70 |
* \param stream the output stream |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
71 |
* \param p the packet |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
72 |
* \param mode the wifi mode |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
73 |
* \param preamble the wifi preamble |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
74 |
* \param txLevel the transmit power level |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
75 |
*/ |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
76 |
static void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
77 |
AsciiPhyTransmitSinkWithoutContext ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
78 |
Ptr<OutputStreamWrapper> stream, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
79 |
Ptr<const Packet> p, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
80 |
WifiMode mode, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
81 |
WifiPreamble preamble, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
82 |
uint8_t txLevel) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
83 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
84 |
NS_LOG_FUNCTION (stream << p << mode << preamble << txLevel); |
13424
baacb98eee20
wifi: Add WifiMode to ascii traces
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13354
diff
changeset
|
85 |
*stream->GetStream () << "t " << Simulator::Now ().GetSeconds () << " " << mode << " " << *p << std::endl; |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
86 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
87 |
|
12688
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
88 |
/** |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
89 |
* ASCII trace Phy receive sink with context |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
90 |
* \param stream the output stream |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
91 |
* \param context the context name |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
92 |
* \param p the packet |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
93 |
* \param snr the SNR |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
94 |
* \param mode the wifi mode |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
95 |
* \param preamble the wifi preamble |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
96 |
*/ |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
97 |
static void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
98 |
AsciiPhyReceiveSinkWithContext ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
99 |
Ptr<OutputStreamWrapper> stream, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
100 |
std::string context, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
101 |
Ptr<const Packet> p, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
102 |
double snr, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
103 |
WifiMode mode, |
13288
a9cc7aa1f6ac
wifi: Cleanup enums
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13270
diff
changeset
|
104 |
WifiPreamble preamble) |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
105 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
106 |
NS_LOG_FUNCTION (stream << context << p << snr << mode << preamble); |
13424
baacb98eee20
wifi: Add WifiMode to ascii traces
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13354
diff
changeset
|
107 |
*stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << mode << "" << context << " " << *p << std::endl; |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
108 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
109 |
|
12688
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
110 |
/** |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
111 |
* ASCII trace Phy receive sink without context |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
112 |
* \param stream the output stream |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
113 |
* \param p the packet |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
114 |
* \param snr the SNR |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
115 |
* \param mode the wifi mode |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
116 |
* \param preamble the wifi preamble |
39ace9129965
wifi: Doxygen updates for helper files (thanks to Robert Ammon)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12583
diff
changeset
|
117 |
*/ |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
118 |
static void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
119 |
AsciiPhyReceiveSinkWithoutContext ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
120 |
Ptr<OutputStreamWrapper> stream, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
121 |
Ptr<const Packet> p, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
122 |
double snr, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
123 |
WifiMode mode, |
13288
a9cc7aa1f6ac
wifi: Cleanup enums
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13270
diff
changeset
|
124 |
WifiPreamble preamble) |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
125 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
126 |
NS_LOG_FUNCTION (stream << p << snr << mode << preamble); |
13424
baacb98eee20
wifi: Add WifiMode to ascii traces
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13354
diff
changeset
|
127 |
*stream->GetStream () << "r " << Simulator::Now ().GetSeconds () << " " << mode << " " << *p << std::endl; |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
128 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
129 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
130 |
WifiPhyHelper::WifiPhyHelper () |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
131 |
: m_pcapDlt (PcapHelper::DLT_IEEE802_11) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
132 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
133 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
134 |
|
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3909
diff
changeset
|
135 |
WifiPhyHelper::~WifiPhyHelper () |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
136 |
{ |
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
137 |
} |
2791
a2ab6517516e
basic pcap output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2656
diff
changeset
|
138 |
|
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
139 |
void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
140 |
WifiPhyHelper::Set (std::string name, const AttributeValue &v) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
141 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
142 |
m_phy.Set (name, v); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
143 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
144 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
145 |
void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
146 |
WifiPhyHelper::SetErrorRateModel (std::string name, |
12583
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
147 |
std::string n0, const AttributeValue &v0, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
148 |
std::string n1, const AttributeValue &v1, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
149 |
std::string n2, const AttributeValue &v2, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
150 |
std::string n3, const AttributeValue &v3, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
151 |
std::string n4, const AttributeValue &v4, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
152 |
std::string n5, const AttributeValue &v5, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
153 |
std::string n6, const AttributeValue &v6, |
40a9ab9779c6
wifi: Add initial support for 802.11ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12501
diff
changeset
|
154 |
std::string n7, const AttributeValue &v7) |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
155 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
156 |
m_errorRateModel = ObjectFactory (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
157 |
m_errorRateModel.SetTypeId (name); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
158 |
m_errorRateModel.Set (n0, v0); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
159 |
m_errorRateModel.Set (n1, v1); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
160 |
m_errorRateModel.Set (n2, v2); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
161 |
m_errorRateModel.Set (n3, v3); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
162 |
m_errorRateModel.Set (n4, v4); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
163 |
m_errorRateModel.Set (n5, v5); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
164 |
m_errorRateModel.Set (n6, v6); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
165 |
m_errorRateModel.Set (n7, v7); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
166 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
167 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
168 |
void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
169 |
WifiPhyHelper::PcapSniffTxEvent ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
170 |
Ptr<PcapFileWrapper> file, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
171 |
Ptr<const Packet> packet, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
172 |
uint16_t channelFreqMhz, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
173 |
WifiTxVector txVector, |
12429
d12f1640acca
wifi: (fixes #2551) Move preamble to TXVECTOR
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12239
diff
changeset
|
174 |
MpduInfo aMpdu) |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
175 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
176 |
uint32_t dlt = file->GetDataLinkType (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
177 |
switch (dlt) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
178 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
179 |
case PcapHelper::DLT_IEEE802_11: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
180 |
file->Write (Simulator::Now (), packet); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
181 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
182 |
case PcapHelper::DLT_PRISM_HEADER: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
183 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
184 |
NS_FATAL_ERROR ("PcapSniffTxEvent(): DLT_PRISM_HEADER not implemented"); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
185 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
186 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
187 |
case PcapHelper::DLT_IEEE802_11_RADIO: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
188 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
189 |
Ptr<Packet> p = packet->Copy (); |
13726
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
190 |
RadiotapHeader header = GetRadiotapHeader (p, channelFreqMhz, txVector, aMpdu); |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
191 |
p->AddHeader (header); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
192 |
file->Write (Simulator::Now (), p); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
193 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
194 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
195 |
default: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
196 |
NS_ABORT_MSG ("PcapSniffTxEvent(): Unexpected data link type " << dlt); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
197 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
198 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
199 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
200 |
void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
201 |
WifiPhyHelper::PcapSniffRxEvent ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
202 |
Ptr<PcapFileWrapper> file, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
203 |
Ptr<const Packet> packet, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
204 |
uint16_t channelFreqMhz, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
205 |
WifiTxVector txVector, |
12429
d12f1640acca
wifi: (fixes #2551) Move preamble to TXVECTOR
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12239
diff
changeset
|
206 |
MpduInfo aMpdu, |
d12f1640acca
wifi: (fixes #2551) Move preamble to TXVECTOR
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12239
diff
changeset
|
207 |
SignalNoiseDbm signalNoise) |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
208 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
209 |
uint32_t dlt = file->GetDataLinkType (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
210 |
switch (dlt) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
211 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
212 |
case PcapHelper::DLT_IEEE802_11: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
213 |
file->Write (Simulator::Now (), packet); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
214 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
215 |
case PcapHelper::DLT_PRISM_HEADER: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
216 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
217 |
NS_FATAL_ERROR ("PcapSniffRxEvent(): DLT_PRISM_HEADER not implemented"); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
218 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
219 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
220 |
case PcapHelper::DLT_IEEE802_11_RADIO: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
221 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
222 |
Ptr<Packet> p = packet->Copy (); |
13726
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
223 |
RadiotapHeader header = GetRadiotapHeader (p, channelFreqMhz, txVector, aMpdu); |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
224 |
header.SetAntennaSignalPower (signalNoise.signal); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
225 |
header.SetAntennaNoisePower (signalNoise.noise); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
226 |
p->AddHeader (header); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
227 |
file->Write (Simulator::Now (), p); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
228 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
229 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
230 |
default: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
231 |
NS_ABORT_MSG ("PcapSniffRxEvent(): Unexpected data link type " << dlt); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
232 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
233 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
234 |
|
13726
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
235 |
RadiotapHeader |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
236 |
WifiPhyHelper::GetRadiotapHeader ( |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
237 |
Ptr<Packet> packet, |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
238 |
uint16_t channelFreqMhz, |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
239 |
WifiTxVector txVector, |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
240 |
MpduInfo aMpdu) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
241 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
242 |
RadiotapHeader header; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
243 |
WifiPreamble preamble = txVector.GetPreambleType (); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
244 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
245 |
uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
246 |
header.SetTsft (Simulator::Now ().GetMicroSeconds ()); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
247 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
248 |
//Our capture includes the FCS, so we set the flag to say so. |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
249 |
frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
250 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
251 |
if (preamble == WIFI_PREAMBLE_SHORT) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
252 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
253 |
frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
254 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
255 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
256 |
if (txVector.GetGuardInterval () == 400) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
257 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
258 |
frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_GUARD; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
259 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
260 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
261 |
header.SetFrameFlags (frameFlags); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
262 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
263 |
uint64_t rate = 0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
264 |
if (txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
265 |
&& txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_VHT |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
266 |
&& txVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HE) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
267 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
268 |
rate = txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.GetGuardInterval (), 1) * txVector.GetNss () / 500000; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
269 |
header.SetRate (static_cast<uint8_t> (rate)); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
270 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
271 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
272 |
uint16_t channelFlags = 0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
273 |
switch (rate) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
274 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
275 |
case 2: //1Mbps |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
276 |
case 4: //2Mbps |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
277 |
case 10: //5Mbps |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
278 |
case 22: //11Mbps |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
279 |
channelFlags |= RadiotapHeader::CHANNEL_FLAG_CCK; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
280 |
break; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
281 |
default: |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
282 |
channelFlags |= RadiotapHeader::CHANNEL_FLAG_OFDM; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
283 |
break; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
284 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
285 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
286 |
if (channelFreqMhz < 2500) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
287 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
288 |
channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_2GHZ; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
289 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
290 |
else |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
291 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
292 |
channelFlags |= RadiotapHeader::CHANNEL_FLAG_SPECTRUM_5GHZ; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
293 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
294 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
295 |
header.SetChannelFrequencyAndFlags (channelFreqMhz, channelFlags); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
296 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
297 |
if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
298 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
299 |
uint8_t mcsKnown = RadiotapHeader::MCS_KNOWN_NONE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
300 |
uint8_t mcsFlags = RadiotapHeader::MCS_FLAGS_NONE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
301 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
302 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_INDEX; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
303 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
304 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_BANDWIDTH; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
305 |
if (txVector.GetChannelWidth () == 40) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
306 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
307 |
mcsFlags |= RadiotapHeader::MCS_FLAGS_BANDWIDTH_40; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
308 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
309 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
310 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_GUARD_INTERVAL; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
311 |
if (txVector.GetGuardInterval () == 400) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
312 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
313 |
mcsFlags |= RadiotapHeader::MCS_FLAGS_GUARD_INTERVAL; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
314 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
315 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
316 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_HT_FORMAT; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
317 |
if (preamble == WIFI_PREAMBLE_HT_GF) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
318 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
319 |
mcsFlags |= RadiotapHeader::MCS_FLAGS_HT_GREENFIELD; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
320 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
321 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
322 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
323 |
if (txVector.GetNess () & 0x01) //bit 1 |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
324 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
325 |
mcsFlags |= RadiotapHeader::MCS_FLAGS_NESS_BIT_0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
326 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
327 |
if (txVector.GetNess () & 0x02) //bit 2 |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
328 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
329 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_NESS_BIT_1; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
330 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
331 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
332 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_FEC_TYPE; //only BCC is currently supported |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
333 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
334 |
mcsKnown |= RadiotapHeader::MCS_KNOWN_STBC; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
335 |
if (txVector.IsStbc ()) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
336 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
337 |
mcsFlags |= RadiotapHeader::MCS_FLAGS_STBC_STREAMS; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
338 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
339 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
340 |
header.SetMcsFields (mcsKnown, mcsFlags, txVector.GetMode ().GetMcsValue ()); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
341 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
342 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
343 |
if (txVector.IsAggregation ()) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
344 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
345 |
uint16_t ampduStatusFlags = RadiotapHeader::A_MPDU_STATUS_NONE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
346 |
ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST_KNOWN; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
347 |
/* For PCAP file, MPDU Delimiter and Padding should be removed by the MAC Driver */ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
348 |
AmpduSubframeHeader hdr; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
349 |
uint32_t extractedLength; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
350 |
packet->RemoveHeader (hdr); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
351 |
extractedLength = hdr.GetLength (); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
352 |
packet = packet->CreateFragment (0, static_cast<uint32_t> (extractedLength)); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
353 |
if (aMpdu.type == LAST_MPDU_IN_AGGREGATE || (hdr.GetEof () == true && hdr.GetLength () > 0)) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
354 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
355 |
ampduStatusFlags |= RadiotapHeader::A_MPDU_STATUS_LAST; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
356 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
357 |
header.SetAmpduStatus (aMpdu.mpduRefNumber, ampduStatusFlags, 1 /*CRC*/); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
358 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
359 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
360 |
if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
361 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
362 |
uint16_t vhtKnown = RadiotapHeader::VHT_KNOWN_NONE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
363 |
uint8_t vhtFlags = RadiotapHeader::VHT_FLAGS_NONE; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
364 |
uint8_t vhtBandwidth = 0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
365 |
uint8_t vhtMcsNss[4] = {0,0,0,0}; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
366 |
uint8_t vhtCoding = 0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
367 |
uint8_t vhtGroupId = 0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
368 |
uint16_t vhtPartialAid = 0; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
369 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
370 |
vhtKnown |= RadiotapHeader::VHT_KNOWN_STBC; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
371 |
if (txVector.IsStbc ()) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
372 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
373 |
vhtFlags |= RadiotapHeader::VHT_FLAGS_STBC; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
374 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
375 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
376 |
vhtKnown |= RadiotapHeader::VHT_KNOWN_GUARD_INTERVAL; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
377 |
if (txVector.GetGuardInterval () == 400) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
378 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
379 |
vhtFlags |= RadiotapHeader::VHT_FLAGS_GUARD_INTERVAL; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
380 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
381 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
382 |
vhtKnown |= RadiotapHeader::VHT_KNOWN_BEAMFORMED; //Beamforming is currently not supported |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
383 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
384 |
vhtKnown |= RadiotapHeader::VHT_KNOWN_BANDWIDTH; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
385 |
//not all bandwidth values are currently supported |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
386 |
if (txVector.GetChannelWidth () == 40) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
387 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
388 |
vhtBandwidth = 1; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
389 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
390 |
else if (txVector.GetChannelWidth () == 80) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
391 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
392 |
vhtBandwidth = 4; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
393 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
394 |
else if (txVector.GetChannelWidth () == 160) |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
395 |
{ |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
396 |
vhtBandwidth = 11; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
397 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
398 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
399 |
//only SU PPDUs are currently supported |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
400 |
vhtMcsNss[0] |= (txVector.GetNss () & 0x0f); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
401 |
vhtMcsNss[0] |= ((txVector.GetMode ().GetMcsValue () << 4) & 0xf0); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
402 |
|
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
403 |
header.SetVhtFields (vhtKnown, vhtFlags, vhtBandwidth, vhtMcsNss, vhtCoding, vhtGroupId, vhtPartialAid); |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
404 |
} |
13728
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
405 |
|
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
406 |
if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HE) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
407 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
408 |
uint16_t data1 = RadiotapHeader::HE_DATA1_STBC_KNOWN | RadiotapHeader::HE_DATA1_DATA_MCS_KNOWN; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
409 |
if (preamble == WIFI_PREAMBLE_HE_ER_SU) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
410 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
411 |
data1 |= RadiotapHeader::HE_DATA1_FORMAT_EXT_SU; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
412 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
413 |
else if (preamble == WIFI_PREAMBLE_HE_MU) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
414 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
415 |
data1 |= RadiotapHeader::HE_DATA1_FORMAT_MU; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
416 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
417 |
else if (preamble == WIFI_PREAMBLE_HE_TB) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
418 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
419 |
data1 |= RadiotapHeader::HE_DATA1_FORMAT_TRIG; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
420 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
421 |
|
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
422 |
uint16_t data2 = RadiotapHeader::HE_DATA2_NUM_LTF_SYMS_KNOWN | RadiotapHeader::HE_DATA2_GI_KNOWN; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
423 |
|
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
424 |
uint16_t data3 = 0; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
425 |
if (txVector.IsStbc ()) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
426 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
427 |
data3 |= RadiotapHeader::HE_DATA3_STBC; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
428 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
429 |
|
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
430 |
uint16_t data5 = 0; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
431 |
if (txVector.GetChannelWidth () == 40) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
432 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
433 |
data5 |= RadiotapHeader::HE_DATA5_DATA_BW_RU_ALLOC_40MHZ; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
434 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
435 |
else if (txVector.GetChannelWidth () == 80) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
436 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
437 |
data5 |= RadiotapHeader::HE_DATA5_DATA_BW_RU_ALLOC_80MHZ; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
438 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
439 |
else if (txVector.GetChannelWidth () == 160) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
440 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
441 |
data5 |= RadiotapHeader::HE_DATA5_DATA_BW_RU_ALLOC_160MHZ; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
442 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
443 |
if (txVector.GetGuardInterval () == 1600) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
444 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
445 |
data5 |= RadiotapHeader::HE_DATA5_GI_1_6; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
446 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
447 |
else if (txVector.GetGuardInterval () == 3200) |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
448 |
{ |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
449 |
data5 |= RadiotapHeader::HE_DATA5_GI_3_2; |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
450 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
451 |
|
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
452 |
header.SetHeFields (data1, data2, data3, data5); |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
453 |
} |
aaf9df3f3c49
wifi: Add support for 802.11ax radiotap
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13726
diff
changeset
|
454 |
|
13726
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
455 |
return header; |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
456 |
} |
67c97243362f
wifi: Cleanup code duplication in WifiPhyHelper
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13697
diff
changeset
|
457 |
|
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
458 |
void |
13288
a9cc7aa1f6ac
wifi: Cleanup enums
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13270
diff
changeset
|
459 |
WifiPhyHelper::SetPcapDataLinkType (SupportedPcapDataLinkTypes dlt) |
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
460 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
461 |
switch (dlt) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
462 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
463 |
case DLT_IEEE802_11: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
464 |
m_pcapDlt = PcapHelper::DLT_IEEE802_11; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
465 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
466 |
case DLT_PRISM_HEADER: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
467 |
m_pcapDlt = PcapHelper::DLT_PRISM_HEADER; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
468 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
469 |
case DLT_IEEE802_11_RADIO: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
470 |
m_pcapDlt = PcapHelper::DLT_IEEE802_11_RADIO; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
471 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
472 |
default: |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
473 |
NS_ABORT_MSG ("WifiPhyHelper::SetPcapFormat(): Unexpected format"); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
474 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
475 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
476 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
477 |
PcapHelper::DataLinkType |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
478 |
WifiPhyHelper::GetPcapDataLinkType (void) const |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
479 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
480 |
return m_pcapDlt; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
481 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
482 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
483 |
void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
484 |
WifiPhyHelper::EnablePcapInternal (std::string prefix, Ptr<NetDevice> nd, bool promiscuous, bool explicitFilename) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
485 |
{ |
13310
ab5bd1317f10
wifi: Cleanup debugging logs
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13289
diff
changeset
|
486 |
NS_LOG_FUNCTION (this << prefix << nd << promiscuous << explicitFilename); |
ab5bd1317f10
wifi: Cleanup debugging logs
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13289
diff
changeset
|
487 |
|
12239
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
488 |
//All of the Pcap enable functions vector through here including the ones |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
489 |
//that are wandering through all of devices on perhaps all of the nodes in |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
490 |
//the system. We can only deal with devices of type WifiNetDevice. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
491 |
Ptr<WifiNetDevice> device = nd->GetObject<WifiNetDevice> (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
492 |
if (device == 0) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
493 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
494 |
NS_LOG_INFO ("WifiHelper::EnablePcapInternal(): Device " << &device << " not of type ns3::WifiNetDevice"); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
495 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
496 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
497 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
498 |
Ptr<WifiPhy> phy = device->GetPhy (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
499 |
NS_ABORT_MSG_IF (phy == 0, "WifiPhyHelper::EnablePcapInternal(): Phy layer in WifiNetDevice must be set"); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
500 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
501 |
PcapHelper pcapHelper; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
502 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
503 |
std::string filename; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
504 |
if (explicitFilename) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
505 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
506 |
filename = prefix; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
507 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
508 |
else |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
509 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
510 |
filename = pcapHelper.GetFilenameFromDevice (prefix, device); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
511 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
512 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
513 |
Ptr<PcapFileWrapper> file = pcapHelper.CreateFile (filename, std::ios::out, m_pcapDlt); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
514 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
515 |
phy->TraceConnectWithoutContext ("MonitorSnifferTx", MakeBoundCallback (&WifiPhyHelper::PcapSniffTxEvent, file)); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
516 |
phy->TraceConnectWithoutContext ("MonitorSnifferRx", MakeBoundCallback (&WifiPhyHelper::PcapSniffRxEvent, file)); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
517 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
518 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
519 |
void |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
520 |
WifiPhyHelper::EnableAsciiInternal ( |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
521 |
Ptr<OutputStreamWrapper> stream, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
522 |
std::string prefix, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
523 |
Ptr<NetDevice> nd, |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
524 |
bool explicitFilename) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
525 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
526 |
//All of the ascii enable functions vector through here including the ones |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
527 |
//that are wandering through all of devices on perhaps all of the nodes in |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
528 |
//the system. We can only deal with devices of type WifiNetDevice. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
529 |
Ptr<WifiNetDevice> device = nd->GetObject<WifiNetDevice> (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
530 |
if (device == 0) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
531 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
532 |
NS_LOG_INFO ("WifiHelper::EnableAsciiInternal(): Device " << device << " not of type ns3::WifiNetDevice"); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
533 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
534 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
535 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
536 |
//Our trace sinks are going to use packet printing, so we have to make sure |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
537 |
//that is turned on. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
538 |
Packet::EnablePrinting (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
539 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
540 |
uint32_t nodeid = nd->GetNode ()->GetId (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
541 |
uint32_t deviceid = nd->GetIfIndex (); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
542 |
std::ostringstream oss; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
543 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
544 |
//If we are not provided an OutputStreamWrapper, we are expected to create |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
545 |
//one using the usual trace filename conventions and write our traces |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
546 |
//without a context since there will be one file per context and therefore |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
547 |
//the context would be redundant. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
548 |
if (stream == 0) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
549 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
550 |
//Set up an output stream object to deal with private ofstream copy |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
551 |
//constructor and lifetime issues. Let the helper decide the actual |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
552 |
//name of the file given the prefix. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
553 |
AsciiTraceHelper asciiTraceHelper; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
554 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
555 |
std::string filename; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
556 |
if (explicitFilename) |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
557 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
558 |
filename = prefix; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
559 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
560 |
else |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
561 |
{ |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
562 |
filename = asciiTraceHelper.GetFilenameFromDevice (prefix, device); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
563 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
564 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
565 |
Ptr<OutputStreamWrapper> theStream = asciiTraceHelper.CreateFileStream (filename); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
566 |
//We could go poking through the phy and the state looking for the |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
567 |
//correct trace source, but we can let Config deal with that with |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
568 |
//some search cost. Since this is presumably happening at topology |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
569 |
//creation time, it doesn't seem much of a price to pay. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
570 |
oss.str (""); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
571 |
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/RxOk"; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
572 |
Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&AsciiPhyReceiveSinkWithoutContext, theStream)); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
573 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
574 |
oss.str (""); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
575 |
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/Tx"; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
576 |
Config::ConnectWithoutContext (oss.str (), MakeBoundCallback (&AsciiPhyTransmitSinkWithoutContext, theStream)); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
577 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
578 |
return; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
579 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
580 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
581 |
//If we are provided an OutputStreamWrapper, we are expected to use it, and |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
582 |
//to provide a context. We are free to come up with our own context if we |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
583 |
//want, and use the AsciiTraceHelper Hook*WithContext functions, but for |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
584 |
//compatibility and simplicity, we just use Config::Connect and let it deal |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
585 |
//with coming up with a context. |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
586 |
oss.str (""); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
587 |
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/RxOk"; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
588 |
Config::Connect (oss.str (), MakeBoundCallback (&AsciiPhyReceiveSinkWithContext, stream)); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
589 |
|
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
590 |
oss.str (""); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
591 |
oss << "/NodeList/" << nodeid << "/DeviceList/" << deviceid << "/$ns3::WifiNetDevice/Phy/State/Tx"; |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
592 |
Config::Connect (oss.str (), MakeBoundCallback (&AsciiPhyTransmitSinkWithContext, stream)); |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
593 |
} |
3947ce212f75
wifi: remove code duplication in yans and spectrum helpers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11854
diff
changeset
|
594 |
|
10466 | 595 |
WifiHelper::~WifiHelper () |
596 |
{ |
|
597 |
} |
|
598 |
||
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
599 |
WifiHelper::WifiHelper () |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
600 |
: m_standard (WIFI_PHY_STANDARD_80211a), |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
601 |
m_selectQueueCallback (&SelectQueueByDSField) |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
602 |
{ |
11854
7c60a9f8f271
wifi: (fixes #2116 and #2213) Refactor helpers and APIs
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11450
diff
changeset
|
603 |
SetRemoteStationManager ("ns3::ArfWifiManager"); |
6674
52f8688d6d01
Bug 978: Run check-style.py on files touched in the reorganisation
Dean Armstrong <deanarm@gmail.com>
parents:
6673
diff
changeset
|
604 |
} |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3909
diff
changeset
|
605 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
606 |
void |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
607 |
WifiHelper::SetRemoteStationManager (std::string type, |
3786
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
608 |
std::string n0, const AttributeValue &v0, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
609 |
std::string n1, const AttributeValue &v1, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
610 |
std::string n2, const AttributeValue &v2, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
611 |
std::string n3, const AttributeValue &v3, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
612 |
std::string n4, const AttributeValue &v4, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
613 |
std::string n5, const AttributeValue &v5, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
614 |
std::string n6, const AttributeValue &v6, |
9f384deadb46
replace \t with 8 spaces.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3553
diff
changeset
|
615 |
std::string n7, const AttributeValue &v7) |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
616 |
{ |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
617 |
m_stationManager = ObjectFactory (); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
618 |
m_stationManager.SetTypeId (type); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
619 |
m_stationManager.Set (n0, v0); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
620 |
m_stationManager.Set (n1, v1); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
621 |
m_stationManager.Set (n2, v2); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
622 |
m_stationManager.Set (n3, v3); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
623 |
m_stationManager.Set (n4, v4); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
624 |
m_stationManager.Set (n5, v5); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
625 |
m_stationManager.Set (n6, v6); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
626 |
m_stationManager.Set (n7, v7); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
627 |
} |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
628 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
629 |
void |
13288
a9cc7aa1f6ac
wifi: Cleanup enums
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13270
diff
changeset
|
630 |
WifiHelper::SetStandard (WifiPhyStandard standard) |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4605
diff
changeset
|
631 |
{ |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4605
diff
changeset
|
632 |
m_standard = standard; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4605
diff
changeset
|
633 |
} |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4605
diff
changeset
|
634 |
|
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
635 |
void |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
636 |
WifiHelper::SetSelectQueueCallback (SelectQueueCallback f) |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
637 |
{ |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
638 |
m_selectQueueCallback = f; |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
639 |
} |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
640 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
641 |
NetDeviceContainer |
4406 | 642 |
WifiHelper::Install (const WifiPhyHelper &phyHelper, |
12788
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
643 |
const WifiMacHelper &macHelper, |
12789
65f4f1ee30ef
wifi: Rename low and high to first and last to match documentation
Alexander Krotov <krotov@iitp.ru>
parents:
12788
diff
changeset
|
644 |
NodeContainer::Iterator first, |
65f4f1ee30ef
wifi: Rename low and high to first and last to match documentation
Alexander Krotov <krotov@iitp.ru>
parents:
12788
diff
changeset
|
645 |
NodeContainer::Iterator last) const |
2791
a2ab6517516e
basic pcap output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2656
diff
changeset
|
646 |
{ |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
647 |
NetDeviceContainer devices; |
12789
65f4f1ee30ef
wifi: Rename low and high to first and last to match documentation
Alexander Krotov <krotov@iitp.ru>
parents:
12788
diff
changeset
|
648 |
for (NodeContainer::Iterator i = first; i != last; ++i) |
2805
cd246cf2edf3
add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2804
diff
changeset
|
649 |
{ |
cd246cf2edf3
add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2804
diff
changeset
|
650 |
Ptr<Node> node = *i; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
651 |
Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> (); |
13834
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
652 |
if (m_standard >= WIFI_PHY_STANDARD_80211n_2_4GHZ) |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
653 |
{ |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
654 |
Ptr<HtConfiguration> htConfiguration = CreateObject<HtConfiguration> (); |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
655 |
device->SetHtConfiguration (htConfiguration); |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
656 |
} |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
657 |
if ((m_standard == WIFI_PHY_STANDARD_80211ac) || (m_standard == WIFI_PHY_STANDARD_80211ax_5GHZ)) |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
658 |
{ |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
659 |
Ptr<VhtConfiguration> vhtConfiguration = CreateObject<VhtConfiguration> (); |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
660 |
device->SetVhtConfiguration (vhtConfiguration); |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
661 |
} |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
662 |
if (m_standard >= WIFI_PHY_STANDARD_80211ax_2_4GHZ) |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
663 |
{ |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
664 |
Ptr<HeConfiguration> heConfiguration = CreateObject<HeConfiguration> (); |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
665 |
device->SetHeConfiguration (heConfiguration); |
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
666 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
667 |
Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> (); |
13834
2670ce559a9b
wifi: Add configuration objects for 802.11n/ac/ax
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13801
diff
changeset
|
668 |
Ptr<WifiMac> mac = macHelper.Create (device); |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3909
diff
changeset
|
669 |
Ptr<WifiPhy> phy = phyHelper.Create (node, device); |
2656
b426a0e0355e
call SetAddress during construction to assign MAC-level addresses.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2603
diff
changeset
|
670 |
mac->SetAddress (Mac48Address::Allocate ()); |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4605
diff
changeset
|
671 |
mac->ConfigureStandard (m_standard); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4605
diff
changeset
|
672 |
phy->ConfigureStandard (m_standard); |
2601
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2592
diff
changeset
|
673 |
device->SetMac (mac); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2592
diff
changeset
|
674 |
device->SetPhy (phy); |
4297e8c61615
rework the Wifi API to not use a single WifiNetDevice::Setup method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2592
diff
changeset
|
675 |
device->SetRemoteStationManager (manager); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
676 |
node->AddDevice (device); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
677 |
devices.Add (device); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
678 |
NS_LOG_DEBUG ("node=" << node << ", mob=" << node->GetObject<MobilityModel> ()); |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
679 |
// Aggregate a NetDeviceQueueInterface object if a RegularWifiMac is installed |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
680 |
Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (mac); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
681 |
if (rmac) |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
682 |
{ |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
683 |
Ptr<NetDeviceQueueInterface> ndqi; |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
684 |
BooleanValue qosSupported; |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
685 |
PointerValue ptr; |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
686 |
Ptr<WifiMacQueue> wmq; |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
687 |
|
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
688 |
rmac->GetAttributeFailSafe ("QosSupported", qosSupported); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
689 |
if (qosSupported.Get ()) |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
690 |
{ |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
691 |
ndqi = CreateObjectWithAttributes<NetDeviceQueueInterface> ("NTxQueues", |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
692 |
UintegerValue (4)); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
693 |
|
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
694 |
rmac->GetAttributeFailSafe ("BE_Txop", ptr); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
695 |
wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue (); |
13876
04881484a542
traffic-control: Make NetDeviceQueueInterface independent of Queue
Stefano Avallone <stavallo@unina.it>
parents:
13834
diff
changeset
|
696 |
ndqi->GetTxQueue (0)->ConnectQueueTraces (wmq); |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
697 |
|
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
698 |
rmac->GetAttributeFailSafe ("BK_Txop", ptr); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
699 |
wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue (); |
13876
04881484a542
traffic-control: Make NetDeviceQueueInterface independent of Queue
Stefano Avallone <stavallo@unina.it>
parents:
13834
diff
changeset
|
700 |
ndqi->GetTxQueue (1)->ConnectQueueTraces (wmq); |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
701 |
|
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
702 |
rmac->GetAttributeFailSafe ("VI_Txop", ptr); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
703 |
wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue (); |
13876
04881484a542
traffic-control: Make NetDeviceQueueInterface independent of Queue
Stefano Avallone <stavallo@unina.it>
parents:
13834
diff
changeset
|
704 |
ndqi->GetTxQueue (2)->ConnectQueueTraces (wmq); |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
705 |
|
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
706 |
rmac->GetAttributeFailSafe ("VO_Txop", ptr); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
707 |
wmq = ptr.Get<QosTxop> ()->GetWifiMacQueue (); |
13876
04881484a542
traffic-control: Make NetDeviceQueueInterface independent of Queue
Stefano Avallone <stavallo@unina.it>
parents:
13834
diff
changeset
|
708 |
ndqi->GetTxQueue (3)->ConnectQueueTraces (wmq); |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
709 |
ndqi->SetSelectQueueCallback (m_selectQueueCallback); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
710 |
} |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
711 |
else |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
712 |
{ |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
713 |
ndqi = CreateObject<NetDeviceQueueInterface> (); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
714 |
|
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
715 |
rmac->GetAttributeFailSafe ("Txop", ptr); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
716 |
wmq = ptr.Get<Txop> ()->GetWifiMacQueue (); |
13876
04881484a542
traffic-control: Make NetDeviceQueueInterface independent of Queue
Stefano Avallone <stavallo@unina.it>
parents:
13834
diff
changeset
|
717 |
ndqi->GetTxQueue (0)->ConnectQueueTraces (wmq); |
13801
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
718 |
} |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
719 |
device->AggregateObject (ndqi); |
9d2b29212300
traffic-control: the NetDeviceQueueInterface object is created by NetDevice helpers
Stefano Avallone <stavallo@unina.it>
parents:
13728
diff
changeset
|
720 |
} |
2805
cd246cf2edf3
add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2804
diff
changeset
|
721 |
} |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
722 |
return devices; |
2805
cd246cf2edf3
add missing tracing helpers and doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2804
diff
changeset
|
723 |
} |
4406 | 724 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
725 |
NetDeviceContainer |
12788
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
726 |
WifiHelper::Install (const WifiPhyHelper &phyHelper, |
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
727 |
const WifiMacHelper &macHelper, NodeContainer c) const |
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
728 |
{ |
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
729 |
return Install (phyHelper, macHelper, c.Begin (), c.End ()); |
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
730 |
} |
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
731 |
|
fa1e259e4c7c
wifi: Add iterator version of WifiHelper::Install
Alexander Krotov <krotov@iitp.ru>
parents:
12718
diff
changeset
|
732 |
NetDeviceContainer |
4406 | 733 |
WifiHelper::Install (const WifiPhyHelper &phy, |
734 |
const WifiMacHelper &mac, Ptr<Node> node) const |
|
3915
c798f3d5cb2e
add WifiHelper::Install (Ptr<Node>) method per craig's comment.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3914
diff
changeset
|
735 |
{ |
4406 | 736 |
return Install (phy, mac, NodeContainer (node)); |
3915
c798f3d5cb2e
add WifiHelper::Install (Ptr<Node>) method per craig's comment.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3914
diff
changeset
|
737 |
} |
4406 | 738 |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
739 |
NetDeviceContainer |
4406 | 740 |
WifiHelper::Install (const WifiPhyHelper &phy, |
741 |
const WifiMacHelper &mac, std::string nodeName) const |
|
4140
6bbf05bf4826
Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents:
3915
diff
changeset
|
742 |
{ |
6bbf05bf4826
Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents:
3915
diff
changeset
|
743 |
Ptr<Node> node = Names::Find<Node> (nodeName); |
4406 | 744 |
return Install (phy, mac, NodeContainer (node)); |
4140
6bbf05bf4826
Brute force all of the helpers to use object name service
Craig Dowell <craigdo@ee.washington.edu>
parents:
3915
diff
changeset
|
745 |
} |
2791
a2ab6517516e
basic pcap output
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2656
diff
changeset
|
746 |
|
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
747 |
void |
4605
fd44ff061631
bug 608: painful to enable logging of all wifi components
Tom Henderson <tomh@tomh.org>
parents:
4588
diff
changeset
|
748 |
WifiHelper::EnableLogComponents (void) |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
749 |
{ |
13893
83b0217cbb13
wifi: Improve readibility of collected logs when WifiHelper::EnableLogComponents is used
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13892
diff
changeset
|
750 |
LogComponentEnableAll (LOG_PREFIX_TIME); |
83b0217cbb13
wifi: Improve readibility of collected logs when WifiHelper::EnableLogComponents is used
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13892
diff
changeset
|
751 |
LogComponentEnableAll (LOG_PREFIX_NODE); |
83b0217cbb13
wifi: Improve readibility of collected logs when WifiHelper::EnableLogComponents is used
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13892
diff
changeset
|
752 |
|
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
753 |
LogComponentEnable ("AarfWifiManager", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
754 |
LogComponentEnable ("AarfcdWifiManager", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
755 |
LogComponentEnable ("AdhocWifiMac", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
756 |
LogComponentEnable ("AmrrWifiManager", LOG_LEVEL_ALL); |
6673
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6359
diff
changeset
|
757 |
LogComponentEnable ("ApWifiMac", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
758 |
LogComponentEnable ("AparfWifiManager", LOG_LEVEL_ALL); |
11013 | 759 |
LogComponentEnable ("ArfWifiManager", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
760 |
LogComponentEnable ("BlockAckAgreement", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
761 |
LogComponentEnable ("BlockAckCache", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
762 |
LogComponentEnable ("BlockAckManager", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
763 |
LogComponentEnable ("CaraWifiManager", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
764 |
LogComponentEnable ("ConstantRateWifiManager", LOG_LEVEL_ALL); |
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
765 |
LogComponentEnable ("Txop", LOG_LEVEL_ALL); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
766 |
LogComponentEnable ("ChannelAccessManager", LOG_LEVEL_ALL); |
6359
9860e12062b7
Align WifiHelper logging with new ErrorRateModel classes
Tom Henderson <tomh@tomh.org>
parents:
6049
diff
changeset
|
767 |
LogComponentEnable ("DsssErrorRateModel", LOG_LEVEL_ALL); |
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
768 |
LogComponentEnable ("QosTxop", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
769 |
LogComponentEnable ("IdealWifiManager", LOG_LEVEL_ALL); |
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
770 |
LogComponentEnable ("InfrastructureWifiMac", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
771 |
LogComponentEnable ("InterferenceHelper", LOG_LEVEL_ALL); |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
772 |
LogComponentEnable ("MacLow", LOG_LEVEL_ALL); |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
773 |
LogComponentEnable ("MacRxMiddle", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
774 |
LogComponentEnable ("MacTxMiddle", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
775 |
LogComponentEnable ("MinstrelHtWifiManager", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
776 |
LogComponentEnable ("MinstrelWifiManager", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
777 |
LogComponentEnable ("MpduAggregator", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
778 |
LogComponentEnable ("MsduAggregator", LOG_LEVEL_ALL); |
6359
9860e12062b7
Align WifiHelper logging with new ErrorRateModel classes
Tom Henderson <tomh@tomh.org>
parents:
6049
diff
changeset
|
779 |
LogComponentEnable ("NistErrorRateModel", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
780 |
LogComponentEnable ("OnoeWifiManager", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
781 |
LogComponentEnable ("ParfWifiManager", LOG_LEVEL_ALL); |
6673
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6359
diff
changeset
|
782 |
LogComponentEnable ("RegularWifiMac", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
783 |
LogComponentEnable ("RraaWifiManager", LOG_LEVEL_ALL); |
13171
c715f7ddec28
wifi: Add missing RrpaaWifiManager traces to WifiHelper::EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12789
diff
changeset
|
784 |
LogComponentEnable ("RrpaaWifiManager", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
785 |
LogComponentEnable ("SpectrumWifiPhy", LOG_LEVEL_ALL); |
6673
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6359
diff
changeset
|
786 |
LogComponentEnable ("StaWifiMac", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
787 |
LogComponentEnable ("SupportedRates", LOG_LEVEL_ALL); |
13892
53fa9b4b8c09
wifi: wifi: Add ThresholdPreambleDetectionModel logs in WifiHelper::EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13876
diff
changeset
|
788 |
LogComponentEnable ("ThresholdPreambleDetectionModel", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
789 |
LogComponentEnable ("WifiMac", LOG_LEVEL_ALL); |
13354
c2034663c810
wifi: Refactor WifiPhy and WifiPhyStateHelper to eliminate circular declaration of classes (based on Robert Ammon's patch)
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13346
diff
changeset
|
790 |
LogComponentEnable ("WifiMacQueueItem", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
791 |
LogComponentEnable ("WifiNetDevice", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
792 |
LogComponentEnable ("WifiPhyStateHelper", LOG_LEVEL_ALL); |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
793 |
LogComponentEnable ("WifiPhy", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
794 |
LogComponentEnable ("WifiRadioEnergyModel", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
795 |
LogComponentEnable ("WifiRemoteStationManager", LOG_LEVEL_ALL); |
12498
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
796 |
LogComponentEnable ("WifiSpectrumPhyInterface", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
797 |
LogComponentEnable ("WifiSpectrumSignalParameters", LOG_LEVEL_ALL); |
4da85fa4f268
wifi: Update EnableLogComponents
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
12431
diff
changeset
|
798 |
LogComponentEnable ("WifiTxCurrentModel", LOG_LEVEL_ALL); |
4588
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
799 |
LogComponentEnable ("YansErrorRateModel", LOG_LEVEL_ALL); |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
800 |
LogComponentEnable ("YansWifiChannel", LOG_LEVEL_ALL); |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
801 |
LogComponentEnable ("YansWifiPhy", LOG_LEVEL_ALL); |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
802 |
} |
0698fdc1aaf9
WifiHelper method to enable all Wifi logging
Tom Henderson <tomh@tomh.org>
parents:
4406
diff
changeset
|
803 |
|
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
804 |
int64_t |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
805 |
WifiHelper::AssignStreams (NetDeviceContainer c, int64_t stream) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
806 |
{ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
807 |
int64_t currentStream = stream; |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
808 |
Ptr<NetDevice> netDevice; |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
809 |
for (NetDeviceContainer::Iterator i = c.Begin (); i != c.End (); ++i) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
810 |
{ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
811 |
netDevice = (*i); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
812 |
Ptr<WifiNetDevice> wifi = DynamicCast<WifiNetDevice> (netDevice); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
813 |
if (wifi) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
814 |
{ |
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
815 |
//Handle any random numbers in the PHY objects. |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
816 |
currentStream += wifi->GetPhy ()->AssignStreams (currentStream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
817 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
818 |
//Handle any random numbers in the station managers. |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
819 |
Ptr<WifiRemoteStationManager> manager = wifi->GetRemoteStationManager (); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
820 |
Ptr<MinstrelWifiManager> minstrel = DynamicCast<MinstrelWifiManager> (manager); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
821 |
if (minstrel) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
822 |
{ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
823 |
currentStream += minstrel->AssignStreams (currentStream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
824 |
} |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
825 |
|
13270
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
826 |
Ptr<MinstrelHtWifiManager> minstrelHt = DynamicCast<MinstrelHtWifiManager> (manager); |
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
827 |
if (minstrelHt) |
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
828 |
{ |
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
829 |
currentStream += minstrelHt->AssignStreams (currentStream); |
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
830 |
} |
f074a6ada683
wifi: (fixes #2656) Correct bugs and improve logging in MinstrelHt
Matias Richart <mrichart@fing.edu.uy>
parents:
13257
diff
changeset
|
831 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
832 |
//Handle any random numbers in the MAC objects. |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
833 |
Ptr<WifiMac> mac = wifi->GetMac (); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
834 |
Ptr<RegularWifiMac> rmac = DynamicCast<RegularWifiMac> (mac); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
835 |
if (rmac) |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
836 |
{ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
837 |
PointerValue ptr; |
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
838 |
rmac->GetAttribute ("Txop", ptr); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
839 |
Ptr<Txop> txop = ptr.Get<Txop> (); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
840 |
currentStream += txop->AssignStreams (currentStream); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
841 |
|
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
842 |
rmac->GetAttribute ("VO_Txop", ptr); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
843 |
Ptr<QosTxop> vo_txop = ptr.Get<QosTxop> (); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
844 |
currentStream += vo_txop->AssignStreams (currentStream); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
845 |
|
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
846 |
rmac->GetAttribute ("VI_Txop", ptr); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
847 |
Ptr<QosTxop> vi_txop = ptr.Get<QosTxop> (); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
848 |
currentStream += vi_txop->AssignStreams (currentStream); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
849 |
|
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
850 |
rmac->GetAttribute ("BE_Txop", ptr); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
851 |
Ptr<QosTxop> be_txop = ptr.Get<QosTxop> (); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
852 |
currentStream += be_txop->AssignStreams (currentStream); |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
853 |
|
13557
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
854 |
rmac->GetAttribute ("BK_Txop", ptr); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
855 |
Ptr<QosTxop> bk_txop = ptr.Get<QosTxop> (); |
1d9389d67836
wifi: Add support for 802.11 PCF
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
13511
diff
changeset
|
856 |
currentStream += bk_txop->AssignStreams (currentStream); |
10206
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
857 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
858 |
//if an AP, handle any beacon jitter |
10206
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
859 |
Ptr<ApWifiMac> apmac = DynamicCast<ApWifiMac> (rmac); |
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
860 |
if (apmac) |
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
861 |
{ |
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
862 |
currentStream += apmac->AssignStreams (currentStream); |
ecd136bcb899
Bug 1722 - beacons transmitted concurrently
Tom Henderson <tomh@tomh.org>
parents:
8981
diff
changeset
|
863 |
} |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
864 |
} |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
865 |
} |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
866 |
} |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
867 |
return (currentStream - stream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
868 |
} |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7141
diff
changeset
|
869 |
|
11450
9f4ae69f12b7
cleanup wifi module
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11013
diff
changeset
|
870 |
} //namespace ns3 |