src/devices/mesh/dot11s/peer-management-protocol.h
author Kirill Andreev <andreev@iitp.ru>
Wed, 20 May 2009 19:12:51 +0400
changeset 5013 290579bb1c1b
parent 5012 c81291702113
child 5017 a2a6accbc167
permissions -rw-r--r--
ResetStats added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     2
/*
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     3
 * Copyright (c) 2008,2009 IITP RAS
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     4
 *
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     8
 *
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    13
 *
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    17
 *
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    18
 * Authors: Kirill Andreev <andreev@iitp.ru>
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    19
 *          Aleksey Kovalenko <kovalenko@iitp.ru>
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    20
 */
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    21
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    22
4858
78437693dcc7 Peer manager restructure - unfinished
Kirill Andreev <andreev@iitp.ru>
parents: 4857
diff changeset
    23
#ifndef DOT11S_PEER_MAN_H
78437693dcc7 Peer manager restructure - unfinished
Kirill Andreev <andreev@iitp.ru>
parents: 4857
diff changeset
    24
#define DOT11S_PEER_MAN_H
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    25
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    26
#include "ns3/mac48-address.h"
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4882
diff changeset
    27
#include "ns3/net-device.h"
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    28
#include "ns3/event-id.h"
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4882
diff changeset
    29
#include "ns3/nstime.h"
4882
3eab2f6b1adc Moved hwmp to dot11s, removed unneded files, removed unneded headers from
Kirill Andreev <andreev@iitp.ru>
parents: 4881
diff changeset
    30
#include "ie-dot11s-beacon-timing.h"
4899
50591b95753a dot11s-codes.h removed. StatusCode enum is found to be unused and removed. ReadonCode enum is moved to dot11s/ie-dot11s-peer-management.h
Pavel Boyko <boyko@iitp.ru>
parents: 4898
diff changeset
    31
#include "ie-dot11s-peer-management.h"
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    32
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
    33
