src/devices/wifi/wifi-remote-station-manager.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 02 Mar 2008 06:43:12 +0100
changeset 2530 05f9cec44621
parent 2524 db72c0e7743e
child 2602 d9262bff6df2
permissions -rw-r--r--
avoid memory leaks
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
 */
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    20
#ifndef WIFI_REMOTE_STATION_MANAGER_H
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    21
#define WIFI_REMOTE_STATION_MANAGER_H
1893
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"
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    27
#include "ns3/object.h"
1911
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
    28
#include "wifi-mode.h"
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    29
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    30
namespace ns3 {
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    31
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    32
class WifiRemoteStation;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    33
class NonUnicastWifiRemoteStation;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    34
class WifiPhy;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    36
class WifiRemoteStationManager : public Object
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
    37
{
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
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
    39
  typedef std::vector<WifiMode> BasicModes;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
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
    41
  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
    42
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    43
  static TypeId GetTypeId (void);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    44
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    45
  WifiRemoteStationManager ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    46
  virtual ~WifiRemoteStationManager ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    47
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    48
  virtual void SetupPhy (Ptr<WifiPhy> phy);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    49
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    50
  uint32_t GetMaxSsrc (void) const;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    51
  uint32_t GetMaxSlrc (void) const;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    52
  uint32_t GetRtsCtsThreshold (void) const;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    53
  uint32_t GetFragmentationThreshold (void) const;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    54
  void SetMaxSsrc (uint32_t maxSsrc);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    55
  void SetMaxSlrc (uint32_t maxSlrc);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    56
  void SetRtsCtsThreshold (uint32_t threshold);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    57
  void SetFragmentationThreshold (uint32_t threshold);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
  
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
    59
  // 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
    60
  // 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
    61
  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
    62
  // 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
    63
  // 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
    64
  // 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
    65
  // 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
    66
  // 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
    67
  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
    68
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
    69
  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
    70
  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
    71
  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
    72
  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
    73
  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
    74
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
    75
  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
    76
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    77
  WifiRemoteStation *Lookup (Mac48Address address);
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    78
  WifiRemoteStation *LookupNonUnicast (void);
2530
05f9cec44621 avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2524
diff changeset
    79
protected:
05f9cec44621 avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2524
diff changeset
    80
  virtual void DoDispose (void);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    81
private:
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    82
  typedef std::vector <std::pair<Mac48Address, WifiRemoteStation *> > Stations;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    83
  virtual class WifiRemoteStation *CreateStation (void) = 0;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    84
  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
    85
  WifiMode m_defaultTxMode;
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    86
  NonUnicastWifiRemoteStation *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
    87
  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
    88
  bool m_isLowLatency;
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    89
  uint32_t m_maxSsrc;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    90
  uint32_t m_maxSlrc;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    91
  uint32_t m_rtsCtsThreshold;
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    92
  uint32_t m_fragmentationThreshold;
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    93
};
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    94
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    95
} // namespace ns3
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    96
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    97
namespace ns3 {
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
    98
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
    99
class WifiRemoteStation {
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   100
public:
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
   101
  WifiRemoteStation ();
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
   102
  virtual ~WifiRemoteStation ();
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   103
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
   104
  // 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
   105
  // 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
   106
  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
   107
  // 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
   108
  // 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
   109
  // 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
   110
  // 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
   111
  // 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
   112
  void AddSupportedMode (WifiMode mode);
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   113
2003
335dc094e52a support BRAND_NEW station in adhoc code. initialize the supported rates.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1982
diff changeset
   114
  bool IsBrandNew (void) const;
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   115
  bool IsAssociated (void) const;
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   116
  bool IsWaitAssocTxOk (void) const;
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   117
  void RecordWaitAssocTxOk (void);
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   118
  void RecordGotAssocTxOk (void);
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   119
  void RecordGotAssocTxFailed (void);
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   120
  void RecordDisassociated (void);
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   121
2268
0e57ac711220 introduce a low latency parameter for rate control algorithms
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2003
diff changeset
   122
  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
   123
  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
   124
  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
   125
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   126
  // 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
   127
  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
   128
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   129
  // transmission-related methods
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   130
  virtual void ReportRtsFailed (void) = 0;
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   131
  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
   132
  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
   133
  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
   134
  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
   135
  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
   136
  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
   137
  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
   138
  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
   139
  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
   140
  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
   141
  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
   142
  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
   143
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   144
  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
   145
  WifiMode GetAckMode (WifiMode dataMode);
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   146
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   147
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
   148
  typedef std::vector<WifiMode> SupportedModes;
2524
db72c0e7743e port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2508
diff changeset
   149
  virtual Ptr<WifiRemoteStationManager> GetManager (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
   150
  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
   151
  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
   152
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
   153
  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
   154
  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
   155
private:
e24ae66c6918 use WifiMode rather than mode indexes in MacStations API.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1908
diff changeset
   156
  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
   157
  WifiMode GetControlAnswerMode (WifiMode reqMode);
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   158
  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
   159
    BRAND_NEW,
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   160
    DISASSOC,
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   161
    WAIT_ASSOC_TX_OK,
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   162
    GOT_ASSOC_TX_OK
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   163
  } 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
   164
  SupportedModes m_modes;
1906
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   165
};
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   166
c0901f40bd7e move mac-station code in mac-stations
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1893
diff changeset
   167
} // namespace ns3 
1893
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   168
d72388b06b22 add MacStations to build
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   169
#endif /* MAC_STATIONS_H */