From 2d89f1548dc6928e545f6700cda4293ab0b77715 Mon Sep 17 00:00:00 2001 From: Ulf Wetzker Date: Thu, 9 Apr 2015 19:39:55 +0200 Subject: [PATCH 1/3] Added channel map type --- include/tins/dot11/dot11_mgmt.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/include/tins/dot11/dot11_mgmt.h b/include/tins/dot11/dot11_mgmt.h index 17a4bfd..e1efa70 100644 --- a/include/tins/dot11/dot11_mgmt.h +++ b/include/tins/dot11/dot11_mgmt.h @@ -43,6 +43,21 @@ namespace Tins { */ class Dot11ManagementFrame : public Dot11 { public: + /** + * \brief Enum that represents the map field within a channels map field. + * + * These bitmasks can be used to get or set the second value of + * ibss_dfs_params().channel_map + */ + enum MapMask { + BSS = 0x1, + OFDM_PREAMBLE = 0x2, + UNIDENTIFIED_SIGNAL = 0x4, + RADARE = 0x8, + UNMEASURED = 0x10, + RESERVED = 0xE0 + }; + /** * The supported rates container type. */ @@ -53,6 +68,11 @@ public: */ typedef std::vector > channels_type; + /** + * The channel map container type. + */ + typedef std::vector > channel_map_type; + /** * The requested information container type. */ @@ -409,14 +429,14 @@ public: address_type dfs_owner; uint8_t recovery_interval; - channels_type channel_map; + channel_map_type channel_map; ibss_dfs_params() {} ibss_dfs_params(const address_type &addr, - uint8_t recovery_interval, const channels_type &channels) + uint8_t recovery_interval, const channel_map_type &channel_map) : dfs_owner(addr), recovery_interval(recovery_interval), - channel_map(channels) {} + channel_map(channel_map) {} static ibss_dfs_params from_option(const option &opt); }; From 437911eacd34a6032550e2d715b3f4daa3f693df Mon Sep 17 00:00:00 2001 From: Ulf Wetzker Date: Thu, 9 Apr 2015 19:51:05 +0200 Subject: [PATCH 2/3] Added Doxygen documentation and fixed arrangement --- include/tins/dot11/dot11_mgmt.h | 36 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/include/tins/dot11/dot11_mgmt.h b/include/tins/dot11/dot11_mgmt.h index e1efa70..ee55aba 100644 --- a/include/tins/dot11/dot11_mgmt.h +++ b/include/tins/dot11/dot11_mgmt.h @@ -43,21 +43,6 @@ namespace Tins { */ class Dot11ManagementFrame : public Dot11 { public: - /** - * \brief Enum that represents the map field within a channels map field. - * - * These bitmasks can be used to get or set the second value of - * ibss_dfs_params().channel_map - */ - enum MapMask { - BSS = 0x1, - OFDM_PREAMBLE = 0x2, - UNIDENTIFIED_SIGNAL = 0x4, - RADARE = 0x8, - UNMEASURED = 0x10, - RESERVED = 0xE0 - }; - /** * The supported rates container type. */ @@ -83,6 +68,12 @@ public: */ static const PDU::PDUType pdu_flag = PDU::DOT11_MANAGEMENT; + /** + * \brief Enum used in the reason code field. + * + * These can be used to get or set the second value of + * ibss_dfs_params().channel_map + */ enum ReasonCodes { UNSPECIFIED = 1, PREV_AUTH_NOT_VALID = 2, @@ -117,6 +108,21 @@ public: REQUESTED_BY_STA_TIMEOUT = 39, PEER_STA_NOT_SUPPORT_CIPHER = 45 }; + + /** + * \brief Enum that represents the map field within a channels map field. + * + * These bitmasks can be used to get or set the second value of + * ibss_dfs_params().channel_map + */ + enum MapMask { + BSS = 0x1, + OFDM_PREAMBLE = 0x2, + UNIDENTIFIED_SIGNAL = 0x4, + RADARE = 0x8, + UNMEASURED = 0x10, + RESERVED = 0xE0 + }; /** * Represents the IEEE 802.11 frames' capability information. From bf807be7bdeadae32178e2454c5c89d46a0d5924 Mon Sep 17 00:00:00 2001 From: Ulf Wetzker Date: Thu, 9 Apr 2015 20:26:01 +0200 Subject: [PATCH 3/3] Fixed typo and copy&past nonsense --- include/tins/dot11/dot11_mgmt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tins/dot11/dot11_mgmt.h b/include/tins/dot11/dot11_mgmt.h index ee55aba..8d10777 100644 --- a/include/tins/dot11/dot11_mgmt.h +++ b/include/tins/dot11/dot11_mgmt.h @@ -71,8 +71,8 @@ public: /** * \brief Enum used in the reason code field. * - * These can be used to get or set the second value of - * ibss_dfs_params().channel_map + * This enumeration can be used to get or set the reason code field in a + * Deauthentication or Disassociation */ enum ReasonCodes { UNSPECIFIED = 1, @@ -119,7 +119,7 @@ public: BSS = 0x1, OFDM_PREAMBLE = 0x2, UNIDENTIFIED_SIGNAL = 0x4, - RADARE = 0x8, + RADAR = 0x8, UNMEASURED = 0x10, RESERVED = 0xE0 };