A Discrete-Event Network Simulator
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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Kirill Andreev <andreev@iitp.ru>
18 */
19
20#ifndef FLAME_PROTOCOL_MAC_H
21#define FLAME_PROTOCOL_MAC_H
22
23#include "ns3/mesh-wifi-interface-mac.h"
24
25namespace ns3
26{
27namespace flame
28{
29class FlameProtocol;
30
37{
38 public:
45 ~FlameProtocolMac() override;
46
47 // Inherited from MAC plugin
52 void SetParent(Ptr<MeshWifiInterfaceMac> parent) override;
59 bool Receive(Ptr<Packet> packet, const WifiMacHeader& header) override;
70 WifiMacHeader& header,
71 Mac48Address from,
72 Mac48Address to) override;
77 void UpdateBeacon(MeshWifiBeacon& beacon) const override{};
78
84 int64_t AssignStreams(int64_t stream) override
85 {
86 return 0;
87 }
88
93 uint16_t GetChannelId() const;
98 void Report(std::ostream& os) const;
100 void ResetStats();
101
102 private:
103 // MeshPointDevice parameters:
106
109 {
110 uint16_t txUnicast;
111 uint16_t txBroadcast;
113 uint16_t rxUnicast;
114 uint16_t rxBroadcast;
116
121 void Print(std::ostream& os) const;
123 Statistics();
124 };
125
127};
128} // namespace flame
129} // namespace ns3
130#endif /* FLAME_PROTOCOL_MAC_H */
an EUI-48 address
Definition: mac48-address.h:46
Beacon is beacon header + list of arbitrary information elements.
Common interface for mesh point interface MAC plugins.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Implements the IEEE 802.11 MAC header.
Interface MAC plugin for FLAME routing protocol.
int64_t AssignStreams(int64_t stream) override
AssignStreams is empty, because this model doesn't use random variables.
void ResetStats()
Reset statistics function.
void UpdateBeacon(MeshWifiBeacon &beacon) const override
Update beacon is empty, because FLAME does not know anything about beacons.
Ptr< FlameProtocol > m_protocol
protocol
uint16_t GetChannelId() const
Get channel ID function.
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to) override
Process an outgoing frame.
void SetParent(Ptr< MeshWifiInterfaceMac > parent) override
Set parent of this instance.
Ptr< MeshWifiInterfaceMac > m_parent
parent
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header) override
Receive and process a packet; packets are given a FlameTag packet tag.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Print(std::ostream &os) const
Print function.