dot11s-codes.h removed. StatusCode enum is found to be unused and removed. ReadonCode enum is moved to dot11s/ie-dot11s-peer-management.h
--- a/src/devices/mesh/dot11s-codes.h Mon Mar 30 17:47:20 2009 +0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2008,2009 IITP RAS
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: Aleksey Kovalenko <kovalenko@iitp.ru>
- * Kirill Andreev <andreev@iitp.ru>
- */
-
-
-#ifndef DOT11S_CODES_H
-#define DOT11S_CODES_H
-
-#include "wifi-information-element.h"
-
-namespace ns3 {
-
-/**
- * \ingroup mesh
- */
-enum dot11sReasonCode {
- REASON11S_PEER_LINK_CANCELLED,
- REASON11S_MESH_MAX_PEERS,
- REASON11S_MESH_CAPABILITY_POLICY_VIOLATION,
- REASON11S_MESH_CLOSE_RCVD,
- REASON11S_MESH_MAX_RETRIES,
- REASON11S_MESH_CONFIRM_TIMEOUT,
- REASON11S_MESH_SECURITY_ROLE_NEGOTIATION_DIFFERS,
- REASON11S_MESH_SECURITY_AUTHENTICATION_IMPOSSIBLE,
- REASON11S_MESH_SECURITY_FAILED_VERIFICATION,
- REASON11S_MESH_INVALID_GTK,
- REASON11S_MESH_MISMATCH_GTK,
- REASON11S_MESH_INCONSISTENT_PARAMETERS,
- REASON11S_MESH_CONFIGURATION_POLICY_VIOLATION,
- REASON11S_RESERVED,
-};
-
-/**
- * \ingroup mesh
- */
-enum dot11sStatusCode {
- STATUS11S_PEAR_LINK_ESTABLISHED,
- STATUS11S_PEAR_LINK_CLOSED,
- STATUS11S_NO_LISTED_KEY_HOLDER,
- STATUS11S_MESH_KEY_HANDSHAKE_MALFORMED,
- STATUS11S_PEAR_LINK_MAX_RETRIES,
- STATUS11S_PEAR_LINK_NO_PMK,
- STATUS11S_PEAR_LINK_ALT_PMK,
- STATUS11S_PEAR_LINK_NO_AKM,
- STATUS11S_PEAR_LINK_ALT_AKM,
- STATUS11S_PEAR_LINK_NO_KDF,
- STATUS11S_PEAR_LINK_SA_ESTABLISHED,
- STATUS11S_AUTHENTICATION_REJECTED_CLOGGING,
- STATUS11S_RESERVED,
-};
-
-}
-#endif
--- a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h Mon Mar 30 18:13:48 2009 +0400
@@ -24,7 +24,6 @@
#include <list>
#include "ns3/nstime.h"
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
--- a/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc Mon Mar 30 18:13:48 2009 +0400
@@ -46,7 +46,7 @@
m_localLinkId = localLinkId;
}
void
-IePeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode)
+IePeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId, PmpReasonCode reasonCode)
{
m_length = 7;
m_subtype = PEER_CLOSE;
@@ -64,7 +64,7 @@
m_peerLinkId = peerLinkId;
}
-dot11sReasonCode
+PmpReasonCode
IePeerManagement::GetReasonCode () const
{
return m_reasonCode;
@@ -130,7 +130,7 @@
if (m_length > 3)
m_peerLinkId = i.ReadNtohU16 ();
if (m_length > 5)
- m_reasonCode = (dot11sReasonCode)i.ReadNtohU16 ();
+ m_reasonCode = (PmpReasonCode)i.ReadNtohU16 ();
return i.GetDistanceFrom (start);
}
void
--- a/src/devices/mesh/dot11s/ie-dot11s-peer-management.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.h Mon Mar 30 18:13:48 2009 +0400
@@ -23,11 +23,32 @@
#ifndef MESH_PEER_MAN_ELEMENT
#define MESH_PEER_MAN_ELEMENT
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
namespace dot11s {
+
+/**
+ * \ingroup dot11s
+ * \brief Codes used by 802.11s Peer Management Protocol
+ */
+enum PmpReasonCode {
+ REASON11S_PEER_LINK_CANCELLED,
+ REASON11S_MESH_MAX_PEERS,
+ REASON11S_MESH_CAPABILITY_POLICY_VIOLATION,
+ REASON11S_MESH_CLOSE_RCVD,
+ REASON11S_MESH_MAX_RETRIES,
+ REASON11S_MESH_CONFIRM_TIMEOUT,
+ REASON11S_MESH_SECURITY_ROLE_NEGOTIATION_DIFFERS,
+ REASON11S_MESH_SECURITY_AUTHENTICATION_IMPOSSIBLE,
+ REASON11S_MESH_SECURITY_FAILED_VERIFICATION,
+ REASON11S_MESH_INVALID_GTK,
+ REASON11S_MESH_MISMATCH_GTK,
+ REASON11S_MESH_INCONSISTENT_PARAMETERS,
+ REASON11S_MESH_CONFIGURATION_POLICY_VIOLATION,
+ REASON11S_RESERVED,
+};
+
/**
* \ingroup dot11s
* \brief See 7.3.2.85 of draft 2.07
@@ -42,10 +63,10 @@
PEER_CONFIRM = 2,
};
void SetPeerOpen (uint16_t localLinkId);
- void SetPeerClose (uint16_t localLinkID, uint16_t peerLinkId, dot11sReasonCode reasonCode);
+ void SetPeerClose (uint16_t localLinkID, uint16_t peerLinkId, PmpReasonCode reasonCode);
void SetPeerConfirm (uint16_t localLinkID, uint16_t peerLinkId);
- dot11sReasonCode GetReasonCode () const;
+ PmpReasonCode GetReasonCode () const;
uint16_t GetLocalLinkId () const;
uint16_t GetPeerLinkId () const;
bool SubtypeIsOpen () const;
@@ -71,7 +92,7 @@
/**
* Present only within close frame
*/
- dot11sReasonCode m_reasonCode;
+ PmpReasonCode m_reasonCode;
};
} // namespace dot11s
--- a/src/devices/mesh/dot11s/ie-dot11s-perr.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-perr.h Mon Mar 30 18:13:48 2009 +0400
@@ -23,7 +23,6 @@
#define PERR_INFORMATION_ELEMENT_H
#include "ns3/mac48-address.h"
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
--- a/src/devices/mesh/dot11s/ie-dot11s-prep.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-prep.h Mon Mar 30 18:13:48 2009 +0400
@@ -24,7 +24,6 @@
#include "ns3/mac48-address.h"
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
--- a/src/devices/mesh/dot11s/ie-dot11s-preq.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-preq.h Mon Mar 30 18:13:48 2009 +0400
@@ -25,7 +25,6 @@
#include <vector>
#include "ns3/mac48-address.h"
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
--- a/src/devices/mesh/dot11s/ie-dot11s-rann.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/ie-dot11s-rann.h Mon Mar 30 18:13:48 2009 +0400
@@ -23,7 +23,6 @@
#define RANN_INFORMATION_ELEMENT_H
#include "ns3/mac48-address.h"
-#include "ns3/dot11s-codes.h"
#include "ns3/wifi-information-element.h"
namespace ns3 {
--- a/src/devices/mesh/dot11s/peer-link.cc Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-link.cc Mon Mar 30 18:13:48 2009 +0400
@@ -165,7 +165,7 @@
m_beaconTiming.ClearTimingElement ();
}
-void PeerLink::MLMECancelPeerLink (dot11sReasonCode reason)
+void PeerLink::MLMECancelPeerLink (PmpReasonCode reason)
{
StateMachine (CNCL,reason);
}
@@ -185,7 +185,7 @@
StateMachine (REQ_RJCT, REASON11S_PEER_LINK_CANCELLED);
}
-void PeerLink::Close (uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reason)
+void PeerLink::Close (uint16_t localLinkId, uint16_t peerLinkId, PmpReasonCode reason)
{
if (peerLinkId != 0 && m_localLinkId != peerLinkId)
return;
@@ -204,7 +204,7 @@
StateMachine (OPN_ACPT);
}
-void PeerLink::OpenReject (uint16_t localLinkId, IeConfiguration conf,dot11sReasonCode reason)
+void PeerLink::OpenReject (uint16_t localLinkId, IeConfiguration conf,PmpReasonCode reason)
{
if ( m_peerLinkId == 0)
m_peerLinkId = localLinkId;
@@ -228,7 +228,7 @@
void
PeerLink::ConfirmReject (uint16_t localLinkId, uint16_t peerLinkId,
- IeConfiguration conf,dot11sReasonCode reason)
+ IeConfiguration conf,PmpReasonCode reason)
{
if (m_localLinkId != peerLinkId)
return;
@@ -260,7 +260,7 @@
// Private
//-----------------------------------------------------------------------------
void
-PeerLink::StateMachine (PeerEvent event,dot11sReasonCode reasoncode)
+PeerLink::StateMachine (PeerEvent event,PmpReasonCode reasoncode)
{
switch (m_state)
{
@@ -506,7 +506,7 @@
m_holdingTimer.Cancel ();
}
-void PeerLink::SendPeerLinkClose (dot11sReasonCode reasoncode)
+void PeerLink::SendPeerLinkClose (PmpReasonCode reasoncode)
{
IePeerManagement peerElement;
peerElement.SetPeerClose (m_localLinkId, m_peerLinkId, reasoncode);
--- a/src/devices/mesh/dot11s/peer-link.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-link.h Mon Mar 30 18:13:48 2009 +0400
@@ -80,7 +80,7 @@
* \{
*/
/// MLME-CancelPeerLink.request
- void MLMECancelPeerLink (dot11sReasonCode reason);
+ void MLMECancelPeerLink (PmpReasonCode reason);
/// MLME-PassivePeerLinkOpen.request
void MLMEPassivePeerLinkOpen ();
/// MLME-ActivePeerLinkOpen.request
@@ -104,11 +104,11 @@
* \{
*/
/// Close link
- void Close (uint16_t localLinkID, uint16_t peerLinkID, dot11sReasonCode reason);
+ void Close (uint16_t localLinkID, uint16_t peerLinkID, PmpReasonCode reason);
/// Accept open link
void OpenAccept (uint16_t localLinkId, IeConfiguration conf);
/// Reject open link
- void OpenReject (uint16_t localLinkId, IeConfiguration conf, dot11sReasonCode reason);
+ void OpenReject (uint16_t localLinkId, IeConfiguration conf, PmpReasonCode reason);
/// Confirm accept
void ConfirmAccept (
uint16_t localLinkId,
@@ -121,7 +121,7 @@
uint16_t localLinkId,
uint16_t peerLinkId,
IeConfiguration conf,
- dot11sReasonCode reason
+ PmpReasonCode reason
);
//\}
@@ -165,7 +165,7 @@
private:
/// State transition
- void StateMachine (PeerEvent event, dot11sReasonCode = REASON11S_RESERVED);
+ void StateMachine (PeerEvent event, PmpReasonCode = REASON11S_RESERVED);
/**
* \name Event handlers
@@ -183,7 +183,7 @@
* \name Work with management frames
* \{
*/
- void SendPeerLinkClose (dot11sReasonCode reasoncode);
+ void SendPeerLinkClose (PmpReasonCode reasoncode);
void SendPeerLinkOpen ();
void SendPeerLinkConfirm ();
//\}
--- a/src/devices/mesh/dot11s/peer-management-protocol.cc Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-management-protocol.cc Mon Mar 30 18:13:48 2009 +0400
@@ -227,7 +227,7 @@
Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
if (peerManagementElement.SubtypeIsOpen ())
{
- dot11sReasonCode reasonCode;
+ PmpReasonCode reasonCode;
bool reject = ! (ShouldAcceptOpen (interface, peerAddress,reasonCode));
if (peerLink == 0)
peerLink = InitiateLink (interface, peerAddress, Simulator::Now (), Seconds(1.0));
@@ -347,7 +347,7 @@
return true;
}
bool
-PeerManagerProtocol::ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, dot11sReasonCode & reasonCode)
+PeerManagerProtocol::ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode & reasonCode)
{
if (m_numberOfActivePeers > m_maxNumberOfPeerLinks)
{
--- a/src/devices/mesh/dot11s/peer-management-protocol.h Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/dot11s/peer-management-protocol.h Mon Mar 30 18:13:48 2009 +0400
@@ -27,8 +27,8 @@
#include "ns3/net-device.h"
#include "ns3/event-id.h"
#include "ns3/nstime.h"
-#include "ns3/dot11s-codes.h"
#include "ie-dot11s-beacon-timing.h"
+#include "ie-dot11s-peer-management.h"
#include <map>
namespace ns3 {
@@ -162,7 +162,7 @@
* \{
*/
bool ShouldSendOpen (uint32_t interface, Mac48Address peerAddress);
- bool ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, dot11sReasonCode & reasonCode);
+ bool ShouldAcceptOpen (uint32_t interface, Mac48Address peerAddress, PmpReasonCode & reasonCode);
/**
* \}
* \brief Indicates changes in peer links
--- a/src/devices/mesh/wscript Mon Mar 30 17:47:20 2009 +0400
+++ b/src/devices/mesh/wscript Mon Mar 30 18:13:48 2009 +0400
@@ -12,13 +12,6 @@
# Not refactored
'mesh-wifi-mac-header.cc',
'tx-statistics.cc',
- #'hwmp-rtable.cc',
- #'dot11s-parameters.cc',
- #'hwmp.cc',
- #'mesh-wifi-mac.cc',
- #'hwmp-state.cc',
- #'mesh-mgt-headers.cc',
- #'mesh-wifi-peer-manager.cc',
]
headers = bld.new_task_gen('ns3header')
headers.module = 'mesh'
@@ -31,16 +24,8 @@
'mesh-wifi-interface-mac.h',
'mesh-wifi-interface-mac-plugin.h',
# Dirty
- 'dot11s-codes.h',
- #'hwmp-state.h',
- #'dot11s-parameters.h',
- #'mesh-mgt-headers.h',
- #'hwmp.h',
'tx-statistics.h',
- #'hwmp-rtable.h',
'mesh-wifi-mac-header.h',
- #'mesh-wifi-mac.h',
- #'mesh-wifi-peer-manager.h',
]
# obj = bld.create_ns3_program('wifi-phy-test',