A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
peer-management-protocol-mac.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 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
*/
20
21
#ifndef PEER_MANAGEMENT_PROTOCOL_MAC_H
22
#define PEER_MANAGEMENT_PROTOCOL_MAC_H
23
24
#include "ns3/mesh-wifi-interface-mac-plugin.h"
25
26
namespace
ns3 {
27
class
MeshWifiInterfaceMac;
28
namespace
dot11s {
29
class
PeerManagementProtocol;
30
class
IeConfiguration;
31
class
IePeerManagement;
32
class
PeerManagementProtocol;
42
class
PeerManagementProtocolMac
:
public
MeshWifiInterfaceMacPlugin
43
{
44
public
:
45
PeerManagementProtocolMac
(uint32_t interface,
Ptr<PeerManagementProtocol>
protocol);
46
~
PeerManagementProtocolMac
();
48
// \{
49
void
SetParent
(
Ptr<MeshWifiInterfaceMac>
parent);
50
bool
Receive
(
Ptr<Packet>
packet,
const
WifiMacHeader
& header);
51
bool
UpdateOutcomingFrame
(
Ptr<Packet>
packet,
WifiMacHeader
& header,
Mac48Address
from,
Mac48Address
to);
52
void
UpdateBeacon
(
MeshWifiBeacon
& beacon)
const
;
53
int64_t
AssignStreams
(int64_t stream);
54
// \}
56
// \{
57
void
Report (std::ostream &)
const
;
58
void
ResetStats ();
59
uint32_t GetLinkMetric (
Mac48Address
peerAddress);
60
// \}
61
62
private
:
63
PeerManagementProtocolMac
& operator= (
const
PeerManagementProtocolMac
&);
64
PeerManagementProtocolMac
(
const
PeerManagementProtocolMac
&);
65
66
friend
class
PeerManagementProtocol
;
67
friend
class
PeerLink
;
69
// \{
74
struct
PlinkFrameStart
75
{
76
uint8_t subtype;
77
uint16_t aid;
78
SupportedRates
rates;
79
uint16_t qos;
80
};
81
Ptr<Packet>
CreatePeerLinkOpenFrame ();
82
Ptr<Packet>
CreatePeerLinkConfirmFrame ();
83
Ptr<Packet>
CreatePeerLinkCloseFrame ();
85
PlinkFrameStart
ParsePlinkFrame
(
Ptr<const Packet>
packet);
86
// \}
88
void
TxError
(
WifiMacHeader
const
&hdr);
89
void
TxOk (
WifiMacHeader
const
&hdr);
91
void
SetBeaconShift
(
Time
shift);
92
void
SetPeerManagerProtcol (
Ptr<PeerManagementProtocol>
protocol);
93
void
SendPeerLinkManagementFrame (
94
Mac48Address
peerAddress,
95
Mac48Address
peerMpAddress,
96
uint16_t aid,
97
IePeerManagement
peerElement,
98
IeConfiguration
meshConfig
99
);
101
Mac48Address
GetAddress
()
const
;
103
// \{
104
struct
Statistics
105
{
106
uint16_t txOpen;
107
uint16_t txConfirm;
108
uint16_t txClose;
109
uint16_t rxOpen;
110
uint16_t rxConfirm;
111
uint16_t rxClose;
112
uint16_t dropped;
113
uint16_t brokenMgt;
114
uint16_t txMgt;
115
uint32_t txMgtBytes;
116
uint16_t rxMgt;
117
uint32_t rxMgtBytes;
118
uint16_t beaconShift;
119
120
Statistics
();
121
void
Print (std::ostream & os)
const
;
122
};
123
124
private
:
125
struct
Statistics
m_stats;
128
// \{
129
Ptr<MeshWifiInterfaceMac>
m_parent;
130
uint32_t m_ifIndex;
131
Ptr<PeerManagementProtocol>
m_protocol;
132
// \}
133
};
134
135
}
// namespace dot11s
136
}
// namespace ns3
137
138
#endif
/* PEER_MANAGEMENT_PROTOCOL_MAC_H */
139
ns3::Time
keep track of time unit.
Definition:
nstime.h:149
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::dot11s::PeerManagementProtocolMac::SetBeaconShift
void SetBeaconShift(Time shift)
BCA functionality.
Definition:
peer-management-protocol-mac.cc:270
ns3::dot11s::PeerManagementProtocolMac::Statistics
Definition:
peer-management-protocol-mac.h:104
ns3::dot11s::PeerManagementProtocolMac::AssignStreams
int64_t AssignStreams(int64_t stream)
Definition:
peer-management-protocol-mac.cc:320
ns3::SupportedRates
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Definition:
supported-rates.h:92
ns3::dot11s::PeerManagementProtocolMac::PlinkFrameStart
This structure keeps all fields in peer link management frame, which are not subclasses of WifiInform...
Definition:
peer-management-protocol-mac.h:74
ns3::dot11s::IePeerManagement
See 7.3.2.85 of draft 2.07.
Definition:
ie-dot11s-peer-management.h:52
ns3::dot11s::PeerManagementProtocolMac::UpdateOutcomingFrame
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Update frame before it will be forwarded down.
Definition:
peer-management-protocol-mac.cc:154
ns3::MeshWifiInterfaceMacPlugin
Common interface for mesh point interface MAC plugins.
Definition:
mesh-wifi-interface-mac-plugin.h:41
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:41
ns3::dot11s::PeerManagementProtocolMac::GetAddress
Mac48Address GetAddress() const
debug only, used to print established links
Definition:
peer-management-protocol-mac.cc:258
ns3::MeshWifiBeacon
Beacon is beacon header + list of arbitrary information elements.
Definition:
mesh-wifi-beacon.h:38
ns3::dot11s::PeerManagementProtocolMac::ParsePlinkFrame
PlinkFrameStart ParsePlinkFrame(Ptr< const Packet > packet)
Parses the start of the frame, where no WifiInformationElements exist.
ns3::dot11s::PeerManagementProtocolMac::UpdateBeacon
void UpdateBeacon(MeshWifiBeacon &beacon) const
Update beacon before it will be formed and sent.
Definition:
peer-management-protocol-mac.cc:184
ns3::dot11s::IeConfiguration
Describes Mesh Configuration Element see 7.3.2.86 of 802.11s draft 3.0.
Definition:
ie-dot11s-configuration.h:101
ns3::dot11s::PeerLink
Peer link model for 802.11s Peer Management protocol.
Definition:
peer-link.h:43
ns3::dot11s::PeerManagementProtocolMac
This is plugin to Mesh WiFi MAC, which implements interface to dot11s peer management protocol: it ta...
Definition:
peer-management-protocol-mac.h:42
ns3::dot11s::PeerManagementProtocolMac::Receive
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Process received frame.
Definition:
peer-management-protocol-mac.cc:63
ns3::dot11s::PeerManagementProtocolMac::SetParent
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Each plugin must be installed on interface to work.
Definition:
peer-management-protocol-mac.cc:46
ns3::dot11s::PeerManagementProtocolMac::TxError
void TxError(WifiMacHeader const &hdr)
Closes link when a proper number of successive transmissions have failed.
Definition:
peer-management-protocol-mac.cc:53
ns3::WifiMacHeader
Definition:
wifi-mac-header.h:76
ns3::dot11s::PeerManagementProtocol
802.11s Peer Management Protocol model
Definition:
peer-management-protocol.h:49
src
mesh
model
dot11s
peer-management-protocol-mac.h
Generated on Sun Mar 16 2014 11:25:08 for ns-3 by
1.8.6