A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
flame-protocol-mac.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Kirill Andreev <andreev@iitp.ru>
7
*/
8
9
#ifndef FLAME_PROTOCOL_MAC_H
10
#define FLAME_PROTOCOL_MAC_H
11
12
#include "ns3/mesh-wifi-interface-mac.h"
13
14
namespace
ns3
15
{
16
namespace
flame
17
{
18
class
FlameProtocol;
19
20
/**
21
* @ingroup flame
22
*
23
* @brief Interface MAC plugin for FLAME routing protocol
24
*/
25
class
FlameProtocolMac
:
public
MeshWifiInterfaceMacPlugin
26
{
27
public
:
28
/**
29
* Constructor
30
*
31
* @param protocol flame protocol object
32
*/
33
FlameProtocolMac
(
Ptr<FlameProtocol>
protocol);
34
~FlameProtocolMac
()
override
;
35
36
// Inherited from MAC plugin
37
/**
38
* Set parent of this instance
39
* @param parent pointer to the parent MeshWifiInterfaceMac
40
*/
41
void
SetParent
(
Ptr<MeshWifiInterfaceMac>
parent)
override
;
42
/**
43
* Receive and process a packet; packets are given a FlameTag packet tag
44
* @param packet the packet received
45
* @param header the header
46
* @returns true if successful
47
*/
48
bool
Receive
(
Ptr<Packet>
packet,
const
WifiMacHeader
& header)
override
;
49
/**
50
* Process an outgoing frame. Remove the FlameTag and increment stats
51
* counters.
52
* @param packet the packet received
53
* @param header the header
54
* @param from the MAC address of the sender
55
* @param to the MAC address of the receiver
56
* @returns true if successful
57
*/
58
bool
UpdateOutcomingFrame
(
Ptr<Packet>
packet,
59
WifiMacHeader
& header,
60
Mac48Address
from,
61
Mac48Address
to)
override
;
62
63
/**
64
* Update beacon is empty, because FLAME does not know anything about beacons
65
* @param beacon the beacon
66
*/
67
void
UpdateBeacon
(
MeshWifiBeacon
& beacon)
const override
68
{
69
}
70
71
/**
72
* AssignStreams is empty, because this model doesn't use random variables
73
* @param stream
74
* @returns 0 (no streams used)
75
*/
76
int64_t
AssignStreams
(int64_t stream)
override
77
{
78
return
0;
79
}
80
81
/**
82
* Get channel ID function
83
* @returns the channel
84
*/
85
uint16_t
GetChannelId
()
const
;
86
/**
87
* Report statistics
88
* @param os the output stream
89
*/
90
void
Report
(std::ostream& os)
const
;
91
/// Reset statistics function
92
void
ResetStats
();
93
94
private
:
95
// MeshPointDevice parameters:
96
Ptr<FlameProtocol>
m_protocol
;
///< protocol
97
Ptr<MeshWifiInterfaceMac>
m_parent
;
///< parent
98
99
/// Statistics structure
100
struct
Statistics
101
{
102
uint16_t
txUnicast
;
///< transmit unicast
103
uint16_t
txBroadcast
;
///< transit broadcast
104
uint32_t
txBytes
;
///< transmit bytes
105
uint16_t
rxUnicast
;
///< receive unicast
106
uint16_t
rxBroadcast
;
///< receive broadcast
107
uint32_t
rxBytes
;
///< receive bytes
108
109
/**
110
* Print function
111
* @param os the output stream
112
*/
113
void
Print
(std::ostream& os)
const
;
114
/// constructor
115
Statistics
();
116
};
117
118
Statistics
m_stats
;
///< statistics
119
};
120
}
// namespace flame
121
}
// namespace ns3
122
#endif
/* FLAME_PROTOCOL_MAC_H */
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::MeshWifiBeacon
Beacon is beacon header + list of arbitrary information elements.
Definition
mesh-wifi-beacon.h:31
ns3::MeshWifiInterfaceMacPlugin
Common interface for mesh point interface MAC plugins.
Definition
mesh-wifi-interface-mac-plugin.h:31
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition
wifi-mac-header.h:87
ns3::flame::FlameProtocolMac
Interface MAC plugin for FLAME routing protocol.
Definition
flame-protocol-mac.h:26
ns3::flame::FlameProtocolMac::~FlameProtocolMac
~FlameProtocolMac() override
Definition
flame-protocol-mac.cc:30
ns3::flame::FlameProtocolMac::AssignStreams
int64_t AssignStreams(int64_t stream) override
AssignStreams is empty, because this model doesn't use random variables.
Definition
flame-protocol-mac.h:76
ns3::flame::FlameProtocolMac::m_stats
Statistics m_stats
statistics
Definition
flame-protocol-mac.h:118
ns3::flame::FlameProtocolMac::ResetStats
void ResetStats()
Reset statistics function.
Definition
flame-protocol-mac.cc:146
ns3::flame::FlameProtocolMac::Report
void Report(std::ostream &os) const
Report statistics.
Definition
flame-protocol-mac.cc:137
ns3::flame::FlameProtocolMac::UpdateBeacon
void UpdateBeacon(MeshWifiBeacon &beacon) const override
Update beacon is empty, because FLAME does not know anything about beacons.
Definition
flame-protocol-mac.h:67
ns3::flame::FlameProtocolMac::m_protocol
Ptr< FlameProtocol > m_protocol
protocol
Definition
flame-protocol-mac.h:96
ns3::flame::FlameProtocolMac::FlameProtocolMac
FlameProtocolMac(Ptr< FlameProtocol > protocol)
Constructor.
Definition
flame-protocol-mac.cc:25
ns3::flame::FlameProtocolMac::GetChannelId
uint16_t GetChannelId() const
Get channel ID function.
Definition
flame-protocol-mac.cc:98
ns3::flame::FlameProtocolMac::UpdateOutcomingFrame
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) override
Process an outgoing frame.
Definition
flame-protocol-mac.cc:70
ns3::flame::FlameProtocolMac::SetParent
void SetParent(Ptr< MeshWifiInterfaceMac > parent) override
Set parent of this instance.
Definition
flame-protocol-mac.cc:37
ns3::flame::FlameProtocolMac::m_parent
Ptr< MeshWifiInterfaceMac > m_parent
parent
Definition
flame-protocol-mac.h:97
ns3::flame::FlameProtocolMac::Receive
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header) override
Receive and process a packet; packets are given a FlameTag packet tag.
Definition
flame-protocol-mac.cc:43
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::flame::FlameProtocolMac::Statistics
Statistics structure.
Definition
flame-protocol-mac.h:101
ns3::flame::FlameProtocolMac::Statistics::rxBytes
uint32_t rxBytes
receive bytes
Definition
flame-protocol-mac.h:107
ns3::flame::FlameProtocolMac::Statistics::txUnicast
uint16_t txUnicast
transmit unicast
Definition
flame-protocol-mac.h:102
ns3::flame::FlameProtocolMac::Statistics::txBroadcast
uint16_t txBroadcast
transit broadcast
Definition
flame-protocol-mac.h:103
ns3::flame::FlameProtocolMac::Statistics::txBytes
uint32_t txBytes
transmit bytes
Definition
flame-protocol-mac.h:104
ns3::flame::FlameProtocolMac::Statistics::rxUnicast
uint16_t rxUnicast
receive unicast
Definition
flame-protocol-mac.h:105
ns3::flame::FlameProtocolMac::Statistics::Print
void Print(std::ostream &os) const
Print function.
Definition
flame-protocol-mac.cc:114
ns3::flame::FlameProtocolMac::Statistics::Statistics
Statistics()
constructor
Definition
flame-protocol-mac.cc:103
ns3::flame::FlameProtocolMac::Statistics::rxBroadcast
uint16_t rxBroadcast
receive broadcast
Definition
flame-protocol-mac.h:106
src
mesh
model
flame
flame-protocol-mac.h
Generated on Thu Jan 16 2025 09:20:47 for ns-3 by
1.11.0