A Discrete-Event Network Simulator
API
adhoc-wifi-mac.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006, 2009 INRIA
3  * Copyright (c) 2009 MIRKO BANCHI
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  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  * Mirko Banchi <mk.banchi@gmail.com>
20  */
21 
22 #ifndef ADHOC_WIFI_MAC_H
23 #define ADHOC_WIFI_MAC_H
24 
25 #include "wifi-mac.h"
26 
27 namespace ns3
28 {
29 
35 class AdhocWifiMac : public WifiMac
36 {
37  public:
42  static TypeId GetTypeId();
43 
44  AdhocWifiMac();
45  ~AdhocWifiMac() override;
46 
47  void SetLinkUpCallback(Callback<void> linkUp) override;
48  void Enqueue(Ptr<Packet> packet, Mac48Address to) override;
49  bool CanForwardPacketsTo(Mac48Address to) const override;
50 
51  private:
52  void Receive(Ptr<const WifiMpdu> mpdu, uint8_t linkId) override;
53 };
54 
55 } // namespace ns3
56 
57 #endif /* ADHOC_WIFI_MAC_H */
Wifi MAC high model for an ad-hoc Wifi MAC.
~AdhocWifiMac() override
void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
static TypeId GetTypeId()
Get the type ID.
void SetLinkUpCallback(Callback< void > linkUp) override
bool CanForwardPacketsTo(Mac48Address to) const override
Return true if packets can be forwarded to the given destination, false otherwise.
void Enqueue(Ptr< Packet > packet, Mac48Address to) override
an EUI-48 address
Definition: mac48-address.h:46
a unique identifier for an interface.
Definition: type-id.h:59
base class for all MAC-level wifi objects.
Definition: wifi-mac.h:96
Every class exported by the ns3 library is enclosed in the ns3 namespace.