author | Mirko Banchi <mk.banchi@gmail.com> |
Wed, 03 Feb 2010 20:34:52 +0100 | |
changeset 5958 | dd0accd82659 |
parent 5953 | 9e400f6b8a2c |
child 6331 | eee2eab36748 |
permissions | -rw-r--r-- |
4408 | 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 QAP_WIFI_MAC_H |
|
23 |
#define QAP_WIFI_MAC_H |
|
24 |
||
25 |
#include "ns3/mac48-address.h" |
|
26 |
#include "ns3/callback.h" |
|
27 |
#include "ns3/packet.h" |
|
28 |
#include "ns3/nstime.h" |
|
29 |
#include "ns3/event-id.h" |
|
30 |
||
31 |
#include "supported-rates.h" |
|
32 |
#include "wifi-remote-station-manager.h" |
|
33 |
#include "wifi-mac.h" |
|
34 |
#include "qos-utils.h" |
|
35 |
||
36 |
#include <map> |
|
37 |
||
38 |
namespace ns3 { |
|
39 |
||
40 |
class DcaTxop; |
|
41 |
class EdcaTxopN; |
|
42 |
class WifiMacHeader; |
|
43 |
class WifiPhy; |
|
44 |
class MacLow; |
|
45 |
class MacRxMiddle; |
|
46 |
class MacTxMiddle; |
|
47 |
class DcfManager; |
|
48 |
class AmsduSubframeHeader; |
|
49 |
class MsduAggregator; |
|
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
50 |
class MgtAddBaRequestHeader; |
4408 | 51 |
|
52 |
class QapWifiMac : public WifiMac |
|
53 |
{ |
|
54 |
public: |
|
55 |
static TypeId GetTypeId (void); |
|
56 |
QapWifiMac (); |
|
57 |
virtual ~QapWifiMac (); |
|
58 |
||
59 |
// inherited from WifiMac. |
|
60 |
virtual void SetSlot (Time slotTime); |
|
61 |
virtual void SetSifs (Time sifs); |
|
62 |
virtual void SetEifsNoDifs (Time eifsNoDifs); |
|
63 |
virtual void SetAckTimeout (Time ackTimeout); |
|
64 |
virtual void SetCtsTimeout (Time ctsTimeout); |
|
65 |
virtual void SetPifs (Time pifs); |
|
66 |
virtual Time GetSlot (void) const; |
|
67 |
virtual Time GetSifs (void) const; |
|
68 |
virtual Time GetEifsNoDifs (void) const; |
|
69 |
virtual Time GetAckTimeout (void) const; |
|
70 |
virtual Time GetCtsTimeout (void) const; |
|
71 |
virtual Time GetPifs (void) const; |
|
72 |
virtual void SetWifiPhy (Ptr<WifiPhy> phy); |
|
73 |
virtual void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> stationManager); |
|
74 |
virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to, Mac48Address from); |
|
75 |
virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to); |
|
76 |
virtual bool SupportsSendFrom (void) const; |
|
77 |
virtual void SetForwardUpCallback (Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> upCallback); |
|
78 |
virtual void SetLinkUpCallback (Callback<void> linkUp); |
|
79 |
virtual void SetLinkDownCallback (Callback<void> linkDown); |
|
80 |
virtual Mac48Address GetAddress (void) const; |
|
81 |
virtual Ssid GetSsid (void) const; |
|
82 |
virtual void SetAddress (Mac48Address address); |
|
83 |
virtual void SetSsid (Ssid ssid); |
|
84 |
virtual Mac48Address GetBssid (void) const; |
|
5958 | 85 |
virtual void SetBasicBlockAckTimeout (Time blockAckTimeout); |
86 |
virtual void SetCompressedBlockAckTimeout (Time blockAckTimeout); |
|
87 |
virtual Time GetBasicBlockAckTimeout (void) const; |
|
88 |
virtual Time GetCompressedBlockAckTimeout (void) const; |
|
4408 | 89 |
|
90 |
void SetBeaconInterval (Time interval); |
|
91 |
Time GetBeaconInterval (void) const; |
|
92 |
void StartBeaconing (void); |
|
93 |
||
94 |
private: |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
95 |
typedef std::map<AccessClass, Ptr<EdcaTxopN> > Queues; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
96 |
typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> > DeaggregatedMsdus; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
97 |
typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI; |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
98 |
|
4408 | 99 |
virtual void DoDispose (void); |
5524
efed7493f2c1
Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents:
4720
diff
changeset
|
100 |
virtual void DoStart (void); |
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5524
diff
changeset
|
101 |
void Receive (Ptr<Packet> packet, const WifiMacHeader* hdr); |
4408 | 102 |
void ForwardUp (Ptr<Packet> packet, Mac48Address from, Mac48Address to); |
103 |
void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to); |
|
104 |
/* Next function is invoked only when ap relies a frame. */ |
|
105 |
void ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Address to, |
|
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5524
diff
changeset
|
106 |
const WifiMacHeader* oldHdr); |
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5524
diff
changeset
|
107 |
void TxOk (const WifiMacHeader& hdr); |
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5524
diff
changeset
|
108 |
void TxFailed (const WifiMacHeader& hdr); |
4408 | 109 |
void SendProbeResp (Mac48Address to); |
110 |
void SendAssocResp (Mac48Address to, bool success); |
|
5953
9e400f6b8a2c
handle wifi action frames in high MACs
Mirko Banchi <mk.banchi@gmail.com>
parents:
5819
diff
changeset
|
111 |
void SendAddBaResponse (const MgtAddBaRequestHeader *reqHdr, Mac48Address originator); |
4408 | 112 |
void SendOneBeacon (void); |
113 |
SupportedRates GetSupportedRates (void) const; |
|
114 |
void SetBeaconGeneration (bool enable); |
|
115 |
bool GetBeaconGeneration (void) const; |
|
116 |
||
5819
514ec98954ab
Wifi code cleanup: Correcting various const keyword ordering and removing superfluous (boolean)?true:false.
Timo Bingmann <tbns@idlebox.net>
parents:
5524
diff
changeset
|
117 |
void DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket, const WifiMacHeader* hdr); |
4421
0608881b163f
help python bindings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
118 |
QapWifiMac &operator = (const QapWifiMac &); |
0608881b163f
help python bindings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
119 |
QapWifiMac (const QapWifiMac &); |
4408 | 120 |
|
121 |
Ptr<EdcaTxopN> GetVOQueue (void) const; |
|
122 |
Ptr<EdcaTxopN> GetVIQueue (void) const; |
|
123 |
Ptr<EdcaTxopN> GetBEQueue (void) const; |
|
124 |
Ptr<EdcaTxopN> GetBKQueue (void) const; |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
125 |
void SetQueue (enum AccessClass ac); |
4408 | 126 |
|
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
127 |
virtual void FinishConfigureStandard (enum WifiPhyStandard standard); |
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
128 |
|
4408 | 129 |
Queues m_queues; |
130 |
Ptr<DcaTxop> m_beaconDca; |
|
131 |
Ptr<MacLow> m_low; |
|
132 |
Ptr<WifiPhy> m_phy; |
|
133 |
Ptr<WifiRemoteStationManager> m_stationManager; |
|
134 |
MacRxMiddle *m_rxMiddle; |
|
135 |
MacTxMiddle *m_txMiddle; |
|
136 |
DcfManager *m_dcfManager; |
|
137 |
Ssid m_ssid; |
|
138 |
EventId m_beaconEvent; |
|
139 |
Time m_beaconInterval; |
|
5524
efed7493f2c1
Make applications generate traffic within their associated context/node
Guillaume Seguin <guillaume@segu.in>
parents:
4720
diff
changeset
|
140 |
bool m_enableBeaconGeneration; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4461
diff
changeset
|
141 |
Callback<void,Ptr<Packet>, Mac48Address, Mac48Address> m_forwardUp; |
4408 | 142 |
}; |
143 |
||
144 |
} //namespace ns3 |
|
145 |
||
146 |
#endif /* QAP_WIFI_MAC_H */ |