From 40e738fbae2f066303c39ac856e891121d677d0f Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Fri, 15 Mar 2024 22:11:45 +0000 Subject: [PATCH 1/5] Add ap-enable and ap-disable cli commands skeleton structure. --- src/common/tools/cli/CMakeLists.txt | 1 + src/common/tools/cli/NetRemoteCli.cxx | 40 +++++++++++++++++++ src/common/tools/cli/NetRemoteCliHandler.cxx | 39 ++++++++++++++++++ .../cli/NetRemoteCliHandlerOperations.cxx | 32 +++++++++++++++ .../remote/INetRemoteCliHandlerOperations.hxx | 37 ++++++++++++++--- .../microsoft/net/remote/NetRemoteCli.hxx | 32 +++++++++++++++ .../microsoft/net/remote/NetRemoteCliData.hxx | 2 + .../net/remote/NetRemoteCliHandler.hxx | 28 +++++++++++-- .../remote/NetRemoteCliHandlerOperations.hxx | 38 +++++++++++++++--- 9 files changed, 235 insertions(+), 14 deletions(-) diff --git a/src/common/tools/cli/CMakeLists.txt b/src/common/tools/cli/CMakeLists.txt index 24bf21bd..82b864cd 100644 --- a/src/common/tools/cli/CMakeLists.txt +++ b/src/common/tools/cli/CMakeLists.txt @@ -27,6 +27,7 @@ target_link_libraries(${PROJECT_NAME}-cli magic_enum::magic_enum notstd plog::plog + wifi-core-adapter-dot11 PUBLIC ${PROJECT_NAME}-client ) diff --git a/src/common/tools/cli/NetRemoteCli.cxx b/src/common/tools/cli/NetRemoteCli.cxx index 4e04ed8f..891487b6 100644 --- a/src/common/tools/cli/NetRemoteCli.cxx +++ b/src/common/tools/cli/NetRemoteCli.cxx @@ -86,6 +86,8 @@ NetRemoteCli::AddSubcommandWifi(CLI::App* parent) // Sub-commands. m_cliAppWifiEnumerateAccessPoints = AddSubcommandWifiEnumerateAccessPoints(wifiApp); + m_cliAppWifiAccessPointEnable = AddSubcommandWifiAccessPointEnable(wifiApp); + m_cliAppWifiAccessPointDisable = AddSubcommandWifiAccessPointDisable(wifiApp); return wifiApp; } @@ -102,6 +104,32 @@ NetRemoteCli::AddSubcommandWifiEnumerateAccessPoints(CLI::App* parent) return cliAppWifiEnumerateAccessPoints; } +CLI::App* +NetRemoteCli::AddSubcommandWifiAccessPointEnable(CLI::App* parent) +{ + auto* cliAppWifiAccessPointEnable = parent->add_subcommand("access-point-enable", "Enable a Wi-Fi access point"); + cliAppWifiAccessPointEnable->alias("ap-enable"); + cliAppWifiAccessPointEnable->callback([this] { + OnWifiAccessPointEnable(); + }); + + return cliAppWifiAccessPointEnable; +} + +CLI::App* +NetRemoteCli::AddSubcommandWifiAccessPointDisable(CLI::App* parent) +{ + auto* cliAppWifiAccessPointDisable = parent->add_subcommand("access-point-disable", "Disable a Wi-Fi access point"); + cliAppWifiAccessPointDisable->alias("ap-disable"); + cliAppWifiAccessPointDisable->callback([this] { + OnWifiAccessPointEnable(); + }); + + cliAppWifiAccessPointDisable->add_option("id", m_cliData->WifiAccessPointId, "The identifier of the access point to disable")->required(); + + return cliAppWifiAccessPointDisable; +} + void NetRemoteCli::OnServerAddressChanged(const std::string& serverAddressArg) { @@ -129,3 +157,15 @@ NetRemoteCli::OnWifiEnumerateAccessPoints() { m_cliHandler->HandleCommandWifiEnumerateAccessPoints(); } + +void +NetRemoteCli::OnWifiAccessPointEnable() +{ + m_cliHandler->HandleCommandWifiAccessPointEnable(m_cliData->WifiAccessPointId); +} + +void +NetRemoteCli::OnWifiAccessPointDisable() +{ + m_cliHandler->HandleCommandWifiAccessPointDisable(m_cliData->WifiAccessPointId); +} diff --git a/src/common/tools/cli/NetRemoteCliHandler.cxx b/src/common/tools/cli/NetRemoteCliHandler.cxx index 581d701b..2e1df4b7 100644 --- a/src/common/tools/cli/NetRemoteCliHandler.cxx +++ b/src/common/tools/cli/NetRemoteCliHandler.cxx @@ -1,5 +1,6 @@ #include +#include #include #include @@ -51,3 +52,41 @@ NetRemoteCliHandler::HandleCommandWifiEnumerateAccessPoints() LOGD << "Executing command WifiEnumerateAccessPoints"; m_operations->WifiEnumerateAccessPoints(); } + +void +NetRemoteCliHandler::HandleCommandWifiAccessPointEnable(std::string_view accessPointId) +{ + if (!m_operations) { + LOGE << "No operations instance available to handle command"; + return; + } + + auto parentStrong{ GetParentStrongRef() }; + if (parentStrong == nullptr) { + LOGW << "Parent cli object is no longer valid, aborting command"; + return; + } + + LOGD << "Executing command WifiAccessPointEnable"; + + m_operations->WifiAccessPointEnable(accessPointId); +} + +void +NetRemoteCliHandler::HandleCommandWifiAccessPointDisable(std::string_view accessPointId) +{ + if (!m_operations) { + LOGE << "No operations instance available to handle command"; + return; + } + + auto parentStrong{ GetParentStrongRef() }; + if (parentStrong == nullptr) { + LOGW << "Parent cli object is no longer valid, aborting command"; + return; + } + + LOGD << "Executing command WifiAccessPointDisable"; + + m_operations->WifiAccessPointDisable(accessPointId); +} diff --git a/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx b/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx index 7541f449..28dad035 100644 --- a/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx +++ b/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx @@ -136,6 +136,38 @@ NetRemoteCliHandlerOperations::WifiEnumerateAccessPoints() } } +void +NetRemoteCliHandlerOperations::WifiAccessPointEnable(std::string_view accessPointId) +{ + WifiAccessPointEnableRequest request{}; + WifiAccessPointEnableResult result{}; + grpc::ClientContext clientContext{}; + + request.set_accesspointid(std::string(accessPointId)); + + auto status = m_connection->Client->WifiAccessPointEnable(&clientContext, request, &result); + if (!status.ok()) { + LOGE << std::format("Failed to enable WiFi access point, error={} details={} message={}", magic_enum::enum_name(status.error_code()), status.error_details(), status.error_message()); + return; + } +} + +void +NetRemoteCliHandlerOperations::WifiAccessPointDisable(std::string_view accessPointId) +{ + WifiAccessPointDisableRequest request{}; + WifiAccessPointDisableResult result{}; + grpc::ClientContext clientContext{}; + + request.set_accesspointid(std::string(accessPointId)); + + auto status = m_connection->Client->WifiAccessPointDisable(&clientContext, request, &result); + if (!status.ok()) { + LOGE << std::format("Failed to disable WiFi access point, error={} details={} message={}", magic_enum::enum_name(status.error_code()), status.error_details(), status.error_message()); + return; + } +} + std::unique_ptr NetRemoteCliHandlerOperationsFactory::Create(std::shared_ptr connection) { diff --git a/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx b/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx index 36b54751..3096d252 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx @@ -3,6 +3,7 @@ #define I_NET_REMOTE_CLI_HANDLER_OPERATIONS_HXX #include +#include #include @@ -21,15 +22,36 @@ struct INetRemoteCliHandlerOperations * Prevent copying and moving of INetRemoteCliHandlerOperations objects. */ INetRemoteCliHandlerOperations(const INetRemoteCliHandlerOperations&) = delete; - INetRemoteCliHandlerOperations& operator=(const INetRemoteCliHandlerOperations&) = delete; + INetRemoteCliHandlerOperations(INetRemoteCliHandlerOperations&&) = delete; - INetRemoteCliHandlerOperations& operator=(INetRemoteCliHandlerOperations&&) = delete; + + INetRemoteCliHandlerOperations& + operator=(const INetRemoteCliHandlerOperations&) = delete; + + INetRemoteCliHandlerOperations& + operator=(INetRemoteCliHandlerOperations&&) = delete; /** * @brief Enumerate available WiFi access points. */ virtual void WifiEnumerateAccessPoints() = 0; + + /** + * @brief Enable the specified WiFi access point. + * + * @param accessPointId The identifier of the access point to enable. + */ + virtual void + WifiAccessPointEnable(std::string_view accessPointId) = 0; + + /** + * @brief Disable the specified WiFi access point. + * + * @param accessPointId The identifier of the access point to disable. + */ + virtual void + WifiAccessPointDisable(std::string_view accessPointId) = 0; }; /** @@ -42,12 +64,17 @@ struct INetRemoteCliHandlerOperationsFactory virtual ~INetRemoteCliHandlerOperationsFactory() = default; /** - * Prevent copying and moving of INetRemoteCliHandlerOperationsFactory objects. + * Prevent copying and moving of INetRemoteCliHandlerOperationsFactory objects. */ INetRemoteCliHandlerOperationsFactory(const INetRemoteCliHandlerOperationsFactory&) = delete; - INetRemoteCliHandlerOperationsFactory& operator=(const INetRemoteCliHandlerOperationsFactory&) = delete; + INetRemoteCliHandlerOperationsFactory(INetRemoteCliHandlerOperationsFactory&&) = delete; - INetRemoteCliHandlerOperationsFactory& operator=(INetRemoteCliHandlerOperationsFactory&&) = delete; + + INetRemoteCliHandlerOperationsFactory& + operator=(const INetRemoteCliHandlerOperationsFactory&) = delete; + + INetRemoteCliHandlerOperationsFactory& + operator=(INetRemoteCliHandlerOperationsFactory&&) = delete; /** * @brief Create a new INetRemoteCliHandlerOperationsFactory instance with the specified server connection. diff --git a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCli.hxx b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCli.hxx index e8f45c22..2c050e8b 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCli.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCli.hxx @@ -94,6 +94,24 @@ private: CLI::App* AddSubcommandWifiEnumerateAccessPoints(CLI::App* parent); + /** + * @brief Add the 'wifi ap-enable' sub-command. + * + * @param parent The parent app to add the sub-command to. + * @return CLI::App* + */ + CLI::App* + AddSubcommandWifiAccessPointEnable(CLI::App* parent); + + /** + * @brief Add the 'wifi ap-disable' sub-command. + * + * @param parent The parent app to add the sub-command to. + * @return CLI::App* + */ + CLI::App* + AddSubcommandWifiAccessPointDisable(CLI::App* parent); + /** * @brief Handle the 'server' option. * @@ -108,6 +126,18 @@ private: void OnWifiEnumerateAccessPoints(); + /** + * @brief Handle the 'wifi ap-enable' command. + */ + void + OnWifiAccessPointEnable(); + + /** + * @brief Handle the 'wifi ap-disable' command. + */ + void + OnWifiAccessPointDisable(); + private: std::shared_ptr m_cliData; std::shared_ptr m_cliHandler; @@ -118,6 +148,8 @@ private: CLI::Option* m_cliAppServerAddress{ nullptr }; CLI::App* m_cliAppWifi{ nullptr }; CLI::App* m_cliAppWifiEnumerateAccessPoints{ nullptr }; + CLI::App* m_cliAppWifiAccessPointEnable{ nullptr }; + CLI::App* m_cliAppWifiAccessPointDisable{ nullptr }; }; } // namespace Microsoft::Net::Remote diff --git a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliData.hxx b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliData.hxx index 447eef43..826f5f44 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliData.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliData.hxx @@ -19,6 +19,8 @@ struct NetRemoteCliData { std::string ServerAddress{ Protocol::NetRemoteProtocol::AddressDefault }; NetRemoteCommandId Command{ NetRemoteCommandId::None }; + + std::string WifiAccessPointId{}; }; } // namespace Microsoft::Net::Remote diff --git a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx index 193112e8..91d9e9c9 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx @@ -3,6 +3,7 @@ #define NET_REMOTE_CLI_HANDLER_HXX #include +#include #include @@ -22,12 +23,17 @@ struct NetRemoteCliHandler virtual ~NetRemoteCliHandler() = default; /** - * Prevent copying and moving of NetRemoteCliHandler objects. + * Prevent copying and moving of NetRemoteCliHandler objects. */ NetRemoteCliHandler(const NetRemoteCliHandler&) = delete; - NetRemoteCliHandler& operator=(const NetRemoteCliHandler&) = delete; + NetRemoteCliHandler(NetRemoteCliHandler&&) = delete; - NetRemoteCliHandler& operator=(NetRemoteCliHandler&&) = delete; + + NetRemoteCliHandler& + operator=(const NetRemoteCliHandler&) = delete; + + NetRemoteCliHandler& + operator=(NetRemoteCliHandler&&) = delete; /** * @brief Construct a new NetRemoteCliHandler object. @@ -58,6 +64,22 @@ struct NetRemoteCliHandler void HandleCommandWifiEnumerateAccessPoints(); + /** + * @brief Handle a command to enable a Wi-Fi access point. + * + * @param accessPointId The identifier of the access point to enable. + */ + void + HandleCommandWifiAccessPointEnable(std::string_view accessPointId); + + /** + * @brief Handle a command to disable a Wi-Fi access point. + * + * @param accessPointId The identifier of the access point to enable. + */ + void + HandleCommandWifiAccessPointDisable(std::string_view accessPointId); + private: /** * @brief Obtain a strong reference to the parent NetRemoteCli object. This is used to ensure that the parent object diff --git a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx index adf7e48c..8f91033a 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx @@ -21,12 +21,17 @@ struct NetRemoteCliHandlerOperations : NetRemoteCliHandlerOperations() = delete; /** - * Prevent copying and moving of this object. + * Prevent copying and moving of this object. */ NetRemoteCliHandlerOperations(const NetRemoteCliHandlerOperations&) = delete; + NetRemoteCliHandlerOperations(NetRemoteCliHandlerOperations&&) = delete; - NetRemoteCliHandlerOperations& operator=(const NetRemoteCliHandlerOperations&) = delete; - NetRemoteCliHandlerOperations& operator=(NetRemoteCliHandlerOperations&&) = delete; + + NetRemoteCliHandlerOperations& + operator=(const NetRemoteCliHandlerOperations&) = delete; + + NetRemoteCliHandlerOperations& + operator=(NetRemoteCliHandlerOperations&&) = delete; /** * @brief Construct a new NetRemoteCliHandlerOperations object with the specified server connection. @@ -41,6 +46,22 @@ struct NetRemoteCliHandlerOperations : void WifiEnumerateAccessPoints() override; + /** + * @brief Enable the specified WiFi access point. + * + * @param accessPointId The identifier of the access point to enable. + */ + void + WifiAccessPointEnable(std::string_view accessPointId) override; + + /** + * @brief Disable the specified WiFi access point. + * + * @param accessPointId The identifier of the access point to disable. + */ + void + WifiAccessPointDisable(std::string_view accessPointId) override; + private: std::shared_ptr m_connection; }; @@ -53,12 +74,17 @@ struct NetRemoteCliHandlerOperationsFactory : ~NetRemoteCliHandlerOperationsFactory() override = default; /** - * Prevent copying and moving of this object. + * Prevent copying and moving of this object. */ NetRemoteCliHandlerOperationsFactory(const NetRemoteCliHandlerOperationsFactory&) = delete; + NetRemoteCliHandlerOperationsFactory(NetRemoteCliHandlerOperationsFactory&&) = delete; - NetRemoteCliHandlerOperationsFactory& operator=(const NetRemoteCliHandlerOperationsFactory&) = delete; - NetRemoteCliHandlerOperationsFactory& operator=(NetRemoteCliHandlerOperationsFactory&&) = delete; + + NetRemoteCliHandlerOperationsFactory& + operator=(const NetRemoteCliHandlerOperationsFactory&) = delete; + + NetRemoteCliHandlerOperationsFactory& + operator=(NetRemoteCliHandlerOperationsFactory&&) = delete; /** * @brief Create a new INetRemoteCliHandlerOperationsFactory instance with the specified server connection. From 308ef602abade2e4893f58cc9c23407996ee6f9e Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Sat, 16 Mar 2024 03:29:06 +0000 Subject: [PATCH 2/5] Implement configuration forwarding for all but pairwise ciphers. --- src/common/tools/cli/CMakeLists.txt | 3 +- src/common/tools/cli/NetRemoteCliHandler.cxx | 8 +++- .../cli/NetRemoteCliHandlerOperations.cxx | 42 ++++++++++++++++++- .../remote/INetRemoteCliHandlerOperations.hxx | 5 ++- .../net/remote/NetRemoteCliHandler.hxx | 5 ++- .../remote/NetRemoteCliHandlerOperations.hxx | 5 ++- src/common/wifi/core/CMakeLists.txt | 1 + .../Ieee80211AccessPointConfiguration.hxx | 28 +++++++++++++ .../dot11/adapter/Ieee80211Dot11Adapters.cxx | 18 ++++++++ .../net/wifi/Ieee80211Dot11Adapters.hxx | 18 ++++++++ 10 files changed, 126 insertions(+), 7 deletions(-) create mode 100644 src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx diff --git a/src/common/tools/cli/CMakeLists.txt b/src/common/tools/cli/CMakeLists.txt index 82b864cd..fba74a13 100644 --- a/src/common/tools/cli/CMakeLists.txt +++ b/src/common/tools/cli/CMakeLists.txt @@ -27,9 +27,10 @@ target_link_libraries(${PROJECT_NAME}-cli magic_enum::magic_enum notstd plog::plog - wifi-core-adapter-dot11 PUBLIC ${PROJECT_NAME}-client + wifi-core + wifi-core-adapter-dot11 ) install( diff --git a/src/common/tools/cli/NetRemoteCliHandler.cxx b/src/common/tools/cli/NetRemoteCliHandler.cxx index 2e1df4b7..db412447 100644 --- a/src/common/tools/cli/NetRemoteCliHandler.cxx +++ b/src/common/tools/cli/NetRemoteCliHandler.cxx @@ -1,5 +1,6 @@ #include +#include #include #include @@ -7,6 +8,7 @@ #include #include #include +#include #include using namespace Microsoft::Net::Remote; @@ -53,8 +55,10 @@ NetRemoteCliHandler::HandleCommandWifiEnumerateAccessPoints() m_operations->WifiEnumerateAccessPoints(); } +using Microsoft::Net::Wifi::Ieee80211AccessPointConfiguration; + void -NetRemoteCliHandler::HandleCommandWifiAccessPointEnable(std::string_view accessPointId) +NetRemoteCliHandler::HandleCommandWifiAccessPointEnable(std::string_view accessPointId, const std::optional& ieee80211AccessPointConfiguration) { if (!m_operations) { LOGE << "No operations instance available to handle command"; @@ -69,7 +73,7 @@ NetRemoteCliHandler::HandleCommandWifiAccessPointEnable(std::string_view accessP LOGD << "Executing command WifiAccessPointEnable"; - m_operations->WifiAccessPointEnable(accessPointId); + m_operations->WifiAccessPointEnable(accessPointId, ieee80211AccessPointConfiguration); } void diff --git a/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx b/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx index 28dad035..02293061 100644 --- a/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx +++ b/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include using namespace Microsoft::Net::Remote; @@ -137,7 +138,7 @@ NetRemoteCliHandlerOperations::WifiEnumerateAccessPoints() } void -NetRemoteCliHandlerOperations::WifiAccessPointEnable(std::string_view accessPointId) +NetRemoteCliHandlerOperations::WifiAccessPointEnable(std::string_view accessPointId, const std::optional& ieee80211AccessPointConfiguration) { WifiAccessPointEnableRequest request{}; WifiAccessPointEnableResult result{}; @@ -145,6 +146,45 @@ NetRemoteCliHandlerOperations::WifiAccessPointEnable(std::string_view accessPoin request.set_accesspointid(std::string(accessPointId)); + // Populate access point configuration if present. + if (ieee80211AccessPointConfiguration.has_value()) { + auto& dot11AccessPointConfiguration = *request.mutable_configuration(); + + // Populate SSID if present. + if (ieee80211AccessPointConfiguration->Ssid.has_value()) { + dot11AccessPointConfiguration.mutable_ssid()->set_name(ieee80211AccessPointConfiguration->Ssid.value()); + } + + // Populate PHY type if present. + if (ieee80211AccessPointConfiguration->PhyType.has_value()) { + const auto dot11PhyType = ToDot11PhyType(ieee80211AccessPointConfiguration->PhyType.value()); + dot11AccessPointConfiguration.set_phytype(dot11PhyType); + } + + // Populate pairwise cipher suites if present. + if (!std::empty(ieee80211AccessPointConfiguration->PairwiseCipherSuites)) { + // TODO + } + + // Populate authentication algorithms if present. + if (!std::empty(ieee80211AccessPointConfiguration->AuthenticationAlgorithms)) { + auto dot11AuthenticationAlgorithms = ToDot11AuthenticationAlgorithms(ieee80211AccessPointConfiguration->AuthenticationAlgorithms); + *dot11AccessPointConfiguration.mutable_authenticationalgorithms() = { + std::make_move_iterator(std::begin(dot11AuthenticationAlgorithms)), + std::make_move_iterator(std::end(dot11AuthenticationAlgorithms)) + }; + } + + // Populate frequency bands if present. + if (!std::empty(ieee80211AccessPointConfiguration->FrequencyBands)) { + auto dot11FrequencyBands = ToDot11FrequencyBands(ieee80211AccessPointConfiguration->FrequencyBands); + *dot11AccessPointConfiguration.mutable_frequencybands() = { + std::make_move_iterator(std::begin(dot11FrequencyBands)), + std::make_move_iterator(std::end(dot11FrequencyBands)) + }; + } + } + auto status = m_connection->Client->WifiAccessPointEnable(&clientContext, request, &result); if (!status.ok()) { LOGE << std::format("Failed to enable WiFi access point, error={} details={} message={}", magic_enum::enum_name(status.error_code()), status.error_details(), status.error_message()); diff --git a/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx b/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx index 3096d252..a5644c3e 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/INetRemoteCliHandlerOperations.hxx @@ -3,9 +3,11 @@ #define I_NET_REMOTE_CLI_HANDLER_OPERATIONS_HXX #include +#include #include #include +#include namespace Microsoft::Net::Remote { @@ -41,9 +43,10 @@ struct INetRemoteCliHandlerOperations * @brief Enable the specified WiFi access point. * * @param accessPointId The identifier of the access point to enable. + * @param ieee80211AccessPointConfiguration The optional configuration to apply to the access point. */ virtual void - WifiAccessPointEnable(std::string_view accessPointId) = 0; + WifiAccessPointEnable(std::string_view accessPointId, const std::optional& ieee80211AccessPointConfiguration) = 0; /** * @brief Disable the specified WiFi access point. diff --git a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx index 91d9e9c9..9a6f2767 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandler.hxx @@ -3,9 +3,11 @@ #define NET_REMOTE_CLI_HANDLER_HXX #include +#include #include #include +#include namespace Microsoft::Net::Remote { @@ -68,9 +70,10 @@ struct NetRemoteCliHandler * @brief Handle a command to enable a Wi-Fi access point. * * @param accessPointId The identifier of the access point to enable. + * @param ieee80211AccessPointConfiguration The optional configuration to apply to the access point. */ void - HandleCommandWifiAccessPointEnable(std::string_view accessPointId); + HandleCommandWifiAccessPointEnable(std::string_view accessPointId, const std::optional& ieee80211AccessPointConfiguration = std::nullopt); /** * @brief Handle a command to disable a Wi-Fi access point. diff --git a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx index 8f91033a..22631c08 100644 --- a/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx +++ b/src/common/tools/cli/include/microsoft/net/remote/NetRemoteCliHandlerOperations.hxx @@ -3,9 +3,11 @@ #define NET_REMOTE_CLI_HANDLER_OPERATIONS_HXX #include +#include #include #include +#include namespace Microsoft::Net::Remote { @@ -50,9 +52,10 @@ struct NetRemoteCliHandlerOperations : * @brief Enable the specified WiFi access point. * * @param accessPointId The identifier of the access point to enable. + * @param ieee80211AccessPointConfiguration The optional configuration to apply to the access point. */ void - WifiAccessPointEnable(std::string_view accessPointId) override; + WifiAccessPointEnable(std::string_view accessPointId, const std::optional& ieee80211AccessPointConfiguration) override; /** * @brief Disable the specified WiFi access point. diff --git a/src/common/wifi/core/CMakeLists.txt b/src/common/wifi/core/CMakeLists.txt index 84ac3e76..e8e146c6 100644 --- a/src/common/wifi/core/CMakeLists.txt +++ b/src/common/wifi/core/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(wifi-core ${WIFI_CORE_PUBLIC_INCLUDE_PREFIX}/IAccessPointController.hxx ${WIFI_CORE_PUBLIC_INCLUDE_PREFIX}/Ieee80211.hxx ${WIFI_CORE_PUBLIC_INCLUDE_PREFIX}/Ieee80211AccessPointCapabilities.hxx + ${WIFI_CORE_PUBLIC_INCLUDE_PREFIX}/Ieee80211AccessPointConfiguration.hxx ) target_link_libraries(wifi-core diff --git a/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx b/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx new file mode 100644 index 00000000..0f77854d --- /dev/null +++ b/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx @@ -0,0 +1,28 @@ + +#ifndef IEEE_80211_ACCESS_POINT_CONFIGURATION +#define IEEE_80211_ACCESS_POINT_CONFIGURATION + +#include +#include +#include +#include + +#include + +namespace Microsoft::Net::Wifi +{ +/** + * @brief Configuration for an IEEE 802.11 access point. + */ +struct Ieee80211AccessPointConfiguration +{ + std::optional Ssid; + std::optional Bssid; + std::optional PhyType; + std::unordered_map PairwiseCipherSuites; + std::vector AuthenticationAlgorithms; + std::vector FrequencyBands; +}; +} // namespace Microsoft::Net::Wifi + +#endif // IEEE_80211_ACCESS_POINT_CONFIGURATION diff --git a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx index 2cab4066..7bfe4b10 100644 --- a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx +++ b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx @@ -171,6 +171,15 @@ ToDot11FrequencyBand(const Ieee80211FrequencyBand ieee80211FrequencyBand) noexce } } +std::vector +ToDot11FrequencyBands(const std::vector& ieee80211FrequencyBands) noexcept +{ + std::vector dot11FrequencyBands(static_cast(std::size(ieee80211FrequencyBands))); + std::ranges::transform(ieee80211FrequencyBands, std::begin(dot11FrequencyBands), ToDot11FrequencyBand); + + return dot11FrequencyBands; +} + Ieee80211FrequencyBand FromDot11FrequencyBand(const Dot11FrequencyBand dot11FrequencyBand) noexcept { @@ -285,6 +294,15 @@ ToDot11AuthenticationAlgorithm(const Ieee80211AuthenticationAlgorithm ieee80211A } } +std::vector +ToDot11AuthenticationAlgorithms(const std::vector& ieee80211AuthenticationAlgorithms) noexcept +{ + std::vector dot11AuthenticationAlgorithms(static_cast(std::size(ieee80211AuthenticationAlgorithms))); + std::ranges::transform(ieee80211AuthenticationAlgorithms, std::begin(dot11AuthenticationAlgorithms), ToDot11AuthenticationAlgorithm); + + return dot11AuthenticationAlgorithms; +} + Ieee80211AuthenticationAlgorithm FromDot11AuthenticationAlgorithm(const Dot11AuthenticationAlgorithm dot11AuthenticationAlgorithm) noexcept { diff --git a/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx b/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx index b50aed33..47d9fddb 100644 --- a/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx +++ b/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx @@ -76,6 +76,15 @@ FromDot11PhyType(Microsoft::Net::Wifi::Dot11PhyType dot11PhyType) noexcept; Microsoft::Net::Wifi::Dot11FrequencyBand ToDot11FrequencyBand(Microsoft::Net::Wifi::Ieee80211FrequencyBand ieee80211FrequencyBand) noexcept; +/** + * @brief Convert the specified IEEE 802.11 frequency bands to the equivalent Dot11FrequencyBands. + * + * @param ieee80211FrequencyBands The IEEE 802.11 frequency bands to convert. + * @return std::vector + */ +std::vector +ToDot11FrequencyBands(const std::vector& ieee80211FrequencyBands) noexcept; + /** * @brief Obtain a vector of Dot11FrequencyBands from the specified WifiAccessPointSetFrequencyBandsRequest. * @@ -122,6 +131,15 @@ FromDot11SetFrequencyBandsRequest(const Microsoft::Net::Remote::Wifi::WifiAccess Microsoft::Net::Wifi::Dot11AuthenticationAlgorithm ToDot11AuthenticationAlgorithm(Microsoft::Net::Wifi::Ieee80211AuthenticationAlgorithm ieee80211AuthenticationAlgorithm) noexcept; +/** + * @brief Convert the specified IEEE 802.11 authentication algorithms to the equivalent Dot11AuthenticationAlgorithms. + * + * @param ieee80211AuthenticationAlgorithms The IEEE 802.11 authentication algorithms to convert. + * @return std::vector + */ +std::vector +ToDot11AuthenticationAlgorithms(const std::vector& ieee80211AuthenticationAlgorithms) noexcept; + /** * @brief Obtain a vector of Dot11AuthenticationAlgorithms from the specified Dot11AccessPointConfiguration. * From 90d1e596b552012da723d11703352b9db3ae0321 Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Sat, 16 Mar 2024 03:54:34 +0000 Subject: [PATCH 3/5] Add implementation for cipher suite configurations. --- .../cli/NetRemoteCliHandlerOperations.cxx | 6 ++++- .../Ieee80211AccessPointConfiguration.hxx | 2 +- .../dot11/adapter/Ieee80211Dot11Adapters.cxx | 22 +++++++++++++++++++ .../net/wifi/Ieee80211Dot11Adapters.hxx | 9 ++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx b/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx index 02293061..5fc913d2 100644 --- a/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx +++ b/src/common/tools/cli/NetRemoteCliHandlerOperations.cxx @@ -163,7 +163,11 @@ NetRemoteCliHandlerOperations::WifiAccessPointEnable(std::string_view accessPoin // Populate pairwise cipher suites if present. if (!std::empty(ieee80211AccessPointConfiguration->PairwiseCipherSuites)) { - // TODO + auto dot11PairwiseCipherSuites = ToDot11CipherSuiteConfigurations(ieee80211AccessPointConfiguration->PairwiseCipherSuites); + *dot11AccessPointConfiguration.mutable_pairwiseciphersuites() = { + std::make_move_iterator(std::begin(dot11PairwiseCipherSuites)), + std::make_move_iterator(std::end(dot11PairwiseCipherSuites)) + }; } // Populate authentication algorithms if present. diff --git a/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx b/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx index 0f77854d..96b812d6 100644 --- a/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx +++ b/src/common/wifi/core/include/microsoft/net/wifi/Ieee80211AccessPointConfiguration.hxx @@ -19,7 +19,7 @@ struct Ieee80211AccessPointConfiguration std::optional Ssid; std::optional Bssid; std::optional PhyType; - std::unordered_map PairwiseCipherSuites; + std::unordered_map> PairwiseCipherSuites; std::vector AuthenticationAlgorithms; std::vector FrequencyBands; }; diff --git a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx index 7bfe4b10..f2e3d84f 100644 --- a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx +++ b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx @@ -522,6 +522,28 @@ ToDot11CipherSuiteConfigurations(const google::protobuf::RepeatedPtrField +ToDot11CipherSuiteConfigurations(const std::unordered_map>& ieee80211CipherSuiteConfigurations) noexcept +{ + std::vector dot11CipherSuiteConfigurations(std::size(ieee80211CipherSuiteConfigurations)); + + std::ranges::transform(ieee80211CipherSuiteConfigurations, std::begin(dot11CipherSuiteConfigurations), [](const auto& ieee80211CipherSuiteConfiguration) { + const auto dot11SecurityProtocol = ToDot11SecurityProtocol(ieee80211CipherSuiteConfiguration.first); + std::vector dot11CipherSuites(std::size(ieee80211CipherSuiteConfiguration.second)); + std::ranges::transform(ieee80211CipherSuiteConfiguration.second, std::begin(dot11CipherSuites), ToDot11CipherSuite); + + Dot11CipherSuiteConfiguration dot11CipherSuiteConfiguration{}; + dot11CipherSuiteConfiguration.set_securityprotocol(dot11SecurityProtocol); + *dot11CipherSuiteConfiguration.mutable_ciphersuites() = { + std::make_move_iterator(std::begin(dot11CipherSuites)), + std::make_move_iterator(std::end(dot11CipherSuites)) + }; + return dot11CipherSuiteConfiguration; + }); + + return dot11CipherSuiteConfigurations; +} + std::unordered_map> FromDot11CipherSuiteConfigurations(const std::unordered_map>& dot11CipherSuiteConfigurations) noexcept { diff --git a/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx b/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx index 47d9fddb..0ff1a6e6 100644 --- a/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx +++ b/src/common/wifi/dot11/adapter/include/microsoft/net/wifi/Ieee80211Dot11Adapters.hxx @@ -203,6 +203,15 @@ FromDot11CipherSuite(Microsoft::Net::Wifi::Dot11CipherSuite dot11CipherSuite) no std::unordered_map> ToDot11CipherSuiteConfigurations(const google::protobuf::RepeatedPtrField& dot11CipherSuiteConfigurations) noexcept; +/** + * @brief Convert the specified map of Ieee80211SecurityProtocol to Ieee80211CipherSuite to the equivalent vector of Dot11CipherSuiteConfiguratios. + * + * @param ieee80211CipherSuiteConfigurations The map of Ieee80211SecurityProtocol to Ieee80211CipherSuite to convert. + * @return std::vector + */ +std::vector +ToDot11CipherSuiteConfigurations(const std::unordered_map>& ieee80211CipherSuiteConfigurations) noexcept; + /** * @brief Convert the specified map of Dot11SecurityProtocol to Dot11CipherSuite to the equivalent map of IEEE 802.11 security protocol to cipher suite. * From 6f04257f6a286fcb364deca20dd8a478d36bf9d1 Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Sat, 16 Mar 2024 04:11:16 +0000 Subject: [PATCH 4/5] Replace use of first/second names with structured binding. --- src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx index f2e3d84f..1cb42a3a 100644 --- a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx +++ b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx @@ -528,8 +528,9 @@ ToDot11CipherSuiteConfigurations(const std::unordered_map dot11CipherSuiteConfigurations(std::size(ieee80211CipherSuiteConfigurations)); std::ranges::transform(ieee80211CipherSuiteConfigurations, std::begin(dot11CipherSuiteConfigurations), [](const auto& ieee80211CipherSuiteConfiguration) { - const auto dot11SecurityProtocol = ToDot11SecurityProtocol(ieee80211CipherSuiteConfiguration.first); - std::vector dot11CipherSuites(std::size(ieee80211CipherSuiteConfiguration.second)); + const auto& [ieee80211SecurityProtocol, ieee80211CipherSuites] = ieee80211CipherSuiteConfiguration; + const auto dot11SecurityProtocol = ToDot11SecurityProtocol(ieee80211SecurityProtocol); + std::vector dot11CipherSuites(std::size(ieee80211CipherSuites)); std::ranges::transform(ieee80211CipherSuiteConfiguration.second, std::begin(dot11CipherSuites), ToDot11CipherSuite); Dot11CipherSuiteConfiguration dot11CipherSuiteConfiguration{}; From 9c0c261e90ed37068f5864d4a5e848f61eee8226 Mon Sep 17 00:00:00 2001 From: Andrew Beltrano Date: Sat, 16 Mar 2024 04:15:24 +0000 Subject: [PATCH 5/5] Remove unnecessary ns prefixes. --- .../dot11/adapter/Ieee80211Dot11Adapters.cxx | 23 +-- .../net/wifi/Ieee80211Dot11Adapters.hxx | 132 +++++++++--------- 2 files changed, 67 insertions(+), 88 deletions(-) diff --git a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx index 1cb42a3a..de4eb64d 100644 --- a/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx +++ b/src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -15,7 +16,6 @@ namespace Microsoft::Net::Wifi { using Microsoft::Net::Remote::Wifi::WifiAccessPointOperationStatusCode; -using Microsoft::Net::Wifi::AccessPointOperationStatusCode; WifiAccessPointOperationStatusCode ToDot11AccessPointOperationStatusCode(AccessPointOperationStatusCode& accessPointOperationStatusCode) noexcept @@ -61,9 +61,6 @@ FromDot11AccessPointOperationStatusCode(WifiAccessPointOperationStatusCode wifiA } } -using Microsoft::Net::Wifi::Dot11SecurityProtocol; -using Microsoft::Net::Wifi::Ieee80211SecurityProtocol; - Dot11SecurityProtocol ToDot11SecurityProtocol(Ieee80211SecurityProtocol ieee80211SecurityProtocol) noexcept { @@ -98,9 +95,6 @@ FromDot11SecurityProtocol(Dot11SecurityProtocol dot11SecurityProtocol) noexcept } } -using Microsoft::Net::Wifi::Dot11PhyType; -using Microsoft::Net::Wifi::Ieee80211PhyType; - Dot11PhyType ToDot11PhyType(const Ieee80211PhyType ieee80211PhyType) noexcept { @@ -153,9 +147,6 @@ FromDot11PhyType(const Dot11PhyType dot11PhyType) noexcept } } -using Microsoft::Net::Wifi::Dot11FrequencyBand; -using Microsoft::Net::Wifi::Ieee80211FrequencyBand; - Dot11FrequencyBand ToDot11FrequencyBand(const Ieee80211FrequencyBand ieee80211FrequencyBand) noexcept { @@ -265,9 +256,6 @@ FromDot11SetFrequencyBandsRequest(const WifiAccessPointSetFrequencyBandsRequest& return ieee80211FrequencyBands; } -using Microsoft::Net::Wifi::Dot11AuthenticationAlgorithm; -using Microsoft::Net::Wifi::Ieee80211AuthenticationAlgorithm; - Dot11AuthenticationAlgorithm ToDot11AuthenticationAlgorithm(const Ieee80211AuthenticationAlgorithm ieee80211AuthenticationAlgorithm) noexcept { @@ -329,9 +317,6 @@ FromDot11AuthenticationAlgorithm(const Dot11AuthenticationAlgorithm dot11Authent } } -using Microsoft::Net::Wifi::Dot11AkmSuite; -using Microsoft::Net::Wifi::Ieee80211AkmSuite; - Dot11AkmSuite ToDot11AkmSuite(const Ieee80211AkmSuite ieee80211AkmSuite) noexcept { @@ -434,9 +419,6 @@ FromDot11AkmSuite(const Dot11AkmSuite dot11AkmSuite) noexcept } } -using Microsoft::Net::Wifi::Dot11CipherSuite; -using Microsoft::Net::Wifi::Ieee80211CipherSuite; - Dot11CipherSuite ToDot11CipherSuite(const Ieee80211CipherSuite ieee80211CipherSuite) noexcept { @@ -559,9 +541,6 @@ FromDot11CipherSuiteConfigurations(const std::unordered_map + * @return std::vector */ -std::vector -ToDot11FrequencyBands(const std::vector& ieee80211FrequencyBands) noexcept; +std::vector +ToDot11FrequencyBands(const std::vector& ieee80211FrequencyBands) noexcept; /** * @brief Obtain a vector of Dot11FrequencyBands from the specified WifiAccessPointSetFrequencyBandsRequest. * * @param request The request to extract the Dot11FrequencyBands from. - * @return std::vector + * @return std::vector */ -std::vector +std::vector ToDot11FrequencyBands(const Microsoft::Net::Remote::Wifi::WifiAccessPointSetFrequencyBandsRequest& request) noexcept; /** * @brief Obtain a vector of Dot11FrequencyBands from the specified Dot11AccessPointConfiguration. * * @param dot11AccessPointConfiguration The Dot11AccessPointConfiguration to extract the Dot11FrequencyBands from. - * @return std::vector + * @return std::vector */ -std::vector -ToDot11FrequencyBands(const Microsoft::Net::Wifi::Dot11AccessPointConfiguration& dot11AccessPointConfiguration) noexcept; +std::vector +ToDot11FrequencyBands(const Dot11AccessPointConfiguration& dot11AccessPointConfiguration) noexcept; /** * @brief Convert the specified Dot11FrequencyBand to the equivalent IEEE 802.11 frequency band. * * @param dot11FrequencyBand The Dot11FrequencyBand to convert. - * @return Microsoft::Net::Wifi::Ieee80211FrequencyBand + * @return Ieee80211FrequencyBand */ -Microsoft::Net::Wifi::Ieee80211FrequencyBand -FromDot11FrequencyBand(Microsoft::Net::Wifi::Dot11FrequencyBand dot11FrequencyBand) noexcept; +Ieee80211FrequencyBand +FromDot11FrequencyBand(Dot11FrequencyBand dot11FrequencyBand) noexcept; /** * @brief Obtain the equivalent IEEE 802.11 frequency band from the Dot11FrequencyBands in the * WifiAccessPointSetFrequencyBandsRequest. * * @param request - * @return std::vector + * @return std::vector */ -std::vector +std::vector FromDot11SetFrequencyBandsRequest(const Microsoft::Net::Remote::Wifi::WifiAccessPointSetFrequencyBandsRequest& request); /** * @brief Convert the specified IEEE 802.11 authentication algorithm to the equivalent Dot11AuthenticationAlgorithm. * * @param ieee80211AuthenticationAlgorithm The IEEE 802.11 authentication algorithm to convert. - * @return Microsoft::Net::Wifi::Dot11AuthenticationAlgorithm + * @return Dot11AuthenticationAlgorithm */ -Microsoft::Net::Wifi::Dot11AuthenticationAlgorithm -ToDot11AuthenticationAlgorithm(Microsoft::Net::Wifi::Ieee80211AuthenticationAlgorithm ieee80211AuthenticationAlgorithm) noexcept; +Dot11AuthenticationAlgorithm +ToDot11AuthenticationAlgorithm(Ieee80211AuthenticationAlgorithm ieee80211AuthenticationAlgorithm) noexcept; /** * @brief Convert the specified IEEE 802.11 authentication algorithms to the equivalent Dot11AuthenticationAlgorithms. * * @param ieee80211AuthenticationAlgorithms The IEEE 802.11 authentication algorithms to convert. - * @return std::vector + * @return std::vector */ -std::vector -ToDot11AuthenticationAlgorithms(const std::vector& ieee80211AuthenticationAlgorithms) noexcept; +std::vector +ToDot11AuthenticationAlgorithms(const std::vector& ieee80211AuthenticationAlgorithms) noexcept; /** * @brief Obtain a vector of Dot11AuthenticationAlgorithms from the specified Dot11AccessPointConfiguration. * * @param dot11AccessPointConfiguration The Dot11AccessPointConfiguration to extract the Dot11AuthenticationAlgorithms from. - * @return std::vector + * @return std::vector */ -std::vector -ToDot11AuthenticationAlgorithms(const Microsoft::Net::Wifi::Dot11AccessPointConfiguration& dot11AccessPointConfiguration) noexcept; +std::vector +ToDot11AuthenticationAlgorithms(const Dot11AccessPointConfiguration& dot11AccessPointConfiguration) noexcept; /** * @brief Convert the specified Dot11AuthenticationAlgorithm to the equivalent IEEE 802.11 authentication algorithm. * * @param dot11AuthenticationAlgorithm The Dot11AuthenticationAlgorithm to convert. - * @return Microsoft::Net::Wifi::Ieee80211AuthenticationAlgorithm + * @return Ieee80211AuthenticationAlgorithm */ -Microsoft::Net::Wifi::Ieee80211AuthenticationAlgorithm -FromDot11AuthenticationAlgorithm(Microsoft::Net::Wifi::Dot11AuthenticationAlgorithm dot11AuthenticationAlgorithm) noexcept; +Ieee80211AuthenticationAlgorithm +FromDot11AuthenticationAlgorithm(Dot11AuthenticationAlgorithm dot11AuthenticationAlgorithm) noexcept; /** * @brief Convert the specified IEEE 802.11 AKM suite algorithm to the equivalent Dot11CipherAlgorithm. * * @param ieee80211AkmSuite The IEEE 802.11 AKM suite algorithm to convert. - * @return Microsoft::Net::Wifi::Dot11AkmSuite + * @return Dot11AkmSuite */ -Microsoft::Net::Wifi::Dot11AkmSuite -ToDot11AkmSuite(Microsoft::Net::Wifi::Ieee80211AkmSuite ieee80211AkmSuite) noexcept; +Dot11AkmSuite +ToDot11AkmSuite(Ieee80211AkmSuite ieee80211AkmSuite) noexcept; /** * @brief Convert the specified Dot11AkmSuite to the equivalent IEEE 802.11 AKM suite algorithm. * * @param dot11AkmSuite The Dot11AkmSuite to convert. - * @return Microsoft::Net::Wifi::Ieee80211AkmSuite + * @return Ieee80211AkmSuite */ -Microsoft::Net::Wifi::Ieee80211AkmSuite -FromDot11AkmSuite(Microsoft::Net::Wifi::Dot11AkmSuite dot11AkmSuite) noexcept; +Ieee80211AkmSuite +FromDot11AkmSuite(Dot11AkmSuite dot11AkmSuite) noexcept; /** * @brief Convert the specified IEEE 802.11 cipher suite algorithm to the equivalent Dot11CipherSuite. * * @param ieee80211CipherSuite The IEEE 802.11 cipher suite algorithm to convert. - * @return Microsoft::Net::Wifi::Dot11CipherSuite + * @return Dot11CipherSuite */ -Microsoft::Net::Wifi::Dot11CipherSuite -ToDot11CipherSuite(Microsoft::Net::Wifi::Ieee80211CipherSuite ieee80211CipherSuite) noexcept; +Dot11CipherSuite +ToDot11CipherSuite(Ieee80211CipherSuite ieee80211CipherSuite) noexcept; /** * @brief Convert the specified Dot11CipherSuite to the equivalent IEEE 802.11 cipher suite algorithm. * * @param dot11CipherSuite The Dot11CipherSuite to convert. - * @return Microsoft::Net::Wifi::Ieee80211CipherSuite + * @return Ieee80211CipherSuite */ -Microsoft::Net::Wifi::Ieee80211CipherSuite -FromDot11CipherSuite(Microsoft::Net::Wifi::Dot11CipherSuite dot11CipherSuite) noexcept; +Ieee80211CipherSuite +FromDot11CipherSuite(Dot11CipherSuite dot11CipherSuite) noexcept; /** * @brief Convert the specified repeated field of Dot11CipherSuiteConfigurations to the equivalent map of Dot11SecurityProtocol to Dot11CipherSuite. * * @param dot11CipherSuiteConfigurations The repeated field of Dot11CipherSuiteConfigurations to convert. - * @return std::unordered_map> + * @return std::unordered_map> */ -std::unordered_map> -ToDot11CipherSuiteConfigurations(const google::protobuf::RepeatedPtrField& dot11CipherSuiteConfigurations) noexcept; +std::unordered_map> +ToDot11CipherSuiteConfigurations(const google::protobuf::RepeatedPtrField& dot11CipherSuiteConfigurations) noexcept; /** * @brief Convert the specified map of Ieee80211SecurityProtocol to Ieee80211CipherSuite to the equivalent vector of Dot11CipherSuiteConfiguratios. * * @param ieee80211CipherSuiteConfigurations The map of Ieee80211SecurityProtocol to Ieee80211CipherSuite to convert. - * @return std::vector + * @return std::vector */ -std::vector +std::vector ToDot11CipherSuiteConfigurations(const std::unordered_map>& ieee80211CipherSuiteConfigurations) noexcept; /** * @brief Convert the specified map of Dot11SecurityProtocol to Dot11CipherSuite to the equivalent map of IEEE 802.11 security protocol to cipher suite. * * @param dot11CipherSuiteConfigurations The map of Dot11SecurityProtocol to Dot11CipherSuite to convert. - * @return std::unordered_map> + * @return std::unordered_map> */ -std::unordered_map> -FromDot11CipherSuiteConfigurations(const std::unordered_map>& dot11CipherSuiteConfigurations) noexcept; +std::unordered_map> +FromDot11CipherSuiteConfigurations(const std::unordered_map>& dot11CipherSuiteConfigurations) noexcept; /** * @brief Convert the specified IEEE 802.11 access point capabilities to the equivalent Dot11AccessPointCapabilities. * * @param ieee80211AccessPointCapabilities The IEEE 802.11 access point capabilities to convert. - * @return Microsoft::Net::Wifi::Dot11AccessPointCapabilities + * @return Dot11AccessPointCapabilities */ -Microsoft::Net::Wifi::Dot11AccessPointCapabilities -ToDot11AccessPointCapabilities(const Microsoft::Net::Wifi::Ieee80211AccessPointCapabilities& ieee80211AccessPointCapabilities) noexcept; +Dot11AccessPointCapabilities +ToDot11AccessPointCapabilities(const Ieee80211AccessPointCapabilities& ieee80211AccessPointCapabilities) noexcept; } // namespace Microsoft::Net::Wifi