00001 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2006 INRIA 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> 00019 */ 00020 #ifndef MGT_HEADERS_H 00021 #define MGT_HEADERS_H 00022 00023 #include <stdint.h> 00024 00025 #include "ns3/header.h" 00026 #include "status-code.h" 00027 #include "capability-information.h" 00028 #include "supported-rates.h" 00029 #include "ssid.h" 00030 00031 namespace ns3 { 00032 00033 class MgtAssocRequestHeader : public Header 00034 { 00035 public: 00036 MgtAssocRequestHeader (); 00037 ~MgtAssocRequestHeader (); 00038 00039 void SetSsid (Ssid ssid); 00040 void SetSupportedRates (SupportedRates rates); 00041 void SetListenInterval (uint16_t interval); 00042 00043 Ssid GetSsid (void) const; 00044 SupportedRates GetSupportedRates (void) const; 00045 uint16_t GetListenInterval (void) const; 00046 00047 static TypeId GetTypeId (void); 00048 virtual TypeId GetInstanceTypeId (void) const; 00049 virtual void Print (std::ostream &os) const; 00050 virtual uint32_t GetSerializedSize (void) const; 00051 virtual void Serialize (Buffer::Iterator start) const; 00052 virtual uint32_t Deserialize (Buffer::Iterator start); 00053 00054 private: 00055 Ssid m_ssid; 00056 SupportedRates m_rates; 00057 CapabilityInformation m_capability; 00058 uint16_t m_listenInterval; 00059 }; 00060 00061 class MgtAssocResponseHeader : public Header { 00062 public: 00063 MgtAssocResponseHeader (); 00064 ~MgtAssocResponseHeader (); 00065 00066 StatusCode GetStatusCode (void); 00067 SupportedRates GetSupportedRates (void); 00068 00069 void SetSupportedRates (SupportedRates rates); 00070 void SetStatusCode (StatusCode code); 00071 00072 static TypeId GetTypeId (void); 00073 virtual TypeId GetInstanceTypeId (void) const; 00074 virtual void Print (std::ostream &os) const; 00075 virtual uint32_t GetSerializedSize (void) const; 00076 virtual void Serialize (Buffer::Iterator start) const; 00077 virtual uint32_t Deserialize (Buffer::Iterator start); 00078 00079 private: 00080 SupportedRates m_rates; 00081 CapabilityInformation m_capability; 00082 StatusCode m_code; 00083 uint16_t m_aid; 00084 }; 00085 00086 class MgtProbeRequestHeader : public Header { 00087 public: 00088 ~MgtProbeRequestHeader (); 00089 00090 void SetSsid (Ssid ssid); 00091 void SetSupportedRates (SupportedRates rates); 00092 Ssid GetSsid (void) const; 00093 SupportedRates GetSupportedRates (void) const; 00094 00095 static TypeId GetTypeId (void); 00096 virtual TypeId GetInstanceTypeId (void) const; 00097 virtual void Print (std::ostream &os) const; 00098 virtual uint32_t GetSerializedSize (void) const; 00099 virtual void Serialize (Buffer::Iterator start) const; 00100 virtual uint32_t Deserialize (Buffer::Iterator start); 00101 private: 00102 00103 Ssid m_ssid; 00104 SupportedRates m_rates; 00105 }; 00106 00107 class MgtProbeResponseHeader : public Header { 00108 public: 00109 MgtProbeResponseHeader (); 00110 ~MgtProbeResponseHeader (); 00111 00112 Ssid GetSsid (void) const; 00113 uint64_t GetBeaconIntervalUs (void) const; 00114 SupportedRates GetSupportedRates (void) const; 00115 00116 void SetSsid (Ssid ssid); 00117 void SetBeaconIntervalUs (uint64_t us); 00118 void SetSupportedRates (SupportedRates rates); 00119 00120 static TypeId GetTypeId (void); 00121 virtual TypeId GetInstanceTypeId (void) const; 00122 virtual void Print (std::ostream &os) const; 00123 virtual uint32_t GetSerializedSize (void) const; 00124 virtual void Serialize (Buffer::Iterator start) const; 00125 virtual uint32_t Deserialize (Buffer::Iterator start); 00126 00127 private: 00128 Ssid m_ssid; 00129 uint64_t m_beaconInterval; 00130 SupportedRates m_rates; 00131 CapabilityInformation m_capability; 00132 }; 00133 00134 class MgtBeaconHeader : public MgtProbeResponseHeader {}; 00135 00136 00137 } // namespace ns3 00138 00139 #endif /* MGT_HEADERS_H */