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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
sta-wifi-mac.h
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2006, 2009 INRIA
4
* Copyright (c) 2009 MIRKO BANCHI
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Author: Mirko Banchi <mk.banchi@gmail.com>
21
*/
22
#ifndef STA_WIFI_MAC_H
23
#define STA_WIFI_MAC_H
24
25
#include "regular-wifi-mac.h"
26
27
#include "ns3/event-id.h"
28
#include "ns3/packet.h"
29
#include "ns3/traced-callback.h"
30
31
#include "supported-rates.h"
32
#include "amsdu-subframe-header.h"
33
34
namespace
ns3 {
35
36
class
MgtAddBaRequestHeader;
37
43
class
StaWifiMac
:
public
RegularWifiMac
44
{
45
public
:
46
static
TypeId
GetTypeId (
void
);
47
48
StaWifiMac
();
49
virtual
~
StaWifiMac
();
50
59
virtual
void
Enqueue
(
Ptr<const Packet>
packet,
Mac48Address
to);
60
65
void
SetMaxMissedBeacons
(uint32_t missed);
72
void
SetProbeRequestTimeout
(
Time
timeout);
79
void
SetAssocRequestTimeout
(
Time
timeout);
80
84
void
StartActiveAssociation
(
void
);
85
86
private
:
87
enum
MacState
88
{
89
ASSOCIATED,
90
WAIT_PROBE_RESP,
91
WAIT_ASSOC_RESP,
92
BEACON_MISSED,
93
REFUSED
94
};
95
96
void
SetActiveProbing (
bool
enable);
97
bool
GetActiveProbing (
void
)
const
;
98
virtual
void
Receive
(
Ptr<Packet>
packet,
const
WifiMacHeader
*hdr);
99
void
SendProbeRequest (
void
);
100
void
SendAssociationRequest (
void
);
101
void
TryToEnsureAssociated (
void
);
102
void
AssocRequestTimeout (
void
);
103
void
ProbeRequestTimeout (
void
);
104
bool
IsAssociated (
void
)
const
;
105
bool
IsWaitAssocResp (
void
)
const
;
106
void
MissedBeacons (
void
);
107
void
RestartBeaconWatchdog (
Time
delay);
108
SupportedRates
GetSupportedRates (
void
)
const
;
109
void
SetState (
enum
MacState value);
110
111
enum
MacState m_state;
112
Time
m_probeRequestTimeout;
113
Time
m_assocRequestTimeout;
114
EventId
m_probeRequestEvent;
115
EventId
m_assocRequestEvent;
116
EventId
m_beaconWatchdog;
117
Time
m_beaconWatchdogEnd;
118
uint32_t m_maxMissedBeacons;
119
120
TracedCallback<Mac48Address>
m_assocLogger;
121
TracedCallback<Mac48Address>
m_deAssocLogger;
122
};
123
124
}
// namespace ns3
125
126
#endif
/* STA_WIFI_MAC_H */
ns3::Time
keep track of time unit.
Definition:
nstime.h:149
ns3::Ptr< const Packet >
ns3::StaWifiMac::Receive
virtual void Receive(Ptr< Packet > packet, const WifiMacHeader *hdr)
Definition:
sta-wifi-mac.cc:374
ns3::StaWifiMac::SetProbeRequestTimeout
void SetProbeRequestTimeout(Time timeout)
Definition:
sta-wifi-mac.cc:122
ns3::TracedCallback
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Definition:
traced-callback.h:43
ns3::SupportedRates
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Definition:
supported-rates.h:92
ns3::StaWifiMac::SetAssocRequestTimeout
void SetAssocRequestTimeout(Time timeout)
Definition:
sta-wifi-mac.cc:129
ns3::RegularWifiMac
base class for all MAC-level wifi objects.This class encapsulates all the low-level MAC functionality...
Definition:
regular-wifi-mac.h:51
ns3::StaWifiMac::StartActiveAssociation
void StartActiveAssociation(void)
Definition:
sta-wifi-mac.cc:136
ns3::StaWifiMac::SetMaxMissedBeacons
void SetMaxMissedBeacons(uint32_t missed)
Definition:
sta-wifi-mac.cc:115
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:41
ns3::EventId
an identifier for simulation events.
Definition:
event-id.h:46
ns3::StaWifiMac::Enqueue
virtual void Enqueue(Ptr< const Packet > packet, Mac48Address to)
Definition:
sta-wifi-mac.cc:308
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:44
ns3::WifiMacHeader
Definition:
wifi-mac-header.h:76
ns3::StaWifiMac
Definition:
sta-wifi-mac.h:43
src
wifi
model
sta-wifi-mac.h
Generated on Sun Mar 16 2014 11:25:12 for ns-3 by
1.8.6