Skip to content

Commit

Permalink
Merge pull request #120 from microsoft/apcapsimpl
Browse files Browse the repository at this point in the history
Rename AccessPointControllerHostapd* to AccessPointControllerLinux*
  • Loading branch information
abeltrano authored Jan 22, 2024
2 parents cf28679 + e580ffb commit 1772ee6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# VS and VSCode
.vs
.vscode/launch.json
.vscode/settings.json
bin/
obj/
Expand Down
4 changes: 2 additions & 2 deletions src/linux/server/Main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <logging/LogUtils.hxx>
#include <microsoft/net/remote/NetRemoteServer.hxx>
#include <microsoft/net/remote/NetRemoteServerConfiguration.hxx>
#include <microsoft/net/wifi/AccessPointControllerHostapd.hxx>
#include <microsoft/net/wifi/AccessPointControllerLinux.hxx>
#include <microsoft/net/wifi/AccessPointDiscoveryAgent.hxx>
#include <microsoft/net/wifi/AccessPointDiscoveryAgentOperationsNetlink.hxx>
#include <microsoft/net/wifi/AccessPointLinux.hxx>
Expand Down Expand Up @@ -50,7 +50,7 @@ main(int argc, char *argv[])
{
configuration.AccessPointManager = AccessPointManager::Create();

auto accessPointControllerFactory = std::make_unique<AccessPointControllerHostapdFactory>();
auto accessPointControllerFactory = std::make_unique<AccessPointControllerLinuxFactory>();
auto accessPointFactory = std::make_shared<AccessPointFactoryLinux>(std::move(accessPointControllerFactory));
auto accessPointDiscoveryAgentOperationsNetlink = std::make_unique<AccessPointDiscoveryAgentOperationsNetlink>(accessPointFactory);
auto accessPointDiscoveryAgent = AccessPointDiscoveryAgent::Create(std::move(accessPointDiscoveryAgentOperationsNetlink));
Expand Down
4 changes: 2 additions & 2 deletions src/linux/tools/apmonitor/Main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <format>

#include <magic_enum.hpp>
#include <microsoft/net/wifi/AccessPointControllerHostapd.hxx>
#include <microsoft/net/wifi/AccessPointControllerLinux.hxx>
#include <microsoft/net/wifi/AccessPointDiscoveryAgent.hxx>
#include <microsoft/net/wifi/AccessPointDiscoveryAgentOperationsNetlink.hxx>
#include <microsoft/net/wifi/AccessPointLinux.hxx>
Expand All @@ -23,7 +23,7 @@ main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
plog::init(plog::verbose, &colorConsoleAppender);

// Configure monitoring with the netlink protocol.
auto accessPointControllerFactory = std::make_unique<AccessPointControllerHostapdFactory>();
auto accessPointControllerFactory = std::make_unique<AccessPointControllerLinuxFactory>();
auto accessPointFactory = std::make_shared<AccessPointFactoryLinux>(std::move(accessPointControllerFactory));
auto accessPointDiscoveryAgentOperationsNetlink{ std::make_unique<AccessPointDiscoveryAgentOperationsNetlink>(accessPointFactory) };
auto accessPointDiscoveryAgent{ AccessPointDiscoveryAgent::Create(std::move(accessPointDiscoveryAgentOperationsNetlink)) };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include <format>

#include <microsoft/net/wifi/AccessPointControllerHostapd.hxx>
#include <microsoft/net/wifi/AccessPointControllerLinux.hxx>
#include <plog/Log.h>
#include <Wpa/IHostapd.hxx>
#include <Wpa/ProtocolHostapd.hxx>
Expand All @@ -10,21 +10,21 @@

using namespace Microsoft::Net::Wifi;

AccessPointControllerHostapd::AccessPointControllerHostapd(std::string_view interfaceName) :
AccessPointControllerLinux::AccessPointControllerLinux(std::string_view interfaceName) :
AccessPointController(interfaceName),
m_hostapd(interfaceName)
{
}

Ieee80211AccessPointCapabilities
AccessPointControllerHostapd::GetCapabilities()
AccessPointControllerLinux::GetCapabilities()
{
// TODO: Implement this method.
return {};
}

bool
AccessPointControllerHostapd::GetIsEnabled()
AccessPointControllerLinux::GetIsEnabled()
{
bool isEnabled{ false };

Expand All @@ -39,7 +39,7 @@ AccessPointControllerHostapd::GetIsEnabled()
}

std::unique_ptr<IAccessPointController>
AccessPointControllerHostapdFactory::Create(std::string_view interfaceName)
AccessPointControllerLinuxFactory::Create(std::string_view interfaceName)
{
return std::make_unique<AccessPointControllerHostapd>(interfaceName);
return std::make_unique<AccessPointControllerLinux>(interfaceName);
}
4 changes: 2 additions & 2 deletions src/linux/wifi/core/AccessPointLinux.cxx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

#include <microsoft/net/wifi/AccessPointControllerHostapd.hxx>
#include <microsoft/net/wifi/AccessPointControllerLinux.hxx>
#include <microsoft/net/wifi/AccessPointLinux.hxx>

using namespace Microsoft::Net::Wifi;

std::unique_ptr<IAccessPointController>
AccessPointLinux::CreateController()
{
return std::make_unique<AccessPointControllerHostapd>(GetInterfaceName());
return std::make_unique<AccessPointControllerLinux>(GetInterfaceName());
}

std::shared_ptr<IAccessPoint>
Expand Down
4 changes: 2 additions & 2 deletions src/linux/wifi/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ set(WIFI_CORE_LINUX_PUBLIC_INCLUDE_PREFIX ${WIFI_CORE_LINUX_PUBLIC_INCLUDE}/${WI

target_sources(wifi-core-linux
PRIVATE
AccessPointControllerHostapd.cxx
AccessPointControllerLinux.cxx
AccessPointLinux.cxx
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${WIFI_CORE_LINUX_PUBLIC_INCLUDE}
FILES
${WIFI_CORE_LINUX_PUBLIC_INCLUDE_PREFIX}/AccessPointControllerHostapd.hxx
${WIFI_CORE_LINUX_PUBLIC_INCLUDE_PREFIX}/AccessPointControllerLinux.hxx
${WIFI_CORE_LINUX_PUBLIC_INCLUDE_PREFIX}/AccessPointLinux.hxx
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef ACCESS_POINT_CONTROLLER_HOSTAPD_HXX
#define ACCESS_POINT_CONTROLLER_HOSTAPD_HXX
#ifndef ACCESS_POINT_CONTROLLER_LINUX_HXX
#define ACCESS_POINT_CONTROLLER_LINUX_HXX

#include <string_view>

Expand All @@ -12,19 +12,19 @@ namespace Microsoft::Net::Wifi
/**
* @brief Implementation of IAccessPointController which uses the hostapd daemon to control the access point.
*/
struct AccessPointControllerHostapd :
struct AccessPointControllerLinux :
public AccessPointController
{
virtual ~AccessPointControllerHostapd() = default;
virtual ~AccessPointControllerLinux() = default;

AccessPointControllerHostapd() = delete;
AccessPointControllerLinux() = delete;

/**
* @brief Construct a new AccessPointControllerHostapd object for the specified interface.
* @brief Construct a new AccessPointControllerLinux object for the specified interface.
*
* @param interfaceName The name of the interface to control.
*/
AccessPointControllerHostapd(std::string_view interfaceName);
AccessPointControllerLinux(std::string_view interfaceName);

/**
* @brief Get whether the access point is enabled.
Expand All @@ -48,12 +48,12 @@ private:
};

/**
* @brief Factory to create AccessPointControllerHostapd objects.
* @brief Factory to create AccessPointControllerLinux objects.
*/
struct AccessPointControllerHostapdFactory :
struct AccessPointControllerLinuxFactory :
public IAccessPointControllerFactory
{
virtual ~AccessPointControllerHostapdFactory() = default;
virtual ~AccessPointControllerLinuxFactory() = default;

/**
* @brief Create a new IAccessPointController object.
Expand All @@ -65,4 +65,4 @@ struct AccessPointControllerHostapdFactory :
};
} // namespace Microsoft::Net::Wifi

#endif // ACCESS_POINT_CONTROLLER_HOSTAPD_HXX
#endif // ACCESS_POINT_CONTROLLER_LINUX_HXX

0 comments on commit 1772ee6

Please sign in to comment.