src/network/utils/radiotap-header.cc
author Sébastien Deronne <sebastien.deronne@gmail.com>
Wed, 08 Jul 2015 23:44:17 +0200
changeset 11479 a3dcf66928f3
parent 11238 96b5da288844
child 11628 243b71de25a0
permissions -rwxr-xr-x
add support for HT MCS and A-MPDU in radiotap headers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7256
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
/*
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     3
 * Copyright (c) 2009 CTTC
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     4
 *
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     8
 *
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
 *
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
 * Foundation, Include., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    17
 *
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    18
 * Authors: Nicola Baldo <nbaldo@cttc.es>
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    19
 *          Sébastien Deronne <sebastien.deronne@gmail.com>
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    20
 */
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    21
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    22
#include <iomanip>
9063
32755d0516f4 Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents: 7704
diff changeset
    23
#include <cmath>
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    24
#include "ns3/log.h"
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    25
#include "radiotap-header.h"
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
10968
2d29fee2b7b8 [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10652
diff changeset
    27
namespace ns3 {
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    28
10968
2d29fee2b7b8 [Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10652
diff changeset
    29
NS_LOG_COMPONENT_DEFINE ("RadiotapHeader");
6393
f7e1f9dfa08d ensure objects are regsitered
Josh Pelkey <jpelkey@gatech.edu>
parents: 6036
diff changeset
    30
10652
dc18deba4502 [doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents: 10410
diff changeset
    31
NS_OBJECT_ENSURE_REGISTERED (RadiotapHeader);
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    32
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    33
RadiotapHeader::RadiotapHeader ()
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    34
  : m_length (8),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    35
    m_present (0),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    36
    m_tsft (0),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    37
    m_flags (FRAME_FLAG_NONE),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    38
    m_rate (0),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    39
    m_channelFreq (0),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    40
    m_channelFlags (CHANNEL_FLAG_NONE),
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
    41
    m_antennaSignal (0),
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    42
    m_antennaNoise (0),
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    43
    m_ampduStatusRef (0),
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    44
    m_ampduStatusFlags (0),
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    45
    m_ampduStatusCRC (0)
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
    46
{
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    47
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    48
}
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    49
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    50
TypeId RadiotapHeader::GetTypeId (void)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
{
6393
f7e1f9dfa08d ensure objects are regsitered
Josh Pelkey <jpelkey@gatech.edu>
parents: 6036
diff changeset
    52
  static TypeId tid = TypeId ("ns3::RadiotapHeader")
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    53
    .SetParent<Header> ()
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    54
    .SetGroupName ("Network")
11238
96b5da288844 SetGroupName for network module
Mohit Goyal <mohit.bits2011@gmail.com>
parents: 10968
diff changeset
    55
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    56
    .AddConstructor<RadiotapHeader> ()
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
    57
  ;
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    58
  return tid;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    59
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    60
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    61
TypeId
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    62
RadiotapHeader::GetInstanceTypeId (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    63
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    64
  return GetTypeId ();
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    65
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    66
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
    67
uint32_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    68
RadiotapHeader::GetSerializedSize (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    69
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    70
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    71
  return m_length;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    72
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    73
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
    74
void
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    75
RadiotapHeader::Serialize (Buffer::Iterator start) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    76
{
9144
6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents: 9063
diff changeset
    77
  NS_LOG_FUNCTION (this << &start);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    78
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    79
  start.WriteU8 (0); // major version of radiotap header
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    80
  start.WriteU8 (0); // pad field
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    81
  start.WriteU16 (m_length); // entire length of radiotap data + header
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    82
  start.WriteU32 (m_present); // bits describing which fields follow header
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
    83
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    84
  //
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
    85
  // Time Synchronization Function Timer (when the first bit of the MPDU
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    86
  // arrived at the MAC)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    87
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    88
  if (m_present & RADIOTAP_TSFT) // bit 0
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    89
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    90
      start.WriteU64 (m_tsft);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    91
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    92
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    93
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    94
  // Properties of transmitted and received frames.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    95
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    96
  if (m_present & RADIOTAP_FLAGS) // bit 1
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    97
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    98
      start.WriteU8 (m_flags);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    99
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   100
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   101
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   102
  // TX/RX data rate in units of 500 kbps
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   103
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   104
  if (m_present & RADIOTAP_RATE) // bit 2
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   105
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   106
      start.WriteU8 (m_rate);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   107
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   108
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   109
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   110
  // Tx/Rx frequency in MHz, followed by flags.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   111
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   112
  if (m_present & RADIOTAP_CHANNEL) // bit 3
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   113
    {
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   114
      start.WriteU8 (0, m_channelPad);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   115
      start.WriteU16 (m_channelFreq);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   116
      start.WriteU16 (m_channelFlags);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   117
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   118
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   119
  //
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   120
  // The hop set and pattern for frequency-hopping radios.  We don't need it but
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   121
  // still need to account for it.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   122
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   123
  if (m_present & RADIOTAP_FHSS) // bit 4
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   124
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   125
      start.WriteU8 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   126
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   127
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   128
  //
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   129
  // RF signal power at the antenna, decibel difference from an arbitrary, fixed
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   130
  // reference.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   131
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   132
  if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   133
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   134
      start.WriteU8 (m_antennaSignal);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   135
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   136
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   137
  //
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   138
  // RF noise power at the antenna, decibel difference from an arbitrary, fixed
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   139
  // reference.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   140
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   141
  if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   142
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   143
      start.WriteU8 (m_antennaNoise);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   144
    }
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   145
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   146
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   147
  // Quality of Barker code lock.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   148
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   149
  if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   150
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   151
      start.WriteU16 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   152
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   153
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   154
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   155
  // Transmit power expressed as unitless distance from max power
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   156
  // set at factory calibration (0 is max power).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   157
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   158
  if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   159
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   160
      start.WriteU16 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   161
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   162
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   163
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   164
  // Transmit power expressed as decibel distance from max power
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   165
  // set at factory calibration (0 is max power).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   166
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   167
  if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   168
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   169
      start.WriteU16 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   170
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   171
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   172
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   173
  // Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   174
  // This is the absolute power level measured at the antenna port.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   175
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   176
  if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   177
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   178
      start.WriteU8 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   179
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   180
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   181
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   182
  // Unitless indication of the Rx/Tx antenna for this packet.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   183
  // The first antenna is antenna 0.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   184
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   185
  if (m_present & RADIOTAP_ANTENNA) // bit 11
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   186
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   187
      start.WriteU8 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   188
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   189
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   190
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   191
  // RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   192
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   193
  if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   194
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   195
      start.WriteU8 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   196
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   197
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   198
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   199
  // RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   200
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   201
  if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   202
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   203
      start.WriteU8 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   204
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   205
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   206
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   207
  // Properties of received frames.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   208
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   209
  if (m_present & RADIOTAP_RX_FLAGS) // bit 14
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   210
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   211
      start.WriteU16 (0); //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   212
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   213
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   214
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   215
  // MCS field.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   216
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   217
  if (m_present & RADIOTAP_MCS) // bit 19
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   218
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   219
      start.WriteU8 (m_mcsKnown);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   220
      start.WriteU8 (m_mcsFlags);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   221
      start.WriteU8 (m_mcsRate);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   222
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   223
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   224
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   225
  // A-MPDU Status, information about the received or transmitted A-MPDU.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   226
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   227
  if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   228
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   229
      start.WriteU8 (0, m_ampduStatusPad);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   230
      start.WriteU32 (m_ampduStatusRef);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   231
      start.WriteU16 (m_ampduStatusFlags);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   232
      start.WriteU8 (m_ampduStatusCRC);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   233
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   234
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   235
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   236
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   237
  // Information about the received or transmitted VHT frame.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   238
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   239
  if (m_present & RADIOTAP_VHT) // bit 21
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   240
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   241
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   242
      start.WriteU16 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   243
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   244
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   245
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   246
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   247
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   248
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   249
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   250
      start.WriteU8 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   251
      start.WriteU16 (0);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   252
    }
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   253
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   254
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   255
uint32_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   256
RadiotapHeader::Deserialize (Buffer::Iterator start)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   257
{
9144
6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents: 9063
diff changeset
   258
  NS_LOG_FUNCTION (this << &start);
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   259
7704
aef733235832 Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents: 7385
diff changeset
   260
  uint8_t tmp = start.ReadU8 (); // major version of radiotap header
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   261
  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   262
  start.ReadU8 (); // pad field
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   263
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   264
  m_length = start.ReadU16 (); // entire length of radiotap data + header
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   265
  m_present = start.ReadU32 (); // bits describing which fields follow header
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   266
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   267
  uint32_t bytesRead = 8;
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   268
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   269
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   270
  // Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   271
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   272
  if (m_present & RADIOTAP_TSFT) // bit 0
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   273
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   274
      m_tsft = start.ReadU64 ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   275
      bytesRead += 8;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   276
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   277
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   278
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   279
  // Properties of transmitted and received frames.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   280
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   281
  if (m_present & RADIOTAP_FLAGS) // bit 1
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   282
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   283
      m_flags = start.ReadU8 ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   284
      ++bytesRead;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   285
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   286
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   287
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   288
  // TX/RX data rate in units of 500 kbps
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   289
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   290
  if (m_present & RADIOTAP_RATE) // bit 2
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   291
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   292
      m_rate = start.ReadU8 ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   293
      ++bytesRead;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   294
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   295
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   296
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   297
  // Tx/Rx frequency in MHz, followed by flags.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   298
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   299
  if (m_present & RADIOTAP_CHANNEL) // bit 3
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   300
    {
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   301
      m_channelPad = ((2 - bytesRead % 2) % 2);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   302
      start.Next (m_channelPad);
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   303
      m_channelFreq = start.ReadU16 ();
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   304
      m_channelFlags = start.ReadU16 ();
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   305
      bytesRead += (4 + m_channelPad);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   306
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   307
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   308
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   309
  // The hop set and pattern for frequency-hopping radios.  We don't need it but
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   310
  // still need to account for it.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   311
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   312
  if (m_present & RADIOTAP_FHSS) // bit 4
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   313
    {
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   314
      //not yet implemented
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   315
      start.ReadU8 ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   316
      ++bytesRead;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   317
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   318
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   319
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   320
  // RF signal power at the antenna, decibel difference from an arbitrary, fixed
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   321
  // reference.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   322
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   323
  if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   324
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   325
      m_antennaSignal = start.ReadU8 ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   326
      ++bytesRead;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   327
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   328
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   329
  //
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   330
  // RF noise power at the antenna, decibel difference from an arbitrary, fixed
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   331
  // reference.
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   332
  //
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   333
  if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   334
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   335
      m_antennaNoise = start.ReadU8 ();
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   336
      ++bytesRead;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   337
    }
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   338
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   339
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   340
  // Quality of Barker code lock.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   341
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   342
  if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   343
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   344
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   345
      start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   346
      bytesRead += 2;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   347
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   348
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   349
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   350
  // Transmit power expressed as unitless distance from max power
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   351
  // set at factory calibration (0 is max power).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   352
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   353
  if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   354
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   355
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   356
      start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   357
      bytesRead += 2;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   358
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   359
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   360
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   361
  // Transmit power expressed as decibel distance from max power
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   362
  // set at factory calibration (0 is max power).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   363
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   364
  if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   365
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   366
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   367
      start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   368
      bytesRead += 2;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   369
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   370
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   371
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   372
  // Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   373
  // This is the absolute power level measured at the antenna port.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   374
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   375
  if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   376
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   377
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   378
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   379
      ++bytesRead;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   380
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   381
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   382
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   383
  // Unitless indication of the Rx/Tx antenna for this packet.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   384
  // The first antenna is antenna 0.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   385
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   386
  if (m_present & RADIOTAP_ANTENNA) // bit 11
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   387
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   388
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   389
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   390
      ++bytesRead;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   391
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   392
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   393
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   394
  // RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   395
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   396
  if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   397
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   398
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   399
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   400
      ++bytesRead;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   401
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   402
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   403
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   404
  // RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   405
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   406
  if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   407
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   408
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   409
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   410
      ++bytesRead;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   411
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   412
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   413
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   414
  // Properties of received frames.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   415
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   416
  if (m_present & RADIOTAP_RX_FLAGS) // bit 14
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   417
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   418
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   419
      start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   420
      bytesRead += 2;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   421
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   422
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   423
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   424
  // MCS field.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   425
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   426
  if (m_present & RADIOTAP_MCS) // bit 19
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   427
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   428
      m_mcsKnown = start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   429
      m_mcsFlags = start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   430
      m_mcsRate = start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   431
      bytesRead += 3;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   432
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   433
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   434
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   435
  // A-MPDU Status, information about the received or transmitted A-MPDU.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   436
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   437
  if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   438
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   439
      m_ampduStatusPad = ((4 - bytesRead % 4) % 4);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   440
      start.Next (m_ampduStatusPad);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   441
      m_ampduStatusRef = start.ReadU32 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   442
      m_ampduStatusFlags = start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   443
      m_ampduStatusCRC = start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   444
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   445
      bytesRead += (8 + m_ampduStatusPad);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   446
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   447
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   448
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   449
  // Information about the received or transmitted VHT frame.
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   450
  //
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   451
  if (m_present & RADIOTAP_VHT) // bit 21
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   452
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   453
      //not yet implemented
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   454
      start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   455
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   456
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   457
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   458
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   459
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   460
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   461
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   462
      start.ReadU8 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   463
      start.ReadU16 ();
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   464
      bytesRead += 12;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   465
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   466
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   467
  NS_ASSERT_MSG (m_length == bytesRead, "RadiotapHeader::Deserialize(): expected and actual lengths inconsistent");
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   468
  return bytesRead;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   469
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   470
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   471
void
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   472
RadiotapHeader::Print (std::ostream &os) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   473
{
9144
6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents: 9063
diff changeset
   474
  NS_LOG_FUNCTION (this << &os);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   475
  os << " tsft=" << m_tsft
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   476
     << " flags=" << std::hex << m_flags << std::dec
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   477
     << " rate=" << (uint16_t) m_rate
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   478
     << " freq=" << m_channelFreq
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   479
     << " chflags=" << std::hex << (uint32_t)m_channelFlags << std::dec
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   480
     << " signal=" << (int16_t) m_antennaSignal
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   481
     << " noise=" << (int16_t) m_antennaNoise
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   482
     << " mcsKnown=" << m_mcsKnown
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   483
     << " mcsFlags=" << m_mcsFlags
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   484
     << " mcsRate=" << m_mcsRate
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   485
     << " ampduStatusFlags=" << (int16_t) m_ampduStatusFlags;
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   486
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   487
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   488
void
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   489
RadiotapHeader::SetTsft (uint64_t value)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   490
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   491
  NS_LOG_FUNCTION (this << value);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   492
  m_tsft = value;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   493
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   494
  if (!(m_present & RADIOTAP_TSFT))
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   495
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   496
      m_present |= RADIOTAP_TSFT;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   497
      m_length += 8;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   498
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   499
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   500
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   501
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   502
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   503
uint64_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   504
RadiotapHeader::GetTsft () const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   505
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   506
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   507
  return m_tsft;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   508
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   509
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   510
void
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   511
RadiotapHeader::SetFrameFlags (uint8_t flags)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   512
{
9157
2d4305dd159a Fix printing of uint8_t data in NS_LOG_FUNCTION introduced by 9144:6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents: 9144
diff changeset
   513
  NS_LOG_FUNCTION (this << static_cast<uint32_t> (flags));
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   514
  m_flags = flags;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   515
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   516
  if (!(m_present & RADIOTAP_FLAGS))
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   517
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   518
      m_present |= RADIOTAP_FLAGS;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   519
      m_length += 1;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   520
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   521
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   522
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   523
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   524
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   525
uint8_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   526
RadiotapHeader::GetFrameFlags (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   527
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   528
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   529
  return m_flags;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   530
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   531
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   532
void
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   533
RadiotapHeader::SetRate (uint8_t rate)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   534
{
9157
2d4305dd159a Fix printing of uint8_t data in NS_LOG_FUNCTION introduced by 9144:6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents: 9144
diff changeset
   535
  NS_LOG_FUNCTION (this << static_cast<uint32_t> (rate));
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   536
  m_rate = rate;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   537
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   538
  if (!(m_present & RADIOTAP_RATE))
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   539
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   540
      m_present |= RADIOTAP_RATE;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   541
      m_length += 1;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   542
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   543
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   544
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   545
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   546
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   547
uint8_t
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   548
RadiotapHeader::GetRate (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   549
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   550
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   551
  return m_rate;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   552
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   553
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   554
void
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   555
RadiotapHeader::SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags)
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   556
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   557
  NS_LOG_FUNCTION (this << frequency << flags);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   558
  m_channelFreq = frequency;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   559
  m_channelFlags = flags;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   560
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   561
  if (!(m_present & RADIOTAP_CHANNEL))
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   562
    {
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   563
      m_channelPad = ((2 - m_length % 2) % 2);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   564
      m_present |= RADIOTAP_CHANNEL;
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   565
      m_length += (4 + m_channelPad);
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   566
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   567
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   568
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   569
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   570
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   571
uint16_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   572
RadiotapHeader::GetChannelFrequency (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   573
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   574
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   575
  return m_channelFreq;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   576
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   577
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   578
uint16_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   579
RadiotapHeader::GetChannelFlags (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   580
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   581
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   582
  return m_channelFlags;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   583
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   584
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   585
void
7027
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   586
RadiotapHeader::SetAntennaSignalPower (double signal)
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   587
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   588
  NS_LOG_FUNCTION (this << signal);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   589
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   590
  if (!(m_present & RADIOTAP_DBM_ANTSIGNAL))
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   591
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   592
      m_present |= RADIOTAP_DBM_ANTSIGNAL;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   593
      m_length += 1;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   594
    }
7027
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   595
  if (signal > 127)
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   596
    {
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   597
      m_antennaSignal = 127;
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   598
    }
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   599
  else if (signal < -128)
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   600
    {
7027
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   601
      m_antennaSignal = -128;
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   602
    }
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   603
  else
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   604
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7182
diff changeset
   605
      m_antennaSignal = static_cast<int8_t> (floor (signal + 0.5));
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   606
    }
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   607
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   608
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   609
}
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   610
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   611
uint8_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   612
RadiotapHeader::GetAntennaSignalPower (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   613
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   614
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   615
  return m_antennaSignal;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   616
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   617
7182
5ecfee5d17de network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents: 7027
diff changeset
   618
void
7027
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   619
RadiotapHeader::SetAntennaNoisePower (double noise)
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   620
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   621
  NS_LOG_FUNCTION (this << noise);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   622
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   623
  if (!(m_present & RADIOTAP_DBM_ANTNOISE))
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   624
    {
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   625
      m_present |= RADIOTAP_DBM_ANTNOISE;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   626
      m_length += 1;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   627
    }
7027
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   628
  if (noise > 127.0)
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   629
    {
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   630
      m_antennaNoise = 127;
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   631
    }
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   632
  else if (noise < -128.0)
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   633
    {
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   634
      m_antennaNoise = -128;
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   635
    }
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   636
  else
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   637
    {
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   638
      m_antennaNoise = static_cast<int8_t> (floor (noise + 0.5));
169e09e9428d avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents: 6823
diff changeset
   639
    }
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   640
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   641
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   642
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   643
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   644
uint8_t
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   645
RadiotapHeader::GetAntennaNoisePower (void) const
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   646
{
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   647
  NS_LOG_FUNCTION (this);
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   648
  return m_antennaNoise;
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   649
}
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   650
11479
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   651
void
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   652
RadiotapHeader::SetMcsFields (uint8_t known, uint8_t flags, uint8_t mcs)
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   653
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   654
  NS_LOG_FUNCTION (this << known << flags << mcs);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   655
  m_mcsKnown = known;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   656
  m_mcsFlags = flags;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   657
  m_mcsRate = mcs;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   658
  if (!(m_present & RADIOTAP_MCS))
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   659
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   660
      m_present |= RADIOTAP_MCS;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   661
      m_length += 3;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   662
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   663
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   664
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   665
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   666
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   667
uint8_t
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   668
RadiotapHeader::GetMcsKnown () const
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   669
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   670
  NS_LOG_FUNCTION (this);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   671
  return m_mcsKnown;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   672
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   673
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   674
uint8_t
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   675
RadiotapHeader::GetMcsFlags () const
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   676
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   677
  NS_LOG_FUNCTION (this);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   678
  return m_mcsFlags;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   679
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   680
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   681
uint8_t
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   682
RadiotapHeader::GetMcsRate () const
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   683
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   684
  NS_LOG_FUNCTION (this);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   685
  return m_mcsRate;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   686
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   687
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   688
void
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   689
RadiotapHeader::SetAmpduStatus (uint32_t referenceNumber, uint16_t flags, uint8_t crc)
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   690
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   691
  NS_LOG_FUNCTION (this << referenceNumber << flags);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   692
  m_ampduStatusRef = referenceNumber;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   693
  m_ampduStatusFlags = flags;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   694
  m_ampduStatusCRC = crc;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   695
  if (!(m_present & RADIOTAP_AMPDU_STATUS))
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   696
    {
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   697
      m_ampduStatusPad = ((4 - m_length % 4) % 4);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   698
      m_present |= RADIOTAP_AMPDU_STATUS;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   699
      m_length += (8 + m_ampduStatusPad);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   700
    }
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   701
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   702
  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   703
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   704
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   705
uint32_t
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   706
RadiotapHeader::GetAmpduStatusRef () const
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   707
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   708
  NS_LOG_FUNCTION (this);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   709
  return m_ampduStatusRef;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   710
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   711
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   712
uint16_t
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   713
RadiotapHeader::GetAmpduStatusFlags () const
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   714
{
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   715
  NS_LOG_FUNCTION (this);
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   716
  return m_ampduStatusFlags;
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   717
}
a3dcf66928f3 add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents: 11238
diff changeset
   718
6009
e1b696a1ed28 redo pcap tracing
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
   719
} // namespace ns3