src/devices/mesh/dot11s/hwmp-mac-plugin.h
author Kirill Andreev <andreev@iitp.ru>
Thu, 26 Mar 2009 14:00:46 +0300
changeset 4887 cbf02c77d5c1
parent 4886 bdbf21835837
child 4892 cdd13648776b
permissions -rw-r--r--
HWMP is attached to mesh point device and MAC layer with zero functionality
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     2
/*
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     3
 * Copyright (c) 2008,2009 IITP RAS
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     4
 *
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     8
 *
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    13
 *
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    17
 *
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    18
 * Author: Kirill Andreev <andreev@iitp.ru>
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    19
 */
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    20
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    21
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    22
#ifndef HWMP_STATE_H
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    23
#define HWMP_STATE_H
4886
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    24
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    25
#include "ns3/mesh-wifi-interface-mac-plugin.h"
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    26
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    27
namespace ns3 {
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    28
class MeshWifiInterfaceMac;
4886
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    29
namespace dot11s {
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    30
class HwmpProtocol;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    31
class IePreq;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    32
class IePrep;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    33
class IePerr;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    34
/**
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    35
 * \ingroup mesh
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    36
 */
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    37
class HwmpMacPlugin : public MeshWifiInterfaceMacPlugin
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    38
{
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    39
  public:
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    40
    HwmpMacPlugin (uint32_t, Ptr<HwmpProtocol>);
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    41
    ~HwmpMacPlugin ();
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    42
    ///\name Inherited from MAC plugin
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    43
    //\{
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    44
    void SetParent (Ptr<MeshWifiInterfaceMac> parent);
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    45
    bool Receive (Ptr<Packet> packet, const WifiMacHeader & header);
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    46
    bool UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) const;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    47
    ///\brief Update beacon is empty, because HWMP does not know
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    48
    //anything about beacons
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    49
    void UpdateBeacon (MeshWifiBeacon & beacon) const {};
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    50
    //\}
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    51
  private:
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    52
    friend class HwmpProtocol;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    53
    ///\brief Interaction with protocol:
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    54
    void SendPreq(Ptr<IePreq> preq);
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    55
    void SendPrep(Ptr<IePreq> prep);
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    56
    void SendPerr(Ptr<IePreq> perr);
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    57
  private:
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    58
    Ptr<MeshWifiInterfaceMac> m_parent;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    59
    uint32_t m_ifIndex;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    60
    Ptr<HwmpProtocol> m_protocol;
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    61
};
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
    62
#if 0
4886
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    63
class HwmpMacPlugin : public MeshWifiInterfaceMacPlugin {
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    64
public:
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
    65
  static TypeId GetTypeId ();
4886
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    66
  HwmpMacPlugin ();
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
    67
  ~HwmpMacPlugin ();
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    68
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    69
  /**
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    70
   * \brief Interface with HWMP - Hwmp can only
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    71
   * request address and collect routing
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    72
   * information
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    73
   */
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
    74
  void SetRequestRouteCallback (
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    75
    Callback<HwmpRtable::LookupResult, const Mac48Address&> cb);
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
    76
  void SetRequestRootPathCallback (
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    77
    Callback<HwmpRtable::LookupResult, uint32_t> cb);
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    78
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    79
  enum InfoType {
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    80
    INFO_PREQ,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    81
    INFO_PREP,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    82
    INFO_PERR,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    83
    INFO_PROACTIVE,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    84
    INFO_NEW_PEER,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    85
    INFO_FAILED_PEER
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    86
  };
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    87
  typedef struct RoutingInfo {
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    88
    Mac48Address me;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    89
    Mac48Address destination;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    90
    Mac48Address source;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    91
    Mac48Address nextHop;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    92
    Mac48Address prevHop;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    93
    uint32_t outPort;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    94
    uint32_t metric;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    95
    std::vector<Mac48Address>  failedDestinations;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    96
    uint32_t dsn;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    97
    Time  lifetime;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    98
    enum InfoType type;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
    99
  } INFO;
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   100
  void SetRoutingInfoCallback (
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   101
    Callback<void, INFO> cb
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   102
  );
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   103
  void SetRetransmittersOfPerrCallback (
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   104
    Callback<std::vector<Mac48Address>, std::vector<HwmpRtable::FailedDestination>, uint32_t> cb);
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   105
  void RequestDestination (Mac48Address dest);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   106
  void SendPathError (std::vector<HwmpRtable::FailedDestination> destinations);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   107
  void SetAssociatedIfaceId (uint32_t interface);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   108
  uint32_t  GetAssociatedIfaceId ();
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   109
  //Mac interaction:
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   110
  void SetMac (Ptr<MeshWifiMac> mac);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   111
  void SetSendPreqCallback (
4835
eca7ff6b2b47 Class names restructured
Kirill Andreev <andreev@iitp.ru>
parents: 4833
diff changeset
   112
    Callback<void, const IeDot11sPreq&> cb);
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   113
  void SetSendPrepCallback (
4835
eca7ff6b2b47 Class names restructured
Kirill Andreev <andreev@iitp.ru>
parents: 4833
diff changeset
   114
    Callback<void, const IeDot11sPrep&> cb);
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   115
  void SetSendPerrCallback (
4835
eca7ff6b2b47 Class names restructured
Kirill Andreev <andreev@iitp.ru>
parents: 4833
diff changeset
   116
    Callback<void, const IeDot11sPerr&, std::vector<Mac48Address> > cb);
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   117
  void ReceivePreq (IeDot11sPreq&, const Mac48Address& from, const uint32_t& metric);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   118
  void ReceivePrep (IeDot11sPrep&, const Mac48Address& from, const uint32_t& metric);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   119
  void ReceivePerr (IeDot11sPerr&, const Mac48Address& from);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   120
  void PeerStatus (
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   121
    const Mac48Address peerAddress,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   122
    const bool status,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   123
    const uint32_t metric
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   124
  );
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   125
  //Proactive mode routines:
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   126
  bool SetRoot ();
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   127
  void UnSetRoot ();
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   128
  //external handling:
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   129
  void Disable ();
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   130
  void Enable ();
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   131
  //DEBUG purpose:
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   132
  Mac48Address GetAddress ();
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   133
private:
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   134
  static const uint32_t MAX_PREQ_ID = 0xffffffff;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   135
  static const uint32_t MAX_DSN = 0xffffffff;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   136
  //information about associated port:
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   137
  Mac48Address m_address;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   138
  //index when HWMP state is attached
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   139
  uint32_t m_ifIndex;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   140
  //timers for PREQ and PREP:
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   141
  EventId  m_preqTimer;
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   142
  void  SendOnePreq ();
4853
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   143
  std::vector<IeDot11sPreq>  m_preqQueue;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   144
  //true means that we can add a destination to
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   145
  //existing PREQ element
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   146
  //False means that we must send
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   147
  EventId  m_prepTimer;
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   148
  void  SendPrep (
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   149
    Mac48Address dst, //dst is PREQ's originator address
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   150
    Mac48Address src, //src is PREQ's destination address
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   151
    Mac48Address retransmitter,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   152
    uint32_t initMetric,
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   153
    uint32_t dsn,/* taken form PREQ*/
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   154
    uint32_t originatorDsn, //taken from rtable or as m_myDsn ++;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   155
    uint32_t lifetime //taken from PREQ
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   156
  );
4853
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   157
  std::vector<IeDot11sPreq>::iterator  m_myPreq;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   158
  //HWMP interaction callbacks:
4853
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   159
  Callback<void, INFO>  m_routingInfoCallback;
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   160
  Callback<std::vector<Mac48Address>, std::vector<HwmpRtable::FailedDestination>, uint32_t>  m_retransmittersOfPerrCallback;
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   161
  Callback<HwmpRtable::LookupResult, const Mac48Address&>          m_requestRouteCallback;
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   162
  Callback<HwmpRtable::LookupResult, uint32_t>                     m_requestRootPathCallback;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   163
  //Mac interaction callbacks:
4853
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   164
  Callback<void, const IeDot11sPreq&>                              m_preqCallback;
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   165
  Callback<void, const IeDot11sPrep&, const Mac48Address&>         m_prepCallback;
cb12c7003071 Coding style changes: remove unneeded line breaks.
Andrey Mazo <mazo@iitp.ru>
parents: 4852
diff changeset
   166
  Callback<void, const IeDot11sPerr&, std::vector<Mac48Address> >  m_perrCallback;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   167
  //HwmpCounters:
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   168
  uint32_t m_preqId;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   169
  uint32_t m_myDsn;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   170
  //Seqno and metric database
4837
7887e457f6f0 Fixed ticket #27
Kirill Andreev <andreev@iitp.ru>
parents: 4835
diff changeset
   171
  std::map<Mac48Address, uint32_t>  m_dsnDatabase;
7887e457f6f0 Fixed ticket #27
Kirill Andreev <andreev@iitp.ru>
parents: 4835
diff changeset
   172
  std::map<Mac48Address, uint32_t>  m_preqMetricDatabase;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   173
  //Disable/enable functionality
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   174
  bool  m_disabled;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   175
  //Proactive PREQ mechanism:
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   176
  EventId  m_proactivePreqTimer;
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   177
  void  SendProactivePreq ();
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   178
  /**
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   179
   * \brief Two PERRs may not be sent closer to
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   180
   * each other than
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   181
   * dot11MeshHWMPperrMinInterval, so, each HWMP
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   182
   * state collects all unreachable destinations
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   183
   * and once in dot11MeshHWMPperrMinInterval
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   184
   * should send PERR, and PERR element should
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   185
   * be cleared
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   186
   */
4835
eca7ff6b2b47 Class names restructured
Kirill Andreev <andreev@iitp.ru>
parents: 4833
diff changeset
   187
  IeDot11sPerr  m_myPerr;
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   188
  std::vector<Mac48Address>   m_myPerrReceivers;
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   189
  void  AddPerrReceiver (Mac48Address receiver);
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   190
  EventId  m_perrTimer;
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4841
diff changeset
   191
  void  SendOnePerr ();
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   192
  //Configurable parameters:
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   193
  uint8_t  m_maxTtl;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4807
diff changeset
   194
};
4887
cbf02c77d5c1 HWMP is attached to mesh point device and MAC layer with zero functionality
Kirill Andreev <andreev@iitp.ru>
parents: 4886
diff changeset
   195
#endif
4886
bdbf21835837 HWMP rolled to "initial position"
Kirill Andreev <andreev@iitp.ru>
parents: 4884
diff changeset
   196
} //namespace dot11s
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
   197
} //namespace ns3
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
   198
#endif