A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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 "
uan-address.h
"
26
27
namespace
ns3
28
{
29
30
31
class
UanPhy;
32
class
UanTxMode;
33
43
class
UanMacAloha
:
public
UanMac
44
{
45
public
:
47
UanMacAloha
();
49
virtual
~UanMacAloha
();
54
static
TypeId
GetTypeId
(
void
);
55
56
57
// Inherited methods
58
Address
GetAddress
(
void
);
59
virtual
void
SetAddress
(
UanAddress
addr);
60
virtual
bool
Enqueue
(
Ptr<Packet>
pkt,
const
Address
&dest, uint16_t protocolNumber);
61
virtual
void
SetForwardUpCb
(
Callback
<
void
,
Ptr<Packet>
,
const
UanAddress
& > cb);
62
virtual
void
AttachPhy
(
Ptr<UanPhy>
phy
);
63
virtual
Address
GetBroadcast
(
void
)
const
;
64
virtual
void
Clear
(
void
);
65
int64_t
AssignStreams
(int64_t stream);
66
67
private
:
69
UanAddress
m_address
;
71
Ptr<UanPhy>
m_phy
;
73
Callback<void, Ptr<Packet>
,
const
UanAddress
& >
m_forUpCb
;
75
bool
m_cleared
;
76
84
void
RxPacketGood
(
Ptr<Packet>
pkt,
double
sinr,
UanTxMode
txMode);
85
92
void
RxPacketError
(
Ptr<Packet>
pkt,
double
sinr);
93
protected
:
94
virtual
void
DoDispose
();
95
96
};
// class UanMacAloha
97
98
}
// namespace ns3
99
100
#endif
/* UAN_MAC_ALOHA_H */
ns3::UanMacAloha::m_phy
Ptr< UanPhy > m_phy
PHY layer attached to this MAC.
Definition:
uan-mac-aloha.h:71
ns3::Ptr< Packet >
ns3::Callback
Callback template class.
Definition:
callback.h:1176
ns3::UanMacAloha::SetAddress
virtual void SetAddress(UanAddress addr)
Set the address.
Definition:
uan-mac-aloha.cc:87
ns3::UanMacAloha::m_forUpCb
Callback< void, Ptr< Packet >, const UanAddress & > m_forUpCb
Forwarding up callback.
Definition:
uan-mac-aloha.h:73
ns3::UanMacAloha::GetAddress
Address GetAddress(void)
Get the MAC Address.
Definition:
uan-mac-aloha.cc:81
ns3::UanMacAloha::GetBroadcast
virtual Address GetBroadcast(void) const
Get the broadcast address.
Definition:
uan-mac-aloha.cc:148
ns3::Address
a polymophic address class
Definition:
address.h:90
ns3::UanMac
Virtual base class for all UAN MAC protocols.
Definition:
uan-mac.h:48
third.phy
tuple phy
Definition:
third.py:86
uan-address.h
ns3::UanAddress
A class used for addressing UAN MAC's.
Definition:
uan-address.h:40
ns3::UanMacAloha::RxPacketGood
void RxPacketGood(Ptr< Packet > pkt, double sinr, UanTxMode txMode)
Receive packet from lower layer (passed to PHY as callback).
Definition:
uan-mac-aloha.cc:128
ns3::UanMacAloha::SetForwardUpCb
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, const UanAddress & > cb)
Set the callback to forward packets up to higher layers.
Definition:
uan-mac-aloha.cc:115
ns3::UanTxMode
Abstraction of packet modulation information.
Definition:
uan-tx-mode.h:41
ns3::UanMacAloha::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition:
uan-mac-aloha.cc:70
ns3::UanMacAloha::RxPacketError
void RxPacketError(Ptr< Packet > pkt, double sinr)
Packet received at lower layer in error.
Definition:
uan-mac-aloha.cc:142
ns3::UanMacAloha::~UanMacAloha
virtual ~UanMacAloha()
Dummy destructor, see DoDispose.
Definition:
uan-mac-aloha.cc:43
ns3::UanMacAloha
ALOHA MAC Protocol, the simplest MAC protocol for wireless networks.
Definition:
uan-mac-aloha.h:43
ns3::UanMacAloha::Clear
virtual void Clear(void)
Clears all pointer references.
Definition:
uan-mac-aloha.cc:48
ns3::UanMacAloha::Enqueue
virtual bool Enqueue(Ptr< Packet > pkt, const Address &dest, uint16_t protocolNumber)
Enqueue packet to be transmitted.
Definition:
uan-mac-aloha.cc:92
ns3::UanMacAloha::m_cleared
bool m_cleared
Flag when we've been cleared.
Definition:
uan-mac-aloha.h:75
ns3::UanMacAloha::AttachPhy
virtual void AttachPhy(Ptr< UanPhy > phy)
Attach PHY layer to this MAC.
Definition:
uan-mac-aloha.cc:120
ns3::UanMacAloha::UanMacAloha
UanMacAloha()
Default constructor.
Definition:
uan-mac-aloha.cc:37
ns3::UanMacAloha::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition:
uan-mac-aloha.cc:63
uan-mac.h
ns3::UanMacAloha::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition:
uan-mac-aloha.cc:155
ns3::UanMacAloha::m_address
UanAddress m_address
The MAC address.
Definition:
uan-mac-aloha.h:69
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
src
uan
model
uan-mac-aloha.h
Generated on Wed Jul 6 2016 17:11:41 for ns-3 by
1.8.6