src/wifi/model/wifi-information-element.h
author Ghada Badawy <gbadawy@gmail.com>
Tue, 13 Aug 2013 22:05:25 -0700
changeset 10139 17a71cd49da3
parent 7139 79dd02ed46ec
child 10483 e3a02ed14587
permissions -rw-r--r--
partial 802.11n support
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
namespace ns3 {
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    28
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
 * 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
    31
 * 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
    32
 * 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
    33
 * 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
    34
 * doing this with a class.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    35
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    36
 * 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
    37
 * and applied, developers will need to be careful to avoid
6445
43d91786d268 simple doxygen fixes
Josh Pelkey <jpelkey@gatech.edu>
parents: 6389
diff changeset
    38
 * duplication of IE IDs in the defines below (and in files which
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    39
 * declare "subclasses" of WifiInformationElement). Sorry.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    40
 */
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    41
typedef uint8_t WifiInformationElementId;
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    42
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    43
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    44
/**
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    45
 * 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
    46
 * 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
    47
 * 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
    48
 */
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    49
#define IE_SSID                                ((WifiInformationElementId)0)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    50
#define IE_SUPPORTED_RATES                     ((WifiInformationElementId)1)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    51
#define IE_FH_PARAMETER_SET                    ((WifiInformationElementId)2)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    52
#define IE_DS_PARAMETER_SET                    ((WifiInformationElementId)3)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    53
#define IE_CF_PARAMETER_SET                    ((WifiInformationElementId)4)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    54
#define IE_TIM                                 ((WifiInformationElementId)5)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    55
#define IE_IBSS_PARAMETER_SET                  ((WifiInformationElementId)6)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    56
#define IE_COUNTRY                             ((WifiInformationElementId)7)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    57
#define IE_HOPPING_PATTERN_PARAMETERS          ((WifiInformationElementId)8)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    58
#define IE_HOPPING_PATTERN_TABLE               ((WifiInformationElementId)9)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    59
#define IE_REQUEST                             ((WifiInformationElementId)10)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    60
#define IE_BSS_LOAD                            ((WifiInformationElementId)11)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    61
#define IE_EDCA_PARAMETER_SET                  ((WifiInformationElementId)12)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    62
#define IE_TSPEC                               ((WifiInformationElementId)13)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    63
#define IE_TCLAS                               ((WifiInformationElementId)14)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    64
#define IE_SCHEDULE                            ((WifiInformationElementId)15)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    65
#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
    66
// 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
    67
#define IE_POWER_CONSTRAINT                    ((WifiInformationElementId)32)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    68
#define IE_POWER_CAPABILITY                    ((WifiInformationElementId)33)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    69
#define IE_TPC_REQUEST                         ((WifiInformationElementId)34)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    70
#define IE_TPC_REPORT                          ((WifiInformationElementId)35)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    71
#define IE_SUPPORTED_CHANNELS                  ((WifiInformationElementId)36)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    72
#define IE_CHANNEL_SWITCH_ANNOUNCEMENT         ((WifiInformationElementId)37)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    73
#define IE_MEASUREMENT_REQUEST                 ((WifiInformationElementId)38)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    74
#define IE_MEASUREMENT_REPORT                  ((WifiInformationElementId)39)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    75
#define IE_QUIET                               ((WifiInformationElementId)40)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    76
#define IE_IBSS_DFS                            ((WifiInformationElementId)41)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    77
#define IE_ERP_INFORMATION                     ((WifiInformationElementId)42)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    78
#define IE_TS_DELAY                            ((WifiInformationElementId)43)
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    79
#define IE_TCLAS_PROCESSING                    ((WifiInformationElementId)44)
10139
17a71cd49da3 partial 802.11n support
Ghada Badawy <gbadawy@gmail.com>
parents: 7139
diff changeset
    80
#define IE_HT_CAPABILITIES                     ((WifiInformationElementId)45)
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    81
#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
    82
// 47 is reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    83
#define IE_RSN                                 ((WifiInformationElementId)48)
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    84
// 49 is reserved in 802.11-2007
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
    85
#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
    86
// 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
    87
#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
    88
// 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
    89
#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
    90
// 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
    91
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    92
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    93
/**
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
    94
 * \brief Information element, as defined in 802.11-2007 standard
7139
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    95
 * \ingroup wifi
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    96
 *
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    97
 * The IEEE 802.11 standard includes the notion of Information
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    98
 * Elements, which are encodings of management information to be
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
    99
 * communicated between STAs in the payload of various frames of type
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   100
 * Management. Information Elements (IEs) have a common format, each
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   101
 * starting with a single octet - the Element ID, which indicates the
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   102
 * specific type of IE (a type to represent the options here is
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   103
 * defined as WifiInformationElementId). The next octet is a length field and
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   104
 * encodes the number of octets in the third and final field, which is
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   105
 * the IE Information field.
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   106
 *
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   107
 * The class ns3::WifiInformationElement provides a base for classes
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   108
 * which represent specific Information Elements. This class defines
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   109
 * pure virtual methods for serialisation
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   110
 * (ns3::WifiInformationElement::SerializeInformationField) and
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   111
 * deserialisation
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   112
 * (ns3::WifiInformationElement::DeserializeInformationField) of IEs, from
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   113
 * or to data members or other objects that simulation objects use to
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   114
 * maintain the relevant state.
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   115
 *
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   116
 * This class also provides an implementation of the equality
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   117
 * operator, which operates by comparing the serialised versions of
79dd02ed46ec doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents: 6852
diff changeset
   118
 * the two WifiInformationElement objects concerned.
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   119
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   120
 * 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
   121
 * 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
   122
 * 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
   123
 * 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
   124
 * 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
   125
 * field.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   126
 *
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   127
 * 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
   128
 * how to serialize specific IEs.
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   129
 */
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   130
class WifiInformationElement : public SimpleRefCount<WifiInformationElement>
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
public:
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   133
  virtual ~WifiInformationElement ();
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   134
  /// Serialize entire IE including Element ID and length fields
6389
6e83ec53ba0a Bug 881: Add missing rename of SerializeIE to Serialize.
Dean Armstrong <deanarm@gmail.com>
parents: 6382
diff changeset
   135
  Buffer::Iterator Serialize (Buffer::Iterator i) const;
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   136
  /// Deserialize entire IE, which must be present. The iterator
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   137
  /// passed in must be pointing at the Element ID (i.e., the very
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   138
  /// first octet) of the correct type of information element,
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   139
  /// otherwise this method will generate a fatal error.
6382
9e5768e48981 Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents: 6380
diff changeset
   140
  Buffer::Iterator Deserialize (Buffer::Iterator i);
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   141
  /// Deserialize entire IE if it is present. The iterator passed in
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   142
  /// must be pointing at the Element ID of an information element. If
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   143
  /// the Element ID is not the one that the given class is interested
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   144
  /// in then it will return the same iterator.
6382
9e5768e48981 Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents: 6380
diff changeset
   145
  Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i);
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   146
  /// Get the size of the serialized IE including Element ID and
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   147
  /// length fields.
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   148
  uint16_t GetSerializedSize () const;
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   149
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   150
  ///\name Each subclass must implement
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
  /// Own unique Element ID
