A Discrete-Event Network Simulator
API
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
26namespace ns3 {
27namespace flame {
28class FlameProtocol;
35{
36public:
44
45 // Inherited from MAC plugin
57 bool Receive (Ptr<Packet> packet, const WifiMacHeader & header);
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
93private:
94
95 // MeshPointDevice parameters:
100 {
101 uint16_t txUnicast;
102 uint16_t txBroadcast;
104 uint16_t rxUnicast;
105 uint16_t rxBroadcast;
107
112 void Print (std::ostream & os) const;
114 Statistics ();
115 };
117
118};
119} // namespace flame
120} // namespace ns3
121#endif /* FLAME_PROTOCOL_MAC_H */
an EUI-48 address
Definition: mac48-address.h:44
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:74
Implements the IEEE 802.11 MAC header.
Interface MAC plugin for FLAME routing protocol.
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Set parent of this instance.
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Process an outgoing frame.
void ResetStats()
Reset statistics function.
void Report(std::ostream &os) const
Report statistics.
Ptr< FlameProtocol > m_protocol
protocol
FlameProtocolMac(Ptr< FlameProtocol > protocol)
Constructor.
uint16_t GetChannelId() const
Get channel ID function.
int64_t AssignStreams(int64_t stream)
AssignStreams is empty, because this model doesn't use random variables.
Ptr< MeshWifiInterfaceMac > m_parent
parent
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Receive and process a packet; packets are given a FlameTag packet tag.
void UpdateBeacon(MeshWifiBeacon &beacon) const
Update beacon is empty, because FLAME does not know anything about beacons.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Print(std::ostream &os) const
Print function.