src/helper/mesh-interface-helper.cc
author Kirill Andreev <andreev@iitp.ru>
Tue, 28 Jul 2009 20:22:15 +0400
changeset 5136 6ad13efaccd7
parent 5128 d6e168eba404
child 5138 b193dca2b479
permissions -rw-r--r--
QosFix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     2
/*
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     3
 * Copyright (c) 2008,2009 IITP RAS
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     4
 *
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     8
 *
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    13
 *
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    17
 *
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    18
 * Author: Kirill Andreev <andreev@iitp.ru>
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    19
 */
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    20
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    21
5055
903fb7d81b97 Restructured mesh - helper
Kirill Andreev <andreev@iitp.ru>
parents: 5054
diff changeset
    22
#include "mesh-interface-helper.h"
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    23
#include "ns3/wifi-mac.h"
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    24
#include "ns3/pointer.h"
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    25
#include "ns3/dca-txop.h"
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    26
#include "ns3/wifi-remote-station-manager.h"
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
    27
namespace ns3
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
    28
{
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    29
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    30
MeshInterfaceHelper::MeshInterfaceHelper ()
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    31
{
5114
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    32
  m_queues.insert (std::make_pair (AC_VO, ObjectFactory ()));
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    33
  m_queues.insert (std::make_pair (AC_VI, ObjectFactory ()));
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    34
  m_queues.insert (std::make_pair (AC_BE, ObjectFactory ()));
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    35
  m_queues.insert (std::make_pair (AC_BK, ObjectFactory ()));
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    36
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    37
  m_queues[AC_VO].SetTypeId ("ns3::DcaTxop");
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    38
  m_queues[AC_VI].SetTypeId ("ns3::DcaTxop");
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    39
  m_queues[AC_BE].SetTypeId ("ns3::DcaTxop");
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    40
  m_queues[AC_BK].SetTypeId ("ns3::DcaTxop");
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    41
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    42
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    43
MeshInterfaceHelper::~MeshInterfaceHelper ()
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    44
{}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    45
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    46
MeshInterfaceHelper
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    47
MeshInterfaceHelper::Default (void)
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    48
{
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    49
  MeshInterfaceHelper helper;
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    50
  helper.SetType ();
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    51
  helper.SetRemoteStationManager ("ns3::ArfWifiManager");
5136
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    52
    /* For more details about this default parameters see IEE802.11 section 7.3.2.29 */
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    53
  helper.SetQueueParameters (AC_VO, "MinCw", UintegerValue (3), "MaxCw", UintegerValue (7), "Aifsn",
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    54
      UintegerValue (2));
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    55
  helper.SetQueueParameters (AC_VI, "MinCw", UintegerValue (7), "MaxCw", UintegerValue (15), "Aifsn",
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    56
      UintegerValue (2));
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    57
  helper.SetQueueParameters (AC_BE, "MinCw", UintegerValue (15), "MaxCw", UintegerValue (1023), "Aifsn",
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    58
      UintegerValue (3));
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    59
  helper.SetQueueParameters (AC_BK, "MinCw", UintegerValue (15), "MaxCw", UintegerValue (1023), "Aifsn",
Kirill Andreev <andreev@iitp.ru>
parents: 5128
diff changeset
    60
      UintegerValue (7));
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    61
  return helper;
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    62
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    63
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    64
void
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    65
MeshInterfaceHelper::SetType (std::string n0, const AttributeValue &v0,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    66
                              std::string n1, const AttributeValue &v1,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    67
                              std::string n2, const AttributeValue &v2,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    68
                              std::string n3, const AttributeValue &v3,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    69
                              std::string n4, const AttributeValue &v4,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    70
                              std::string n5, const AttributeValue &v5,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    71
                              std::string n6, const AttributeValue &v6,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    72
                              std::string n7, const AttributeValue &v7)
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    73
{
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    74
  m_mac.SetTypeId ("ns3::MeshWifiInterfaceMac");
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    75
  m_mac.Set (n0, v0);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    76
  m_mac.Set (n1, v1);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    77
  m_mac.Set (n2, v2);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    78
  m_mac.Set (n3, v3);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    79
  m_mac.Set (n4, v4);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    80
  m_mac.Set (n5, v5);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    81
  m_mac.Set (n6, v6);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    82
  m_mac.Set (n7, v7);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    83
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    84
void
5114
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    85
MeshInterfaceHelper::SetQueueParameters ( AccessClass ac,
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    86
    std::string n0, const AttributeValue &v0,
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    87
    std::string n1, const AttributeValue &v1,
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    88
    std::string n2, const AttributeValue &v2,
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    89
    std::string n3, const AttributeValue &v3)
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    90
{
5114
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    91
  std::map<AccessClass, ObjectFactory>::iterator queue = m_queues.find (ac);
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    92
  if (queue != m_queues.end ())
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    93
    {
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    94
      queue->second.Set (n0, v0);
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    95
      queue->second.Set (n1, v1);
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    96
      queue->second.Set (n2, v2);
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    97
      queue->second.Set (n3, v3);
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    98
    }
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
    99
  else
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
   100
  {
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
   101
    NS_FATAL_ERROR ("Queue is not set!");
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
   102
  }
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   103
}
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   104
void
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   105
MeshInterfaceHelper::SetRemoteStationManager (std::string type,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   106
                                     std::string n0, const AttributeValue &v0,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   107
                                     std::string n1, const AttributeValue &v1,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   108
                                     std::string n2, const AttributeValue &v2,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   109
                                     std::string n3, const AttributeValue &v3,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   110
                                     std::string n4, const AttributeValue &v4,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   111
                                     std::string n5, const AttributeValue &v5,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   112
                                     std::string n6, const AttributeValue &v6,
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   113
                                     std::string n7, const AttributeValue &v7)
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   114
{
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   115
  m_stationManager = ObjectFactory ();
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   116
  m_stationManager.SetTypeId (type);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   117
  m_stationManager.Set (n0, v0);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   118
  m_stationManager.Set (n1, v1);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   119
  m_stationManager.Set (n2, v2);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   120
  m_stationManager.Set (n3, v3);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   121
  m_stationManager.Set (n4, v4);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   122
  m_stationManager.Set (n5, v5);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   123
  m_stationManager.Set (n6, v6);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   124
  m_stationManager.Set (n7, v7);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   125
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   126
Ptr<WifiNetDevice>
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   127
MeshInterfaceHelper::CreateInterface (const WifiPhyHelper &phyHelper, Ptr<Node> node, uint16_t channelId) const
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   128
{
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   129
  Ptr<WifiNetDevice> device = CreateObject<WifiNetDevice> ();
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   130
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   131
  Ptr<MeshWifiInterfaceMac> mac = DynamicCast<MeshWifiInterfaceMac> (Create ());
5057
95a72c98f08d Added dot11s installator, fixed bug with adding tag in proactive mode of HWMP
Kirill Andreev <andreev@iitp.ru>
parents: 5055
diff changeset
   132
  NS_ASSERT (mac != 0);
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   133
  mac->SetSsid (Ssid ());
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   134
  Ptr<WifiRemoteStationManager> manager = m_stationManager.Create<WifiRemoteStationManager> ();
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   135
  Ptr<WifiPhy> phy = phyHelper.Create (node, device);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   136
  mac->SetAddress (Mac48Address::Allocate ());
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   137
  device->SetMac (mac);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   138
  device->SetPhy (phy);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   139
  device->SetRemoteStationManager (manager);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   140
  node->AddDevice (device);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   141
  mac->SwitchFrequencyChannel (channelId);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   142
  return device;
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   143
}
5057
95a72c98f08d Added dot11s installator, fixed bug with adding tag in proactive mode of HWMP
Kirill Andreev <andreev@iitp.ru>
parents: 5055
diff changeset
   144
Ptr<WifiMac>
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   145
MeshInterfaceHelper::Create (void) const
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   146
{
5114
505e762ea818 Initial QoS implementation in 802.11s
Kirill Andreev <andreev@iitp.ru>
parents: 5057
diff changeset
   147
  Ptr<MeshWifiInterfaceMac> mac = m_mac.Create<MeshWifiInterfaceMac> ();
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   148
  for (std::map<AccessClass, ObjectFactory>::const_iterator i = m_queues.begin (); i != m_queues.end (); i++)
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   149
    {
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   150
      mac->SetQueue (i->second.Create<DcaTxop> (), i->first);
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   151
    }
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   152
  return mac;
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   153
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   154
void
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   155
MeshInterfaceHelper::Report (const Ptr<WifiNetDevice>& device, std::ostream& os)
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   156
{
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   157
  Ptr<MeshWifiInterfaceMac> mac = device->GetMac ()->GetObject<MeshWifiInterfaceMac> ();
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   158
  NS_ASSERT (mac != 0);
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   159
  mac->Report (os);
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   160
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   161
void
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   162
MeshInterfaceHelper::ResetStats (const Ptr<WifiNetDevice>& device)
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   163
{
5128
d6e168eba404 Fixed coding style in helpers and mesh
Kirill Andreev <andreev@iitp.ru>
parents: 5114
diff changeset
   164
  Ptr<MeshWifiInterfaceMac> mac = device->GetMac ()->GetObject<MeshWifiInterfaceMac> ();
5054
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   165
  NS_ASSERT (mac != 0);
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   166
  mac->ResetStats ();
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   167
}
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   168
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   169
} //namespace ns3
49851228eec9 Added interface helper
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   170