Skip to content

Commit

Permalink
Add Dot11SecurityProtocol to Dot11AccessPointCapabilities as repeated…
Browse files Browse the repository at this point in the history
… field.
  • Loading branch information
abeltrano committed Mar 14, 2024
1 parent 4fb0213 commit d504336
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions protocol/protos/WifiCore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ message Dot11AccessPointConfiguration

message Dot11AccessPointCapabilities
{
repeated Microsoft.Net.Wifi.Dot11FrequencyBand FrequencyBands = 1;
repeated Microsoft.Net.Wifi.Dot11SecurityProtocol SecurityProtocols = 1;
repeated Microsoft.Net.Wifi.Dot11PhyType PhyTypes = 2;
repeated Microsoft.Net.Wifi.Dot11AkmSuite AkmSuites = 3;
repeated Microsoft.Net.Wifi.Dot11FrequencyBand FrequencyBands = 3;
repeated Microsoft.Net.Wifi.Dot11CipherSuite CipherSuites = 4;
repeated Microsoft.Net.Wifi.Dot11AkmSuite AkmSuites = 5;
}

enum Dot11AccessPointState
Expand Down
10 changes: 10 additions & 0 deletions src/common/tools/cli/NetRemoteCliHandlerOperations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ NetRemoteAccessPointCapabilitiesToString(const Microsoft::Net::Wifi::Dot11Access

std::stringstream ss;

constexpr auto SecurityProtocolPrefixLength = std::size(std::string_view("Dot11SecurityProtocol"));
ss << indent0
<< "Security Protocols: ";
for (const auto& securityProtocol : accessPointCapabilities.securityprotocols()) {
std::string_view securityProtocolName(magic_enum::enum_name(static_cast<Microsoft::Net::Wifi::Dot11SecurityProtocol>(securityProtocol)));
securityProtocolName.remove_prefix(SecurityProtocolPrefixLength);
ss << '\n'
<< indent1 << securityProtocolName;
}

constexpr auto PhyTypePrefixLength = std::size(std::string_view("Dot11PhyType"));
ss << indent0
<< "Phy Types: ";
Expand Down
6 changes: 6 additions & 0 deletions src/common/wifi/dot11/adapter/Ieee80211Dot11Adapters.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ ToDot11AccessPointCapabilities(const Ieee80211AccessPointCapabilities& ieee80211
Dot11AccessPointCapabilities dot11Capabilities{};

std::vector<Dot11SecurityProtocol> securityProtocols(std::size(ieee80211AccessPointCapabilities.SecurityProtocols));
std::ranges::transform(ieee80211AccessPointCapabilities.SecurityProtocols, std::begin(securityProtocols), ToDot11SecurityProtocol);

*dot11Capabilities.mutable_securityprotocols() = {
std::make_move_iterator(std::begin(securityProtocols)),
std::make_move_iterator(std::end(securityProtocols))
};

std::vector<Dot11PhyType> phyTypes(std::size(ieee80211AccessPointCapabilities.PhyTypes));
std::ranges::transform(ieee80211AccessPointCapabilities.PhyTypes, std::begin(phyTypes), ToDot11PhyType);
Expand Down

0 comments on commit d504336

Please sign in to comment.