4793
|
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 |
* Authors: Kirill Andreev <andreev@iitp.ru>
|
|
19 |
* Aleksey Kovalenko <kovalenko@iitp.ru>
|
|
20 |
*/
|
|
21 |
|
|
22 |
|
|
23 |
#ifndef MESH_PEER_MAN_ELEMENT
|
|
24 |
#define MESH_PEER_MAN_ELEMENT
|
|
25 |
|
|
26 |
#include <stdint.h>
|
|
27 |
#include "ns3/buffer.h"
|
|
28 |
#include "dot11s-codes.h"
|
|
29 |
|
|
30 |
namespace ns3
|
|
31 |
{
|
|
32 |
class PeerLinkManagementElement
|
|
33 |
{
|
|
34 |
public:
|
|
35 |
enum Subtype {
|
|
36 |
PEER_OPEN = 0,
|
|
37 |
PEER_CLOSE = 1,
|
|
38 |
PEER_CONFIRM = 2,
|
|
39 |
};
|
|
40 |
public:
|
|
41 |
PeerLinkManagementElement ();
|
|
42 |
|
|
43 |
void SetPeerOpen(uint16_t localLinkId);
|
|
44 |
void SetPeerClose(uint16_t localLinkID, uint16_t peerLinkId, dot11sReasonCode reasonCode);
|
|
45 |
void SetPeerConfirm(uint16_t localLinkID, uint16_t peerLinkId);
|
|
46 |
|
|
47 |
dot11sReasonCode GetReasonCode() const;
|
|
48 |
uint16_t GetLocalLinkId() const;
|
|
49 |
uint16_t GetPeerLinkId() const;
|
|
50 |
bool SubtypeIsOpen() const;
|
|
51 |
bool SubtypeIsClose() const;
|
|
52 |
bool SubtypeIsConfirm() const ;
|
|
53 |
|
|
54 |
uint32_t GetSerializedSize (void) const;
|
|
55 |
Buffer::Iterator Serialize (Buffer::Iterator i) const;
|
|
56 |
Buffer::Iterator Deserialize (Buffer::Iterator i);
|
|
57 |
private:
|
|
58 |
uint8_t m_length;
|
|
59 |
uint8_t m_subtype;
|
|
60 |
uint16_t m_localLinkId; //always is present
|
|
61 |
uint16_t m_peerLinkId; //only in confirm and may be present in close frame
|
|
62 |
dot11sReasonCode m_reasonCode; //only in close frame
|
|
63 |
};
|
|
64 |
} //namespace NS3
|
|
65 |
#endif
|
|
66 |
|