src/devices/wifi/mac-stations.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 28 Feb 2008 06:18:02 +0100
changeset 2508 18b690d1e74b
parent 2349 b1df486516a4
permissions -rw-r--r--
MacParameters -> WifiMacParameters
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
1912
028e1945d5b2 fix copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1911
diff changeset
     3
 * Copyright (c) 2005,2006,2007 INRIA
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 *
d72388b06b22 add MacStations 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
d72388b06b22 add MacStations 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 
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 *
d72388b06b22 add MacStations 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,
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * GNU General Public License for more details.
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 *
d72388b06b22 add MacStations 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
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
d72388b06b22 add MacStations 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
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 *
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 */
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    20
#ifndef MAC_STATIONS_H
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
#define MAC_STATIONS_H
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    23
#include <vector>
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
#include <utility>
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include "ns3/mac48-address.h"
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
    26
#include "ns3/packet.h"
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
    27
#include "wifi-mode.h"
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
namespace ns3 {
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
class MacStation;
1982
bafca3fcd557 specify real type
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1935
diff changeset
    32
class NonUnicastMacStation;
2508
18b690d1e74b MacParameters -> WifiMacParameters
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2349
diff changeset
    33
class WifiMacParameters;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    35
class MacStations 
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    36
{
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    37
private:
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    38
  typedef std::vector<WifiMode> BasicModes;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
public:
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    40
  typedef BasicModes::const_iterator BasicModesIterator;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    41
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
    42
  MacStations (WifiMode defaultTxMode);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
  virtual ~MacStations ();
2508
18b690d1e74b MacParameters -> WifiMacParameters
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2349
diff changeset
    44
  void SetParameters (WifiMacParameters *parameters);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
  
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    46
  // Invoked in a STA upon dis-association
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    47
  // or in an AP upon reboot
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    48
  void Reset (void);
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    49
  // Invoked in a STA upon association to store
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    50
  // the set of rates which belong to the 
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    51
  // BSSBasicRateSet of the associated AP
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    52
  // and which are supported locally.
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    53
  // Invoked in an AP to configure the BSSBasicRateSet
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    54
  void AddBasicMode (WifiMode mode);
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    55
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    56
  WifiMode GetDefaultMode (void) const;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    57
  uint32_t GetNBasicModes (void) const;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    58
  WifiMode GetBasicMode (uint32_t i) const;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    59
  BasicModesIterator BeginBasicModes (void) const;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    60
  BasicModesIterator EndBasicModes (void) const;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    61
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
    62
  bool IsLowLatency (void) const;
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
    63
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    64
  MacStation *Lookup (Mac48Address address);
1908
af48a02fe9a2 add MacStations::LookupNonUnicast
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1906
diff changeset
    65
  MacStation *LookupNonUnicast (void);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
private:
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    67
  typedef std::vector <std::pair<Mac48Address, MacStation *> > Stations;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    68
  virtual class MacStation *CreateStation (void) = 0;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    69
  Stations m_stations;
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    70
  WifiMode m_defaultTxMode;
1982
bafca3fcd557 specify real type
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1935
diff changeset
    71
  NonUnicastMacStation *m_nonUnicast;
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    72
  BasicModes m_basicModes;
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
    73
  bool m_isLowLatency;
2508
18b690d1e74b MacParameters -> WifiMacParameters
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2349
diff changeset
    74
  WifiMacParameters *m_parameters;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    75
};
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    76
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    77
} // namespace ns3
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    78
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    79
namespace ns3 {
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    80
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    81
class MacStation {
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    82
public:
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    83
  MacStation ();
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
    84
  virtual ~MacStation ();
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    85
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    86
  // Invoked in an AP upon disassociation of a
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    87
  // specific STA.
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    88
  void Reset (void);
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    89
  // Invoked in a STA or AP to store the set of 
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    90
  // modes supported by a destination which is
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    91
  // also supported locally.
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    92
  // The set of supported modes includes
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    93
  // the BSSBasicRateSet.
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
    94
  void AddSupportedMode (WifiMode mode);
2508
18b690d1e74b MacParameters -> WifiMacParameters
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2349
diff changeset
    95
  void SetParameters (WifiMacParameters *parameters);
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    96
2003
335dc094e52a support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1982
diff changeset
    97
  bool IsBrandNew (void) const;
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    98
  bool IsAssociated (void) const;
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    99
  bool IsWaitAssocTxOk (void) const;
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   100
  void RecordWaitAssocTxOk (void);
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   101
  void RecordGotAssocTxOk (void);
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   102
  void RecordGotAssocTxFailed (void);
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   103
  void RecordDisassociated (void);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   104
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   105
  void PrepareForQueue (Ptr<const Packet> packet, uint32_t fullPacketSize);
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   106
  WifiMode GetDataMode (Ptr<const Packet> packet, uint32_t fullPacketSize);
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   107
  WifiMode GetRtsMode (Ptr<const Packet> packet);
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   108
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   109
  // reception-related method
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   110
  virtual void ReportRxOk (double rxSnr, WifiMode txMode) = 0;
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   111
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   112
  // transmission-related methods
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   113
  virtual void ReportRtsFailed (void) = 0;
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   114
  virtual void ReportDataFailed (void) = 0;
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   115
  virtual void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr) = 0;
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   116
  virtual void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr) = 0;
