src/helper/mesh-helper.h
changeset 5086 fccfd0073ea3
parent 5081 869b81c5e774
child 5141 22e79c2a4c5f
equal deleted inserted replaced
5085:5cfc1e9372af 5086:fccfd0073ea3
       
     1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2008,2009 IITP RAS
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License version 2 as
       
     7  * published by the Free Software Foundation;
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    17  *
       
    18  * Author: Kirill Andreev <andreev@iitp.ru>
       
    19  *         Pavel Boyko <boyko@iitp.ru>
       
    20  */
       
    21 
       
    22 
       
    23 #ifndef _MESHWIFIHELPER_H
       
    24 #define _MESHWIFIHELPER_H
       
    25 
       
    26 #include "ns3/wifi-helper.h"
       
    27 #include "ns3/mesh-stack-installer.h"
       
    28 #include "ns3/nstime.h"
       
    29 #include "ns3/mesh-interface-helper.h"
       
    30 
       
    31 namespace ns3 {
       
    32 
       
    33 class WifiChannel;
       
    34 
       
    35 /** 
       
    36  * \ingroup dot11s
       
    37  * 
       
    38  * \brief Helper to create IEEE 802.11s mesh networks
       
    39  */
       
    40 class MeshHelper
       
    41 {
       
    42 public:
       
    43   MeshHelper (); 
       
    44   /** 
       
    45    *  \brief Spread/not spread frequency channels of MP interfaces. 
       
    46    * 
       
    47    *  If set to true different non-overlaping 20MHz frequency 
       
    48    *  channels will be assigned to different mesh point interfaces.
       
    49    */ 
       
    50   void SetSpreadInterfaceChannels (bool); 
       
    51   
       
    52   /** 
       
    53    * \brief Install 802.11s mesh device & protocols on given node list
       
    54    * 
       
    55    * \param phy                 Wifi PHY helper
       
    56    * \param nodes               List of nodes to install
       
    57    * \param roots               List of root mesh points
       
    58    * \param nInterfaces         Number of mesh point radio interfaces (= WiFi NICs)
       
    59    * 
       
    60    * \return list of created mesh point devices, see MeshPointDevice
       
    61    */
       
    62   NetDeviceContainer Install (const WifiPhyHelper &phyHelper, const MeshInterfaceHelper &interfaceHelper, NodeContainer c, uint32_t nInterfaces = 1) const;
       
    63   /** 
       
    64    * \brief Install 802.11s mesh device & protocols on given node
       
    65    * 
       
    66    * \param phy                 Wifi PHY helper
       
    67    * \param node                Node to install
       
    68    * \param roots               List of root mesh points
       
    69    * \param nInterfaces         Number of mesh point radio interfaces (= WiFi NICs)
       
    70    * 
       
    71    * \return list of created mesh point devices, see MeshPointDevice
       
    72    */ 
       
    73   NetDeviceContainer Install (const WifiPhyHelper &phy, const MeshInterfaceHelper &interfaceHelper, Ptr<Node> node, uint32_t nInterfaces = 1) const;
       
    74   /**
       
    75    * \param type the type of ns3::MeshStack.
       
    76    *
       
    77    * All the attributes specified in this method should exist
       
    78    * in the requested station manager.
       
    79    */
       
    80   void SetStackInstaller (std::string type);
       
    81   void Report (const ns3::Ptr<ns3::NetDevice>&, std::ostream&);
       
    82   void ResetStats (const ns3::Ptr<ns3::NetDevice>&);
       
    83 private:
       
    84   bool m_spreadInterfaceChannels;
       
    85   Ptr<MeshStack> m_stack;
       
    86   ObjectFactory m_stackFactory;
       
    87 };
       
    88 } //namespace ns3
       
    89 
       
    90 #endif /* _MESHWIFIHELPER_H */
       
    91