src/devices/wifi/qos-utils.h
author Pavel Boyko <boyko@iitp.ru>
Tue, 16 Jun 2009 17:58:16 +0400
changeset 5074 355de6af8ea9
parent 4404 e10005ac0701
child 4720 15221757964f
permissions -rw-r--r--
merged with nsnam
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    29
enum AccessClass {
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    30
  AC_VO = 0,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    31
  AC_VI = 1,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    32
  AC_BE = 2,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    33
  AC_BK = 3,
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    34
  AC_UNDEF
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    35
};
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    36
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    37
/* Maps TID (Traffic ID) to Access classes.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    38
 * 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
    39
 */
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    40
AccessClass QosUtilsMapTidToAc (uint8_t tid);
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    41
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    42
/* 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
    43
   A value >= 8 is returned otherwise.
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    44
 */
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    45
uint8_t QosUtilsGetTidForPacket (Ptr<const Packet> packet);
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
} //namespace ns3
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    48
e10005ac0701 shared facility for qos support
Mirko Banchi <mk.banchi@gmail.com>
parents:
diff changeset
    49
#endif /* QOS_UTILS_H */