2269
06c660ffc070 add MacStation::ReportFinal* methods for onoe rate control model
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2268
diff changeset
   117
  virtual void ReportFinalRtsFailed (void) = 0;
06c660ffc070 add MacStation::ReportFinal* methods for onoe rate control model
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2268
diff changeset
   118
  virtual void ReportFinalDataFailed (void) = 0;
2349
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   119
  virtual bool NeedRts (Ptr<const Packet> packet);
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   120
  virtual uint32_t GetMaxSsrc (Ptr<const Packet> packet);
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   121
  virtual uint32_t GetMaxSlrc (Ptr<const Packet> packet);
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   122
  virtual bool NeedFragmentation (Ptr<const Packet> packet);
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   123
  virtual uint32_t GetNFragments (Ptr<const Packet> packet);
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   124
  virtual uint32_t GetFragmentSize (Ptr<const Packet> packet, uint32_t fragmentNumber);
b1df486516a4 allow rate control algorithms to control more per-packet parameters.
Federico Maguolo <maguolof@dei.unipd.it>
parents: 2269
diff changeset
   125
  virtual bool IsLastFragment (Ptr<const Packet> packet, uint32_t fragmentNumber);
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   126
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   127
  WifiMode GetCtsMode (WifiMode rtsMode);
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   128
  WifiMode GetAckMode (WifiMode dataMode);
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   129
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   130
private:
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
   131
  typedef std::vector<WifiMode> SupportedModes;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
   132
  virtual MacStations *GetStations (void) const = 0;
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   133
  virtual WifiMode DoGetDataMode (uint32_t size) = 0;
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   134
  virtual WifiMode DoGetRtsMode (void) = 0;
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   135
protected:
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
   136
  uint32_t GetNSupportedModes (void) const;
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
   137
  WifiMode GetSupportedMode (uint32_t i) const;
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   138
private:
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   139
  bool IsIn (WifiMode mode) const;
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   140
  WifiMode GetControlAnswerMode (WifiMode reqMode);
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   141
  enum {
2003
335dc094e52a support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1982
diff changeset
   142
    BRAND_NEW,
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   143
    DISASSOC,
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   144
    WAIT_ASSOC_TX_OK,
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   145
    GOT_ASSOC_TX_OK
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   146
  } m_state;
1930
ec22299cf6bb rework MacStations to handle correctly Supported vs Basic rate sets and add IdealMacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1913
diff changeset
   147
  SupportedModes m_modes;
2508
18b690d1e74b MacParameters -> WifiMacParameters
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2349
diff changeset
   148
  WifiMacParameters *m_parameters;
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   149
};
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   150
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   151
} // namespace ns3 
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   152
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   153
#endif /* MAC_STATIONS_H */