src/devices/mesh/dot11s/ie-dot11s-peer-management.h
author Kirill Andreev <andreev@iitp.ru>
Wed, 25 Mar 2009 12:23:12 +0300
changeset 4876 d78f1b978dac
parent 4872 ea1bce018a44
child 4899 50591b95753a
permissions -rw-r--r--
Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
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: 4810
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
 * Authors: Kirill Andreev <andreev@iitp.ru>
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    19
 *          Aleksey Kovalenko <kovalenko@iitp.ru>
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
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    23
#ifndef MESH_PEER_MAN_ELEMENT
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    24
#define MESH_PEER_MAN_ELEMENT
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    25
4813
e4e2c44d27cd All mesh related filed moved to devices/mesh. Let the refactoring begins!
Pavel Boyko <boyko@iitp.ru>
parents: 4812
diff changeset
    26
#include "ns3/dot11s-codes.h"
4838
ce31277d72ad Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents: 4813
diff changeset
    27
#include "ns3/wifi-information-element.h"
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    28
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4810
diff changeset
    29
namespace ns3 {
4872
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
    30
namespace dot11s {
4807
a1f43e372f9f 1. HIDE_UNDOC_CLASSES is temporary set to NO in doxygen.conf
Pavel Boyko <boyko@iitp.ru>
parents: 4793
diff changeset
    31
/**
4851
44a5075d854e 11s information elements commented as "\ingroup dot11s" for doxygen
Pavel Boyko <boyko@iitp.ru>
parents: 4850
diff changeset
    32
 * \ingroup dot11s
4850
c3ee1deaa07a Code refactoring: fixed names, added references to draft
Kirill Andreev <andreev@iitp.ru>
parents: 4847
diff changeset
    33
 * \brief See 7.3.2.85 of draft 2.07
4807
a1f43e372f9f 1. HIDE_UNDOC_CLASSES is temporary set to NO in doxygen.conf
Pavel Boyko <boyko@iitp.ru>
parents: 4793
diff changeset
    34
 */
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4872
diff changeset
    35
class IePeerManagement : public WifiInformationElement
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    36
{
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4810
diff changeset
    37
public:
4876
d78f1b978dac Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4872
diff changeset
    38
    IePeerManagement ();
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    39
    enum Subtype {
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    40
      PEER_OPEN    = 0,
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    41
      PEER_CLOSE   = 1,
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    42
      PEER_CONFIRM = 2,
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    43
    };
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    44
  void   SetPeerOpen (uint16_t localLinkId);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    45
  void   SetPeerClose (uint16_t localLinkID, uint16_t peerLinkId, dot11sReasonCode reasonCode);
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    46
  void   SetPeerConfirm (uint16_t localLinkID, uint16_t peerLinkId);
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    47
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    48
  dot11sReasonCode GetReasonCode () const;
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    49
  uint16_t  GetLocalLinkId () const;
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    50
  uint16_t  GetPeerLinkId () const;
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    51
  bool   SubtypeIsOpen () const;
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    52
  bool   SubtypeIsClose () const;
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    53
  bool   SubtypeIsConfirm () const ;
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    54
  uint8_t GetSubtype() const { return m_subtype;};
4850
c3ee1deaa07a Code refactoring: fixed names, added references to draft
Kirill Andreev <andreev@iitp.ru>
parents: 4847
diff changeset
    55
private:
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    56
  WifiElementId ElementId () const{
4838
ce31277d72ad Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents: 4813
diff changeset
    57
    return IE11S_PEER_LINK_MANAGEMENT;
ce31277d72ad Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents: 4813
diff changeset
    58
  }
ce31277d72ad Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents: 4813
diff changeset
    59
  uint8_t  GetInformationSize (void) const;
ce31277d72ad Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents: 4813
diff changeset
    60
  void SerializeInformation (Buffer::Iterator i) const;
ce31277d72ad Finished restructuring information elements
Kirill Andreev <andreev@iitp.ru>
parents: 4813
diff changeset
    61
  uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length);
4852
123dc54d734e Coding style changes: indentation (some fixes), spaces in operators, function
Andrey Mazo <mazo@iitp.ru>
parents: 4851
diff changeset
    62
  void PrintInformation (std::ostream& os) const;
4866
564372fc5491 First management frame goes through new archotecture
Kirill Andreev <andreev@iitp.ru>
parents: 4852
diff changeset
    63
private:
4812
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4810
diff changeset
    64
  uint8_t   m_length;
adcb26652e1d Coding style changes: indentation, spaces.
Andrey Mazo <mazo@iitp.ru>
parents: 4810
diff changeset
    65
  uint8_t   m_subtype;
4847
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    66
  uint16_t  m_localLinkId;
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    67
  /**
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    68
   * Present within confirm and may be present in close
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    69
   */
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    70
  uint16_t  m_peerLinkId;
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    71
  /**
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    72
   * Present only within close frame
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    73
   */
695b7aca9f88 Fixes with comments
Kirill Andreev <andreev@iitp.ru>
parents: 4841
diff changeset
    74
  dot11sReasonCode m_reasonCode;
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    75
};
4872
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
    76
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
    77
} // namespace dot11s
ea1bce018a44 Added namespace dot11s
Kirill Andreev <andreev@iitp.ru>
parents: 4871
diff changeset
    78
} //namespace ns3
4793
4f6a6772628e Merge 802.11s code.
Andrey Mazo <mazo@iitp.ru>
parents:
diff changeset
    79
#endif