author | Dean Armstrong <deanarm@gmail.com> |
Thu, 03 Jun 2010 17:23:55 +0100 | |
changeset 6331 | eee2eab36748 |
parent 5956 | e9918be47f78 |
child 6600 | e438f9b17c66 |
permissions | -rw-r--r-- |
4404
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
2 |
/* |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
3 |
* Copyright (c) 2009 MIRKO BANCHI |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
4 |
* |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
8 |
* |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
13 |
* |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
17 |
* |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
18 |
* Author: Mirko Banchi <mk.banchi@gmail.com> |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
19 |
*/ |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
20 |
#ifndef QOS_UTILS_H |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
21 |
#define QOS_UTILS_H |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
22 |
|
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
23 |
#include "ns3/uinteger.h" |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
24 |
#include "ns3/ptr.h" |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
25 |
#include "ns3/packet.h" |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
26 |
|
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
27 |
namespace ns3 { |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
28 |
|
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
29 |
/* This enumeration defines the Access Categories as an enumeration |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
30 |
* with values corresponding to the AC index (ACI) values specified in |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
31 |
* Table 7-36 of IEEE 802.11-2007. |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
32 |
*/ |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
33 |
enum AcIndex { |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
34 |
/** Best Effort */ |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
35 |
AC_BE = 0, |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
36 |
/** Background */ |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
37 |
AC_BK = 1, |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
38 |
/** Video */ |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
39 |
AC_VI = 2, |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
40 |
/** Voice */ |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
41 |
AC_VO = 3, |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
42 |
|
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
43 |
/** Total number of ACs */ |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4404
diff
changeset
|
44 |
AC_BE_NQOS = 4, |
4404
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
45 |
AC_UNDEF |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
46 |
}; |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
47 |
|
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
48 |
/* Maps TID (Traffic ID) to Access classes. |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
49 |
* For more details see table 9-1 of IEEE802.11 standard. |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
50 |
*/ |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
5956
diff
changeset
|
51 |
AcIndex QosUtilsMapTidToAc (uint8_t tid); |
4404
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
52 |
|
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
53 |
/* If a qos tag is attached to the packet, returns a value < 8. |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
54 |
A value >= 8 is returned otherwise. |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
55 |
*/ |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
56 |
uint8_t QosUtilsGetTidForPacket (Ptr<const Packet> packet); |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
57 |
|
5956
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
58 |
/* |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
59 |
* Next function is useful to correctly sort buffered packets under block ack. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
60 |
* When an BAR is received from originator station, completed "old" |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
61 |
* (see section 9.10.3 in IEEE802.11e) packets must be forwarded up before "new" packets. |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
62 |
*/ |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
63 |
uint32_t QosUtilsMapSeqControlToUniqueInteger (uint16_t seqControl, uint16_t endSequence); |
e9918be47f78
MacLow now buffers QoS MPDUs under Block Ack
Mirko Banchi <mk.banchi@gmail.com>
parents:
4720
diff
changeset
|
64 |
|
4404
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
65 |
} //namespace ns3 |
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
66 |
|
e10005ac0701
shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff
changeset
|
67 |
#endif /* QOS_UTILS_H */ |