6379
f1031f074dbd Bug 881: Change WifiElementId to WifiInformationElementId
Dean Armstrong <deanarm@gmail.com>
parents: 6378
diff changeset
   153
  virtual WifiInformationElementId ElementId () const = 0;
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   154
  /// Length of serialized information (i.e., the length of the body
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   155
  /// of the IE, not including the Element ID and length octets. This
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   156
  /// is the value that will appear in the second octet of the entire
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   157
  /// IE - the length field)
6382
9e5768e48981 Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents: 6380
diff changeset
   158
  virtual uint8_t GetInformationFieldSize () const = 0;
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   159
  /// Serialize information (i.e., the body of the IE, not including
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   160
  /// the Element ID and length octets)
6382
9e5768e48981 Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents: 6380
diff changeset
   161
  virtual void SerializeInformationField (Buffer::Iterator start) const = 0;
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   162
  /// Deserialize information (i.e., the body of the IE, not including
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   163
  /// the Element ID and length octets)
6382
9e5768e48981 Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents: 6380
diff changeset
   164
  virtual uint8_t DeserializeInformationField (Buffer::Iterator start,
9e5768e48981 Bug 881: WifiInformationElement method renaming
Dean Armstrong <deanarm@gmail.com>
parents: 6380
diff changeset
   165
                                               uint8_t length) = 0;
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   166
  //\}
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   167
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   168
  /// In addition, a subclass may optionally override the following...
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   169
  //\{
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   170
  /// Generate human-readable form of IE
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   171
  virtual void Print (std::ostream &os) const;
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   172
  /// Compare information elements using Element ID
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   173
  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
   174
  /// 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
   175
  /// memcmp of serialised version
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   176
  virtual bool operator== (WifiInformationElement const & a) const;
6380
650233cda60e Bug 881: Bring Wi-Fi IE serdes intelligence into WifiInformationElement object
Dean Armstrong <deanarm@gmail.com>
parents: 6379
diff changeset
   177
  //\}
6378
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   178
};
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   179
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   180
}
57485ed01268 Bug 881: Extract WifiInformationElement(Vector) core to wifi module
Dean Armstrong <deanarm@gmail.com>
parents:
diff changeset
   181
#endif /* WIFI_INFORMATION_ELEMENT_H */