A Discrete-Event Network Simulator
API
uan-mac.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
18 */
19
20#ifndef UAN_MAC_H
21#define UAN_MAC_H
22
23#include "ns3/address.h"
24#include "ns3/mac8-address.h"
25#include "ns3/nstime.h"
26#include "ns3/object.h"
27#include "ns3/packet.h"
28#include "ns3/ptr.h"
29
30namespace ns3
31{
32
33class UanPhy;
34class UanChannel;
35class UanNetDevice;
36class UanTransducer;
37class UanTxMode;
38class Mac8Address;
39
45class UanMac : public Object
46{
47 public:
49 UanMac();
54 static TypeId GetTypeId();
55
61 virtual Address GetAddress();
62
68 virtual void SetAddress(Mac8Address addr);
69
78 virtual bool Enqueue(Ptr<Packet> pkt, uint16_t protocolNumber, const Address& dest) = 0;
86 virtual void SetForwardUpCb(Callback<void, Ptr<Packet>, uint16_t, const Mac8Address&> cb) = 0;
87
96 virtual void AttachPhy(Ptr<UanPhy> phy) = 0;
97
103 virtual Address GetBroadcast() const;
104
106 virtual void Clear() = 0;
107
116 virtual int64_t AssignStreams(int64_t stream) = 0;
117
125
131
136 void SetTxModeIndex(uint32_t txModeIndex);
137
138 private:
143
144}; // class UanMac
145
146} // namespace ns3
147
148#endif /* UAN_MAC_H */
a polymophic address class
Definition: address.h:100
Callback template class.
Definition: callback.h:443
A class used for addressing MAC8 MAC's.
Definition: mac8-address.h:44
A base class which provides memory management and object aggregation.
Definition: object.h:89
a unique identifier for an interface.
Definition: type-id.h:60
Virtual base class for all UAN MAC protocols.
Definition: uan-mac.h:46
virtual void Clear()=0
Clears all pointer references.
void SetTxModeIndex(uint32_t txModeIndex)
Set the Tx mode index (Modulation type).
Definition: uan-mac.cc:40
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb)=0
Set the callback to forward packets up to higher layers.
void(* PacketModeTracedCallback)(Ptr< const Packet > packet, UanTxMode mode)
TracedCallback signature for packet reception/enqueue/dequeue events.
Definition: uan-mac.h:124
virtual bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest)=0
Enqueue packet to be transmitted.
virtual void SetAddress(Mac8Address addr)
Set the address.
Definition: uan-mac.cc:58
uint32_t m_txModeIndex
Modulation type.
Definition: uan-mac.h:140
virtual void AttachPhy(Ptr< UanPhy > phy)=0
Attach PHY layer to this MAC.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
Mac8Address m_address
The MAC address.
Definition: uan-mac.h:142
virtual Address GetBroadcast() const
Get the broadcast address.
Definition: uan-mac.cc:64
virtual Address GetAddress()
Get the MAC Address.
Definition: uan-mac.cc:52
UanMac()
Default constructor.
Definition: uan-mac.cc:27
uint32_t GetTxModeIndex()
Get the Tx mode index (Modulation type).
Definition: uan-mac.cc:46
static TypeId GetTypeId()
Register this type.
Definition: uan-mac.cc:33
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:43
Every class exported by the ns3 library is enclosed in the ns3 namespace.
phy
Definition: third.py:82