src/wifi/model/capability-information.h
author Sébastien Deronne <sebastien.deronne@gmail.com>
Thu, 16 Oct 2014 13:26:10 -0700
changeset 11033 2198f9c998cc
parent 10483 e3a02ed14587
child 11450 9f4ae69f12b7
permissions -rw-r--r--
bug 1970: Missing NotifyAckTimeoutStartNow in MacLow::StartDataTxTimers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7141
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
1937
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2006 INRIA
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
1937
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#ifndef CAPABILITY_INFORMATION_H
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#define CAPABILITY_INFORMATION_H
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include <stdint.h>
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    24
#include "ns3/buffer.h"
1937
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
namespace ns3 {
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    28
/**
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    29
 * \ingroup wifi
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    30
 *
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    31
 * Capability information
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    32
 */
7141
072fb225b714 run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents: 7139
diff changeset
    33
class CapabilityInformation
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    34
{
1937
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
public:
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
  CapabilityInformation ();
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    38
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    39
   * Set the Extended Service Set (ESS) bit
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    40
   * in the capability information field.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    41
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    42
  void SetEss (void);
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    43
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    44
   * Set the Independent BSS (IBSS) bit
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    45
   * in the capability information field.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    46
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    47
  void SetIbss (void);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    48
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    49
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    50
   * Check if the Extended Service Set (ESS) bit
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    51
   * in the capability information field is set to 1.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    52
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    53
   * \return ESS bit in the capability information
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    54
   *         field is set to 1
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    55
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    56
  bool IsEss (void) const;
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    57
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    58
   * Check if the Independent BSS (IBSS) bit
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    59
   * in the capability information field is set to 1.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    60
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    61
   * \return IBSS bit in the capability information
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    62
   *         field is set to 1
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    63
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    64
  bool IsIbss (void) const;
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    65
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    66
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    67
   * Return the serialized size of capability 
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    68
   * information.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    69
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    70
   * \return the serialized size
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    71
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    72
  uint32_t GetSerializedSize (void) const;
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    73
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    74
   * Serialize capability information to the given buffer.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    75
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    76
   * \param start an iterator to a buffer
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    77
   * \return an iterator to a buffer after capability information
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    78
   *         was serialized
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    79
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    80
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    81
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    82
   * Deserialize capability information from the given buffer.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    83
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    84
   * \param start an iterator to a buffer
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    85
   * \return an iterator to a buffer after capability information
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    86
   *         was deserialized
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    87
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    88
  Buffer::Iterator Deserialize (Buffer::Iterator start);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    89
private:
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    90
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    91
   * Check if bit n is set to 1.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    92
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    93
   * \param n the bit position
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    94
   * \return true if bit n is set to 1,
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    95
   *         false otherwise
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    96
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
    97
  bool Is (uint8_t n) const;
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    98
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
    99
   * Set bit n to 1.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   100
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   101
   * \param n the bit position
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   102
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
   103
  void Set (uint8_t n);
10483
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   104
  /**
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   105
   * Set bit n to 0.
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   106
   *
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   107
   * \param n the bit position
e3a02ed14587 [doxygen] wifi module
Daniel Lertpratchya <nikkipui@gmail.com>
parents: 7385
diff changeset
   108
   */
1939
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
   109
  void Clear (uint8_t n);
40af0232df83 add management frame implementations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1937
diff changeset
   110
  uint16_t m_capability;
1937
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   111
};
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   112
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   113
} // namespace ns3
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   114
996383a87ae3 add new code to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   115
#endif /* CAPABILITY_INFORMATION_H */