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
42
class
UanMacAloha
:
public
UanMac
43
{
44
public
:
45
UanMacAloha
();
46
virtual
~UanMacAloha
();
47
static
TypeId
GetTypeId
(
void
);
48
49
50
//Inheritted functions
51
Address
GetAddress
(
void
);
52
virtual
void
SetAddress
(
UanAddress
addr);
53
virtual
bool
Enqueue
(
Ptr<Packet>
pkt,
const
Address
&dest, uint16_t protocolNumber);
54
virtual
void
SetForwardUpCb
(
Callback
<
void
,
Ptr<Packet>
,
const
UanAddress
& > cb);
55
virtual
void
AttachPhy
(
Ptr<UanPhy>
phy);
56
virtual
Address
GetBroadcast
(
void
)
const
;
57
virtual
void
Clear
(
void
);
58
67
int64_t
AssignStreams
(int64_t stream);
68
69
private
:
70
UanAddress
m_address
;
71
Ptr<UanPhy>
m_phy
;
72
Callback<void, Ptr<Packet>
,
const
UanAddress
& >
m_forUpCb
;
73
bool
m_cleared
;
74
81
void
RxPacketGood
(
Ptr<Packet>
pkt,
double
sinr,
UanTxMode
txMode);
82
88
void
RxPacketError
(
Ptr<Packet>
pkt,
double
sinr);
89
protected
:
90
virtual
void
DoDispose
();
91
};
92
93
}
94
95
#endif
/* UAN_MAC_ALOHA_H */
ns3::UanMacAloha::m_phy
Ptr< UanPhy > m_phy
Definition:
uan-mac-aloha.h:71
ns3::Ptr< Packet >
ns3::Callback
Callback template class.
Definition:
callback.h:920
ns3::UanMacAloha::SetAddress
virtual void SetAddress(UanAddress addr)
Definition:
uan-mac-aloha.cc:86
ns3::UanMacAloha::m_forUpCb
Callback< void, Ptr< Packet >, const UanAddress & > m_forUpCb
Definition:
uan-mac-aloha.h:72
ns3::UanMacAloha::GetAddress
Address GetAddress(void)
Definition:
uan-mac-aloha.cc:80
ns3::UanMacAloha::GetBroadcast
virtual Address GetBroadcast(void) const
Definition:
uan-mac-aloha.cc:147
ns3::Address
a polymophic address class
Definition:
address.h:86
ns3::UanMac
Virtual base class for all UAN MAC protocols.
Definition:
uan-mac.h:47
uan-address.h
ns3::UanAddress
Definition:
uan-address.h:37
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:127
ns3::UanMacAloha::SetForwardUpCb
virtual void SetForwardUpCb(Callback< void, Ptr< Packet >, const UanAddress & > cb)
Definition:
uan-mac-aloha.cc:114
ns3::UanTxMode
Abstraction of packet modulation information.
Definition:
uan-tx-mode.h:36
ns3::UanMacAloha::GetTypeId
static TypeId GetTypeId(void)
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:141
ns3::UanMacAloha::~UanMacAloha
virtual ~UanMacAloha()
Definition:
uan-mac-aloha.cc:43
ns3::UanMacAloha
ALOHA MAC Protocol.
Definition:
uan-mac-aloha.h:42
ns3::UanMacAloha::Clear
virtual void Clear(void)
Definition:
uan-mac-aloha.cc:48
ns3::UanMacAloha::Enqueue
virtual bool Enqueue(Ptr< Packet > pkt, const Address &dest, uint16_t protocolNumber)
Definition:
uan-mac-aloha.cc:91
ns3::UanMacAloha::m_cleared
bool m_cleared
Definition:
uan-mac-aloha.h:73
ns3::UanMacAloha::AttachPhy
virtual void AttachPhy(Ptr< UanPhy > phy)
Definition:
uan-mac-aloha.cc:119
ns3::UanMacAloha::UanMacAloha
UanMacAloha()
Definition:
uan-mac-aloha.cc:37
ns3::UanMacAloha::DoDispose
virtual void DoDispose()
Definition:
uan-mac-aloha.cc:63
uan-mac.h
ns3::UanMacAloha::AssignStreams
int64_t AssignStreams(int64_t stream)
Definition:
uan-mac-aloha.cc:154
ns3::UanMacAloha::m_address
UanAddress m_address
Definition:
uan-mac-aloha.h:70
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
src
uan
model
uan-mac-aloha.h
Generated on Sun Apr 20 2014 11:15:03 for ns-3 by
1.8.6