src/devices/wifi/supported-rates.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 02 Jul 2008 03:16:36 -0700
changeset 3365 6409d2460601
parent 2013 4a5335c67eac
permissions -rw-r--r--
bug 245: build failure with gcc 4.3.x
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1936
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2006 INRIA
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
61d6404e66d8 add SupportedRates 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
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as 
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
61d6404e66d8 add SupportedRates 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,
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
61d6404e66d8 add SupportedRates 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
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
61d6404e66d8 add SupportedRates 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
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#ifndef SUPPORTED_RATES_H
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#define SUPPORTED_RATES_H
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#include <stdint.h>
3365
6409d2460601 bug 245: build failure with gcc 4.3.x
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2013
diff changeset
    24
#include <ostream>
1936
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "ns3/buffer.h"
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
namespace ns3 {
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
class SupportedRates {
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
public:
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
  SupportedRates ();
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
  void AddSupportedRate (uint32_t bs);
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
  void SetBasicRate (uint32_t bs);
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    36
  bool IsSupportedRate (uint32_t bs) const;
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    37
  bool IsBasicRate (uint32_t bs) const;
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    38
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
  uint8_t GetNRates (void) const;
2013
4a5335c67eac add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1938
diff changeset
    40
  uint32_t GetRate (uint8_t i) const;
1936
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
  uint32_t GetSerializedSize (void) const;
1938
f7e9802ea8e3 add serialization/deserialization support to Ssid/SupportedRates
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1936
diff changeset
    43
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
f7e9802ea8e3 add serialization/deserialization support to Ssid/SupportedRates
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1936
diff changeset
    44
  Buffer::Iterator Deserialize (Buffer::Iterator start);
1936
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
private:
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
  uint8_t m_nRates;
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
  uint8_t m_rates[8];
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
};
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
2013
4a5335c67eac add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1938
diff changeset
    50
std::ostream &operator << (std::ostream &os, const SupportedRates &rates);
4a5335c67eac add printing support
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1938
diff changeset
    51
1936
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
} // namespace ns3
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
61d6404e66d8 add SupportedRates to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
#endif /* SUPPORTED_RATES_H */