src/devices/wifi/wifi-information-element.h
author Dean Armstrong <deanarm@gmail.com>
Tue, 22 Jun 2010 11:50:55 +0100
changeset 6379 f1031f074dbd
parent 6378 57485ed01268
child 6380 650233cda60e
permissions -rw-r--r--
Bug 881: Change WifiElementId to WifiInformationElementId
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     2
/*
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     3
 * Copyright (c) 2010 Dean Armstrong
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     4
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     8
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    12
 * GNU General Public License for more details.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    13
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    17
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    18
 * Authors: Dean Armstrong <deanarm@gmail.com>
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    19
 */
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    20
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    21
#ifndef WIFI_INFORMATION_ELEMENT_H
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    22
#define WIFI_INFORMATION_ELEMENT_H
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    23
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    24
#include "ns3/header.h"
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    25
#include "ns3/simple-ref-count.h"
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    26
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    27
/**
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    28
 * \ingroup wifi
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    29
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    30
 * \subsection wifi_ie Information Elements
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    31
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    32
 * The IEEE 802.11 standard includes the notion of Information
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    33
 * Elements, which are encodings of management information to be
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    34
 * communicated between STAs in the payload of various frames of type
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    35
 * Management. Information Elements (IEs) have a common format, each
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    36
 * starting with a single octet - the Element ID, which indicates the
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    37
 * specific type of IE (a type to represent the options here is
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    38
 * defined as WifiInformationElementId). The next octet is a length field and
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    39
 * encodes the number of octets in the third and final field, which is
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    40
 * the IE Information field.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    41
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    42
 * The class ns3::WifiInformationElement provides a base for classes
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    43
 * which represent specific Information Elements. This class defines
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    44
 * pure virtual methods for serialisation
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    45
 * (ns3::WifiInformationElement::SerializeInformation) and
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    46
 * deserialisation
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    47
 * (ns3::WifiInformationElement::DeserializeInformation) of IEs, from
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    48
 * or to data members or other objects that simulation objects use to
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    49
 * maintain the relevant state.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    50
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    51
 * This class also provides an implementation of the equality
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    52
 * operator, which operates by comparing the serialised versions of
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    53
 * the two WifiInformationElement objects concerned.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    54
 */
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    55
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    56
namespace ns3 {
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    57
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    58
/**
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    59
 * This type is used to represent an Information Element ID. An
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    60
 * enumeration would be tidier, but doesn't provide for the
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    61
 * inheritance that is currently preferable to cleanly support
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    62
 * pre-standard modules such as mesh. Maybe there is a nice way of
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    63
 * doing this with a class.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    64
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    65
 * Until such time as a better way of implementing this is dreamt up
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    66
 * and applied, developers will need to be careful to avoid
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    67
 * duplication of IE IDs in the #definitions below (and in files which
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    68
 * declare "subclasses" of WifiInformationElement). Sorry.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    69
 */
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    70
typedef uint8_t WifiInformationElementId;
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    71
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    72
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    73
/**
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    74
 * Here we have definition of all Information Element IDs in IEEE
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    75
 * 802.11-2007. See the comments for WifiInformationElementId - this could
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    76
 * probably be done in a considerably tidier manner.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    77
 */
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    78
#define IE_SSID                                ((WifiInformationElementId)0)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    79
#define IE_SUPPORTED_RATES                     ((WifiInformationElementId)1)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    80
#define IE_FH_PARAMETER_SET                    ((WifiInformationElementId)2)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    81
#define IE_DS_PARAMETER_SET                    ((WifiInformationElementId)3)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    82
#define IE_CF_PARAMETER_SET                    ((WifiInformationElementId)4)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    83
#define IE_TIM                                 ((WifiInformationElementId)5)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    84
#define IE_IBSS_PARAMETER_SET                  ((WifiInformationElementId)6)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    85
#define IE_COUNTRY                             ((WifiInformationElementId)7)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    86
#define IE_HOPPING_PATTERN_PARAMETERS          ((WifiInformationElementId)8)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    87
#define IE_HOPPING_PATTERN_TABLE               ((WifiInformationElementId)9)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    88
#define IE_REQUEST                             ((WifiInformationElementId)10)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    89
#define IE_BSS_LOAD                            ((WifiInformationElementId)11)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    90
#define IE_EDCA_PARAMETER_SET                  ((WifiInformationElementId)12)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    91
#define IE_TSPEC                               ((WifiInformationElementId)13)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    92
#define IE_TCLAS                               ((WifiInformationElementId)14)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    93
#define IE_SCHEDULE                            ((WifiInformationElementId)15)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    94
#define IE_CHALLENGE_TEXT                      ((WifiInformationElementId)16)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    95
// 17 to 31 are reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    96
#define IE_POWER_CONSTRAINT                    ((WifiInformationElementId)32)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    97
#define IE_POWER_CAPABILITY                    ((WifiInformationElementId)33)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    98
#define IE_TPC_REQUEST                         ((WifiInformationElementId)34)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    99
#define IE_TPC_REPORT                          ((WifiInformationElementId)35)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   100
#define IE_SUPPORTED_CHANNELS                  ((WifiInformationElementId)36)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   101
#define IE_CHANNEL_SWITCH_ANNOUNCEMENT         ((WifiInformationElementId)37)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   102
#define IE_MEASUREMENT_REQUEST                 ((WifiInformationElementId)38)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   103
#define IE_MEASUREMENT_REPORT                  ((WifiInformationElementId)39)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   104
#define IE_QUIET                               ((WifiInformationElementId)40)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   105
#define IE_IBSS_DFS                            ((WifiInformationElementId)41)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   106
#define IE_ERP_INFORMATION                     ((WifiInformationElementId)42)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   107
#define IE_TS_DELAY                            ((WifiInformationElementId)43)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   108
#define IE_TCLAS_PROCESSING                    ((WifiInformationElementId)44)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   109
// 45 is reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   110
#define IE_QOS_CAPABILITY                      ((WifiInformationElementId)46)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   111
// 47 is reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   112
#define IE_RSN                                 ((WifiInformationElementId)48)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   113
// 49 is reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   114
#define IE_EXTENDED_SUPPORTED_RATES            ((WifiInformationElementId)50)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   115
// 51 to 126 are reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   116
#define IE_EXTENDED_CAPABILITIES               ((WifiInformationElementId)127)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   117
// 128 to 220 are reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   118
#define IE_VENDOR_SPECIFIC                     ((WifiInformationElementId)221)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   119
// 222 to 255 are reserved in 802.11-2007
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   120
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   121
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   122
/**
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   123
 * \brief Information element, as defined in 802.11-2007 standard
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   124
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   125
 * Elements are defined to have a common general format consisting of
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   126
 * a 1 octet Element ID field, a 1 octet length field, and a
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   127
 * variable-length element-specific information field. Each element is
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   128
 * assigned a unique Element ID as defined in this standard. The
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   129
 * Length field specifies the number of octets in the Information
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   130
 * field.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   131
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   132
 * This class is pure virtual and acts as base for classes which know
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   133
 * how to serialize specific IEs.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   134
 */
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   135
class WifiInformationElement : public SimpleRefCount<WifiInformationElement>
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   136
{
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   137
public:
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   138
  virtual ~WifiInformationElement ();
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   139
  ///\name Each subclass must implement
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   140
  //\{
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   141
  virtual void Print (std::ostream &os) const = 0;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   142
  /// Own unique Element ID
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   143
  virtual WifiInformationElementId ElementId () const = 0;
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   144
  /// Length of serialized information
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   145
  virtual uint8_t GetInformationSize () const = 0;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   146
  /// Serialize information
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   147
  virtual void SerializeInformation (Buffer::Iterator start) const = 0;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   148
  /// Deserialize information
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   149
  virtual uint8_t DeserializeInformation (Buffer::Iterator start,
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   150
                                          uint8_t length) = 0;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   151
  //\}
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   152
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   153
  /// Compare information elements using Element ID
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   154
  virtual bool operator< (WifiInformationElement const & a) const;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   155
  /// Compare two IEs for equality by ID & Length, and then through
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   156
  /// memcmp of serialised version
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   157
  virtual bool operator== (WifiInformationElement const & a) const;
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   158
};
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   159
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   160
}
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   161
#endif /* WIFI_INFORMATION_ELEMENT_H */