#include <map>
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    34
namespace ns3 {
4888
dec245c213ab Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents: 4887
diff changeset
    35
class MeshPointDevice;
4872
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
    36
namespace dot11s {
4873
3e5607e26273 Dot11s prefix removed
Kirill Andreev <andreev@iitp.ru>
parents: 4872
diff changeset
    37
class PeerManagerMacPlugin;
4865
e331ed5d3662 Added header for peer link frame (first fields without information element)
Kirill Andreev <andreev@iitp.ru>
parents: 4861
diff changeset
    38
class PeerLink;
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4882
diff changeset
    39
class IePeerManagement;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4882
diff changeset
    40
class IeConfiguration;
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    41
/**
4860
bb5194d57734 New peer management protocol moved to 802.11s/
Pavel Boyko <boyko@iitp.ru>
parents: 4858
diff changeset
    42
 * \ingroup dot11s
4881
cec7f8e2bbdf Minor cosmetics. Peer management protocol is assumed to be implemented now.
Pavel Boyko <boyko@iitp.ru>
parents: 4879
diff changeset
    43
 * 
cec7f8e2bbdf Minor cosmetics. Peer management protocol is assumed to be implemented now.
Pavel Boyko <boyko@iitp.ru>
parents: 4879
diff changeset
    44
 * \brief 802.11s Peer Management Protocol model 
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    45
 */
4919
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
    46
class PeerManagementProtocol : public Object
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    47
{
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    48
public:
4919
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
    49
  PeerManagementProtocol ();
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
    50
  ~PeerManagementProtocol ();
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    51
  static TypeId GetTypeId ();
5005
8038200dac53 Fixed removing peer links
Kirill Andreev <andreev@iitp.ru>
parents: 5003
diff changeset
    52
  void DoDispose ();
4898
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    53
  /** 
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    54
   * \brief Install PMP on given mesh point. 
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    55
   * 
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    56
   * Installing protocol cause installing its interface MAC plugins.
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    57
   *  
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    58
   * Also MP aggregates all installed protocols, PMP protocol can be accessed 
4919
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
    59
   * via MeshPointDevice::GetObject<PeerManagementProtocol>();
4898
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    60
   */
4888
dec245c213ab Attach interfaces replaced with Install. Helper is simplifyed
Kirill Andreev <andreev@iitp.ru>
parents: 4887
diff changeset
    61
  bool Install(Ptr<MeshPointDevice>);
4898
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    62
  /** 
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    63
   * \brief Methods that handle beacon sending/receiving procedure.
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    64
   * 
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    65
   * This methods interact with MAC_layer plug-in
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    66
   * \{
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    67
   */
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    68
  /**
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
    69
   * \brief When we are sending a beacon - we fill beacon timing
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
    70
   * element
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
    71
   * \param IeBeaconTiming is a beacon timing element that
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    72
   * should be present in beacon
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    73
   * \param interface is a interface sending a beacon
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    74
   */
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
    75
  Ptr<IeBeaconTiming> GetBeaconTimingElement(uint32_t interface);
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    76
  /**
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    77
   * \brief When we receive a beacon from peer-station, we remember
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    78
   * its beacon timing element (needed for peer choosing mechanism),
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    79
   * and remember beacon timers - last beacon and beacon interval to
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    80
   * detect beacon loss and cancel links
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    81
   * \param interface is a interface on which beacon was received
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    82
   * \param timingElement is a timing element of remote beacon
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    83
   */
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
    84
  void UpdatePeerBeaconTiming(
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    85
      uint32_t interface,
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    86
      bool meshBeacon,
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
    87
      IeBeaconTiming timingElement,
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    88
      Mac48Address peerAddress,
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    89
      Time receivingTime,
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    90
      Time beaconInterval
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
    91
      );
4898
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
    92
  //\}
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    93
  /**
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    94
   * \brief Methods that handle Peer link management frames
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    95
   * interaction:
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    96
   * \{
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    97
   */
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    98
  /**
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
    99
   * Deliver Peer link management information to the protocol-part
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   100
   * \param void is returning value - we pass a frame and forget
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   101
   * about it
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   102
   * \param uint32_t - is a interface ID of a given MAC (interfaceID rather
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   103
   * than MAC address, beacause many interfaces may have the same MAC)
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   104
   * \param Mac48Address is address of peer
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   105
   * \param Mac48Address is address of peer mesh point device (equal
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   106
   * to peer address when only one interface)
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   107
   * \param uint16_t is association ID, which peer has assigned to
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   108
   * us
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   109
   * \param IeConfiguration is mesh configuration element
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   110
   * taken from the peer management frame
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   111
   * \param IePeerManagement is peer link management element
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   112
   */
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   113
  void ReceivePeerLinkFrame(
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   114
      uint32_t interface,
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   115
      Mac48Address peerAddress,
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   116
      Mac48Address peerMeshPointAddress,
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   117
      uint16_t aid,
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   118
      IePeerManagement peerManagementElement,
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   119
      IeConfiguration meshConfig
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   120
      );
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   121
  /**
4867
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   122
   * Cancell peer link due to broken configuration (SSID or Supported
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   123
   * rates)
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   124
   */
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   125
  void ConfigurationMismatch (uint32_t interface, Mac48Address peerAddress);
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   126
  /**
4870
79f9c2b6dffc Uncommented destructor and cleaner
Kirill Andreev <andreev@iitp.ru>
parents: 4867
diff changeset
   127
   * Checks if there is established link
79f9c2b6dffc Uncommented destructor and cleaner
Kirill Andreev <andreev@iitp.ru>
parents: 4867
diff changeset
   128
   */
79f9c2b6dffc Uncommented destructor and cleaner
Kirill Andreev <andreev@iitp.ru>
parents: 4867
diff changeset
   129
  bool IsActiveLink (uint32_t interface, Mac48Address peerAddress);
4898
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
   130
  //\}
4877
f08902c42733 Added a method to find peer link, code cleanup
Kirill Andreev <andreev@iitp.ru>
parents: 4876
diff changeset
   131
  ///\brief Needed by external module to do MLME
f08902c42733 Added a method to find peer link, code cleanup
Kirill Andreev <andreev@iitp.ru>
parents: 4876
diff changeset
   132
  Ptr<PeerLink> FindPeerLink(uint32_t interface, Mac48Address peerAddress);
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   133
  void SetPeerLinkStatusCallback (Callback<void, Mac48Address, Mac48Address, uint32_t, bool> cb);
4919
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
   134
  std::vector<Mac48Address> GetActiveLinks(uint32_t interface);
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   135
  ///\brief needed by plugins to set global source address
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   136
  Mac48Address GetAddress ();
5009
ac0ea6c1e012 Added statistics for PMP-MAC
Kirill Andreev <andreev@iitp.ru>
parents: 5005
diff changeset
   137
  ///\brief: Report statistics
5012
c81291702113 Statistics - almost done
Kirill Andreev <andreev@iitp.ru>
parents: 5009
diff changeset
   138
  void Report (std::ostream &) const;
5013
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   139
  void ResetStats ();
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   140
private:
4898
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
   141
  /** \name Private structures
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
   142
   * \{
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
   143
   */
b079cb67fda2 For now mesh point aggregates installed protocols. This is done to allow user directly access protocols via mp->GetObject<...>() (though you must known mesh point and protocol class to do this)
Pavel Boyko <boyko@iitp.ru>
parents: 4888
diff changeset
   144
  /// Keeps information about beacon of peer station: beacon interval, association ID, last time we have received a beacon
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   145
  struct BeaconInfo
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   146
  {
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   147
    uint16_t aid; //Assoc ID
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   148
    Time referenceTbtt; //When one of my station's beacons was put into a beacon queue;
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   149
    Time beaconInterval; //Beacon interval of my station;
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   150
  };
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   151
  /// We keep a vector of pointers to PeerLink class. This vector
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   152
  /// keeps all peer links at a given interface.
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   153
  typedef std::vector<Ptr<PeerLink> > PeerLinksOnInterface;
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   154
  /// This map keeps all peer links.
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   155
  ///\param uint32_t is interface ID
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   156
  typedef std::map<uint32_t, PeerLinksOnInterface>  PeerLinksMap;
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   157
  ///\brief This map keeps relationship between peer address and its
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   158
  /// beacon information
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   159
  typedef std::map<Mac48Address, BeaconInfo>  BeaconsOnInterface;
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   160
  ///\brief This map keeps beacon information on all intefaces
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   161
  typedef std::map<uint32_t, BeaconsOnInterface> BeaconInfoMap;
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4874
diff changeset
   162
  ///\brief this vector keeps pointers to MAC-plugins
4873
3e5607e26273 Dot11s prefix removed
Kirill Andreev <andreev@iitp.ru>
parents: 4872
diff changeset
   163
  typedef std::map<uint32_t, Ptr<PeerManagerMacPlugin> > PeerManagerPluginMap;
4874
f7ea3717e668 Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents: 4873
diff changeset
   164
  ///\}
4867
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   165
private:
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   166
  /**
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   167
   * Return a position in beacon-storage for a given remote station
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   168
   */
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   169
  void FillBeaconInfo(uint32_t interface, Mac48Address peerAddress, Time receivingTime, Time beaconInterval);
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   170
  Ptr<PeerLink> InitiateLink (
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   171
      uint32_t interface,
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   172
      Mac48Address peerAddress,
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   173
      Mac48Address peerMeshPointAddress,
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   174
      Time lastBeacon,
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   175
      Time beaconInterval
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   176
      );
4867
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   177
  /**
4874
f7ea3717e668 Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents: 4873
diff changeset
   178
   * \name External peer-chooser
4867
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   179
   * \{
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   180
   */
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   181
  bool ShouldSendOpen (uint32_t interface, Mac48Address peerAddress);
4899
50591b95753a dot11s-codes.h removed. StatusCode enum is found to be unused and removed. ReadonCode enum is moved to dot11s/ie-dot11s-peer-management.h
Pavel Boyko <boyko@iitp.ru>
parents: 4898
diff changeset
   182
  bool ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode & reasonCode);
4867
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   183
  /**
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   184
   * \}
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   185
   * \brief Indicates changes in peer links
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   186
   */
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   187
  void PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddres, bool status);
4879
597d1e0a4bb5 BCA works again
Kirill Andreev <andreev@iitp.ru>
parents: 4877
diff changeset
   188
  ///\brief BCA
597d1e0a4bb5 BCA works again
Kirill Andreev <andreev@iitp.ru>
parents: 4877
diff changeset
   189
  Time GetNextBeaconShift (uint32_t interface);
4867
3a02e4e89292 Finished processing peer link frames on new architeture
Kirill Andreev <andreev@iitp.ru>
parents: 4866
diff changeset
   190
private:
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   191
  PeerManagerPluginMap m_plugins;
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   192
  Mac48Address m_address;
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   193
  /**
4874
f7ea3717e668 Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents: 4873
diff changeset
   194
   * \name Information related to beacons:
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   195
   * \{
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   196
   */
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   197
  BeaconInfoMap m_neighbourBeacons;
4874
f7ea3717e668 Code cleanups. Software delay is removed
Kirill Andreev <andreev@iitp.ru>
parents: 4873
diff changeset
   198
  ///\}
4861
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   199
  uint16_t m_lastAssocId;
20d333d95df2 Neighbours are attached
Kirill Andreev <andreev@iitp.ru>
parents: 4860
diff changeset
   200
  uint16_t m_lastLocalLinkId;
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   201
  uint8_t m_numberOfActivePeers; //number of established peer links
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   202
  uint8_t m_maxNumberOfPeerLinks;
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   203
  /**
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   204
   * Peer Links
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   205
   * \{
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   206
   */
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   207
  PeerLinksMap m_peerLinks;
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   208
  /**
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   209
   * \}
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4865
diff changeset
   210
   */
4919
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
   211
  ///\brief Callback to notify about peer link changes:
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   212
  ///\param Mac48Address is peer address of mesh point
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   213
  ///\param Mac48Address is peer address of interface
4919
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
   214
  ///\param uint32_t - interface ID
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
   215
  ///\param bool is staus - true when new link has appeared, false -
b8a0476c7e06 Added unicast PREQ, peer link status callback.
Kirill Andreev <andreev@iitp.ru>
parents: 4899
diff changeset
   216
  //when link was closed
4933
72f0481cfb2d Peer link restructured to support multi-interface
Kirill Andreev <andreev@iitp.ru>
parents: 4919
diff changeset
   217
  Callback <void, Mac48Address, Mac48Address, uint32_t, bool> m_peerStatusCallback;
5013
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   218
  ///\}
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   219
  //Keeps statistics
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   220
  struct Statistics {
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   221
    uint16_t linksOpened;
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   222
    uint16_t linksClosed;
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   223
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   224
    Statistics () : linksOpened (0), linksClosed (0) {};
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   225
    void Print (std::ostream & os) const;
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   226
  };
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   227
  struct Statistics m_stats;
290579bb1c1b ResetStats added
Kirill Andreev <andreev@iitp.ru>
parents: 5012
diff changeset
   228
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   229
};
4872
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
   230
  
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
   231
} // namespace dot11s
4857
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   232
} //namespace ns3
ddfb13420455 Added new peer manager class, an old one we keep without change
Kirill Andreev <andreev@iitp.ru>
parents:
diff changeset
   233
#endif