A Discrete-Event Network Simulator
API
uan-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 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_H
22 #define UAN_MAC_H
23 
24 #include "ns3/address.h"
25 #include "ns3/object.h"
26 #include "ns3/packet.h"
27 
28 #include "ns3/address.h"
29 #include "ns3/nstime.h"
30 #include "ns3/ptr.h"
31 #include "ns3/mac8-address.h"
32 
33 namespace ns3 {
34 
35 class UanPhy;
36 class UanChannel;
37 class UanNetDevice;
38 class UanTransducer;
39 class UanTxMode;
40 class Mac8Address;
41 
42 
43 
49 class UanMac : public Object
50 {
51 public:
53  UanMac ();
58  static TypeId GetTypeId (void);
59 
65  virtual Address GetAddress (void);
66 
72  virtual void SetAddress (Mac8Address addr);
73 
82  virtual bool Enqueue (Ptr<Packet> pkt, uint16_t protocolNumber, const Address &dest) = 0;
90  virtual void SetForwardUpCb (Callback<void, Ptr<Packet>, uint16_t, const Mac8Address&> cb) = 0;
91 
100  virtual void AttachPhy (Ptr<UanPhy> phy) = 0;
101 
107  virtual Address GetBroadcast (void) const;
108 
110  virtual void Clear (void) = 0;
111 
120  virtual int64_t AssignStreams (int64_t stream) = 0;
121 
128  typedef void (* PacketModeTracedCallback)
129  (Ptr<const Packet> packet, UanTxMode mode);
130 
135  uint32_t GetTxModeIndex ();
136 
141  void SetTxModeIndex (uint32_t txModeIndex);
142 
143 private:
145  uint32_t m_txModeIndex;
148 
149 }; // class UanMac
150 
151 } // namespace ns3
152 
153 #endif /* UAN_MAC_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 base class which provides memory management and object aggregation.
Definition: object.h:88
a unique identifier for an interface.
Definition: type-id.h:59
Virtual base class for all UAN MAC protocols.
Definition: uan-mac.h:50
void SetTxModeIndex(uint32_t txModeIndex)
Set the Tx mode index (Modulation type).
Definition: uan-mac.cc:43
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:129
static TypeId GetTypeId(void)
Register this type.
Definition: uan-mac.cc:33
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:61
uint32_t m_txModeIndex
Modulation type.
Definition: uan-mac.h:145
virtual void Clear(void)=0
Clears all pointer references.
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:147
virtual Address GetAddress(void)
Get the MAC Address.
Definition: uan-mac.cc:55
virtual Address GetBroadcast(void) const
Get the broadcast address.
Definition: uan-mac.cc:67
UanMac()
Default constructor.
Definition: uan-mac.cc:27
uint32_t GetTxModeIndex()
Get the Tx mode index (Modulation type).
Definition: uan-mac.cc:49
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:93