A Discrete-Event Network Simulator
API
uan-mac-aloha.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
19 */
20
21#ifndef UAN_MAC_ALOHA_H
22#define UAN_MAC_ALOHA_H
23
24#include "uan-mac.h"
25#include "ns3/mac8-address.h"
26
27namespace ns3
28{
29
30
31class UanPhy;
32class UanTxMode;
33
43class UanMacAloha : public UanMac
44{
45public:
47 UanMacAloha ();
49 virtual ~UanMacAloha ();
54 static TypeId GetTypeId (void);
55
56
57 // Inherited methods
58 virtual bool Enqueue (Ptr<Packet> pkt, uint16_t protocolNumber, const Address &dest);
59 virtual void SetForwardUpCb (Callback<void, Ptr<Packet>, uint16_t, const Mac8Address&> cb);
60 virtual void AttachPhy (Ptr<UanPhy> phy);
61 virtual void Clear (void);
62 int64_t AssignStreams (int64_t stream);
63
64private:
71
79 void RxPacketGood (Ptr<Packet> pkt, double sinr, UanTxMode txMode);
80
87 void RxPacketError (Ptr<Packet> pkt, double sinr);
88protected:
89 virtual void DoDispose ();
90
91}; // class UanMacAloha
92
93} // namespace ns3
94
95#endif /* UAN_MAC_ALOHA_H */
a polymophic address class
Definition: address.h:91
Callback template class.
Definition: callback.h:1279
A class used for addressing MAC8 MAC's.
Definition: mac8-address.h:43
a unique identifier for an interface.
Definition: type-id.h:59
ALOHA MAC Protocol, the simplest MAC protocol for wireless networks.
Definition: uan-mac-aloha.h:44
virtual ~UanMacAloha()
Dummy destructor, see DoDispose.
Ptr< UanPhy > m_phy
PHY layer attached to this MAC.
Definition: uan-mac-aloha.h:66
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb)
Set the callback to forward packets up to higher layers.
bool m_cleared
Flag when we've been cleared.
Definition: uan-mac-aloha.h:70
virtual void Clear(void)
Clears all pointer references.
virtual bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest)
Enqueue packet to be transmitted.
virtual void AttachPhy(Ptr< UanPhy > phy)
Attach PHY layer to this MAC.
UanMacAloha()
Default constructor.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void RxPacketGood(Ptr< Packet > pkt, double sinr, UanTxMode txMode)
Receive packet from lower layer (passed to PHY as callback).
virtual void DoDispose()
Destructor implementation.
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forUpCb
Forwarding up callback.
Definition: uan-mac-aloha.h:68
static TypeId GetTypeId(void)
Register this type.
void RxPacketError(Ptr< Packet > pkt, double sinr)
Packet received at lower layer in error.
Virtual base class for all UAN MAC protocols.
Definition: uan-mac.h:50
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:42
Every class exported by the ns3 library is enclosed in the ns3 namespace.
phy
Definition: third.py:84