A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mesh
model
flame
flame-protocol-mac.h
Go to the documentation of this file.
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 FLAME_PROTOCOL_MAC_H
22
#define FLAME_PROTOCOL_MAC_H
23
24
#include "ns3/mesh-wifi-interface-mac.h"
25
26
namespace
ns3
{
27
namespace
flame {
28
class
FlameProtocol;
34
class
FlameProtocolMac
:
public
MeshWifiInterfaceMacPlugin
35
{
36
public
:
42
FlameProtocolMac
(
Ptr<FlameProtocol>
protocol);
43
~FlameProtocolMac
();
44
45
// Inherited from MAC plugin
50
void
SetParent
(
Ptr<MeshWifiInterfaceMac>
parent);
57
bool
Receive
(
Ptr<Packet>
packet,
const
WifiMacHeader
& header);
67
bool
UpdateOutcomingFrame
(
Ptr<Packet>
packet,
WifiMacHeader
& header,
Mac48Address
from,
Mac48Address
to);
72
void
UpdateBeacon
(
MeshWifiBeacon
& beacon)
const
{};
78
int64_t
AssignStreams
(int64_t stream) {
return
0; }
79
84
uint16_t
GetChannelId
()
const
;
89
void
Report
(std::ostream & os)
const
;
91
void
ResetStats
();
92
93
private
:
94
95
// MeshPointDevice parameters:
96
Ptr<FlameProtocol>
m_protocol
;
97
Ptr<MeshWifiInterfaceMac>
m_parent
;
98
struct
Statistics
100
{
101
uint16_t
txUnicast
;
102
uint16_t
txBroadcast
;
103
uint32_t
txBytes
;
104
uint16_t
rxUnicast
;
105
uint16_t
rxBroadcast
;
106
uint32_t
rxBytes
;
107
112
void
Print
(std::ostream & os)
const
;
114
Statistics
();
115
};
116
Statistics
m_stats
;
117
118
};
119
}
// namespace flame
120
}
// namespace ns3
121
#endif
/* FLAME_PROTOCOL_MAC_H */
ns3::flame::FlameProtocolMac::Statistics::Statistics
Statistics()
constructor
Definition:
flame-protocol-mac.cc:103
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::flame::FlameProtocolMac::Statistics::rxBytes
uint32_t rxBytes
receive bytes
Definition:
flame-protocol-mac.h:106
ns3::flame::FlameProtocolMac::Statistics::txBytes
uint32_t txBytes
transmit bytes
Definition:
flame-protocol-mac.h:103
ns3::flame::FlameProtocolMac::Statistics
Statistics structure.
Definition:
flame-protocol-mac.h:99
ns3::flame::FlameProtocolMac::m_stats
Statistics m_stats
statistics
Definition:
flame-protocol-mac.h:116
ns3::flame::FlameProtocolMac::UpdateBeacon
void UpdateBeacon(MeshWifiBeacon &beacon) const
Update beacon is empty, because FLAME does not know anything about beacons.
Definition:
flame-protocol-mac.h:72
ns3::flame::FlameProtocolMac::ResetStats
void ResetStats()
Reset statistics function.
Definition:
flame-protocol-mac.cc:128
ns3::flame::FlameProtocolMac::Statistics::Print
void Print(std::ostream &os) const
Print function.
Definition:
flame-protocol-mac.cc:108
ns3::flame::FlameProtocolMac::m_parent
Ptr< MeshWifiInterfaceMac > m_parent
parent
Definition:
flame-protocol-mac.h:97
ns3::flame::FlameProtocolMac::Report
void Report(std::ostream &os) const
Report statistics.
Definition:
flame-protocol-mac.cc:119
ns3::flame::FlameProtocolMac::GetChannelId
uint16_t GetChannelId() const
Get channel ID function.
Definition:
flame-protocol-mac.cc:99
ns3::flame::FlameProtocolMac::UpdateOutcomingFrame
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Process an outgoing frame.
Definition:
flame-protocol-mac.cc:74
ns3::flame::FlameProtocolMac
Interface MAC plugin for FLAME routing protocol.
Definition:
flame-protocol-mac.h:34
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MeshWifiInterfaceMacPlugin
Common interface for mesh point interface MAC plugins.
Definition:
mesh-wifi-interface-mac-plugin.h:40
ns3::flame::FlameProtocolMac::FlameProtocolMac
FlameProtocolMac(Ptr< FlameProtocol > protocol)
Constructor.
Definition:
flame-protocol-mac.cc:32
ns3::flame::FlameProtocolMac::Statistics::txBroadcast
uint16_t txBroadcast
transit broadcast
Definition:
flame-protocol-mac.h:102
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:43
ns3::flame::FlameProtocolMac::Statistics::rxBroadcast
uint16_t rxBroadcast
receive broadcast
Definition:
flame-protocol-mac.h:105
ns3::MeshWifiBeacon
Beacon is beacon header + list of arbitrary information elements.
Definition:
mesh-wifi-beacon.h:40
ns3::flame::FlameProtocolMac::~FlameProtocolMac
~FlameProtocolMac()
Definition:
flame-protocol-mac.cc:36
ns3::flame::FlameProtocolMac::m_protocol
Ptr< FlameProtocol > m_protocol
protocol
Definition:
flame-protocol-mac.h:96
ns3::flame::FlameProtocolMac::SetParent
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Set parent of this instance.
Definition:
flame-protocol-mac.cc:42
ns3::flame::FlameProtocolMac::AssignStreams
int64_t AssignStreams(int64_t stream)
AssignStreams is empty, because this model doesn't use random variables.
Definition:
flame-protocol-mac.h:78
ns3::flame::FlameProtocolMac::Statistics::rxUnicast
uint16_t rxUnicast
receive unicast
Definition:
flame-protocol-mac.h:104
ns3::flame::FlameProtocolMac::Statistics::txUnicast
uint16_t txUnicast
transmit unicast
Definition:
flame-protocol-mac.h:101
ns3::flame::FlameProtocolMac::Receive
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Receive and process a packet; packets are given a FlameTag packet tag.
Definition:
flame-protocol-mac.cc:48
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition:
wifi-mac-header.h:83
Generated on Wed Nov 7 2018 10:02:05 for ns-3 by
1.8.14