A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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;
35 {
36 public:
39 
40  // Inherited from MAC plugin
42  bool Receive (Ptr<Packet> packet, const WifiMacHeader & header);
45  void UpdateBeacon (MeshWifiBeacon & beacon) const {};
47  int64_t AssignStreams (int64_t stream) { return 0; }
48 
49  uint16_t GetChannelId () const;
51  void Report (std::ostream &) const;
52  void ResetStats ();
53 
54 private:
55 
56  // MeshPointDevice parameters:
61  struct Statistics
62  {
63  uint16_t txUnicast;
64  uint16_t txBroadcast;
65  uint32_t txBytes;
66  uint16_t rxUnicast;
67  uint16_t rxBroadcast;
68  uint32_t rxBytes;
69 
70  void Print (std::ostream & os) const;
71  Statistics ();
72  };
75 
76 };
77 } // namespace flame
78 } // namespace ns3
79 #endif /* FLAME_PROTOCOL_MAC_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void Report(std::ostream &) const
Report statistics.
Ptr< MeshWifiInterfaceMac > m_parent
bool UpdateOutcomingFrame(Ptr< Packet > packet, WifiMacHeader &header, Mac48Address from, Mac48Address to)
Update frame before it will be forwarded down.
Interface MAC plugin FLAME routing protocol.
Common interface for mesh point interface MAC plugins.
an EUI-48 address
Definition: mac48-address.h:43
Beacon is beacon header + list of arbitrary information elements.
FlameProtocolMac(Ptr< FlameProtocol >)
Ptr< FlameProtocol > m_protocol
void SetParent(Ptr< MeshWifiInterfaceMac > parent)
Each plugin must be installed on interface to work.
void UpdateBeacon(MeshWifiBeacon &beacon) const
Update beacon is empty, because HWMP does not know anything about beacons.
int64_t AssignStreams(int64_t stream)
AssignStreams is empty, because this model doesn't use random variables.
bool Receive(Ptr< Packet > packet, const WifiMacHeader &header)
Process received frame.
Implements the IEEE 802.11 MAC header.