Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add APIs to update AP configuration #121

Closed
wants to merge 17 commits into from

Conversation

corbin-phipps
Copy link
Contributor

@corbin-phipps corbin-phipps commented Jan 22, 2024

Type

  • Bug fix
  • Feature addition
  • Feature update
  • Documentation
  • Build Infrastructure

Side Effects

  • Breaking change
  • Non-functional change

Goals

This PR adds three new APIs for updating the configuration of an AP after the AP is enabled: WifiAccessPointSetPhyType, WifiAccessPointSetAuthenticationConfiguration, and WifiAccessPointSetFrequencyBands. This allows netremote clients to update the PHY type, AKM suite(s), cipher suite(s), and frequency band(s) of an AP.

Technical Details

  • Added WifiAccessPointSetAuthenticationConfiguration, and WifiAccessPointSetFrequencyBands to NetRemoteService.proto and related types to NetRemoteWifi.proto and WifiCore.proto.
  • Added placeholder API implementations to NetRemoteService.hxx/cxx.
  • Added basic unit tests for all APIs.

Test Results

Unit tests pass.

Reviewer Focus

None.

Future Work

  • Need to complete the API implementations and improve associated unit tests.
  • Update Dot11AccessPointConfiguration to use Dot11AccessPointAuthenticationConfiguration instead of a single Dot11AuthenticationAlgorithm and Dot11CipherSuite.

Checklist

  • Build target all compiles cleanly.
  • clang-format and clang-tidy deltas produced no new output.
  • Newly added functions include doxygen-style comment block.

Copy link
Contributor

@abeltrano abeltrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very good, mathcing the existing APIs we have in place to configure the AP. I left a few comments of things to explore a bit further for looking forward.

protocol/protos/NetRemoteWifi.proto Show resolved Hide resolved
protocol/protos/NetRemoteWifi.proto Outdated Show resolved Hide resolved
protocol/protos/WifiCore.proto Outdated Show resolved Hide resolved
protocol/protos/WifiCore.proto Show resolved Hide resolved
protocol/protos/NetRemoteWifi.proto Show resolved Hide resolved
protocol/protos/NetRemoteService.proto Outdated Show resolved Hide resolved
@abeltrano abeltrano force-pushed the user/corbinphipps/add-update-config-apis branch from 78fd3e6 to 9703411 Compare January 24, 2024 21:09
@corbin-phipps corbin-phipps marked this pull request as ready for review January 24, 2024 22:13
@corbin-phipps corbin-phipps requested a review from a team as a code owner January 24, 2024 22:13
@abeltrano
Copy link
Contributor

Test Results

Unit tests currently fail due to failures in the API implementations when creating an access point controller.

This is probably because the unit tests are using fake access point ids, and the server's AccessPointManager doesn't know about any APs with those ids. Probably we need to create software APs using the mac80211_hwsim driver which will be discovered by the server, like is done for the wpa-controller tests. Unfortunately, that again necessitates running the tests as root. Alternatively, we might be able to provide a fake ap discovery agent that serves up mocked APs.

@corbin-phipps
Copy link
Contributor Author

Test Results

Unit tests currently fail due to failures in the API implementations when creating an access point controller.

This is probably because the unit tests are using fake access point ids, and the server's AccessPointManager doesn't know about any APs with those ids. Probably we need to create software APs using the mac80211_hwsim driver which will be discovered by the server, like is done for the wpa-controller tests. Unfortunately, that again necessitates running the tests as root. Alternatively, we might be able to provide a fake ap discovery agent that serves up mocked APs.

Yes, you're absolutely right. I removed some REQUIRE statements from the unit tests so that they would pass as is until we added a way to create APs for the tests. It would be nice to avoid mocked APs if possible, but that's an option if needed

@corbin-phipps corbin-phipps changed the title Add APIs to update AP configuration (except for radio bands) Add APIs to update AP configuration Jan 26, 2024
@abeltrano
Copy link
Contributor

abeltrano commented Jan 26, 2024

Test Results

Unit tests currently fail due to failures in the API implementations when creating an access point controller.

This is probably because the unit tests are using fake access point ids, and the server's AccessPointManager doesn't know about any APs with those ids. Probably we need to create software APs using the mac80211_hwsim driver which will be discovered by the server, like is done for the wpa-controller tests. Unfortunately, that again necessitates running the tests as root. Alternatively, we might be able to provide a fake ap discovery agent that serves up mocked APs.

Yes, you're absolutely right. I removed some REQUIRE statements from the unit tests so that they would pass as is until we added a way to create APs for the tests. It would be nice to avoid mocked APs if possible, but that's an option if needed

Looking at this now, the AccessPointManager part will be easier than expected as it has AddAccessPoint and RemoveAccessPoint functions; they're private, but I don't see much harm in making them public, allowing the test to use them and add arbitrary access points. Alternatively, a thin wrapper class exposing the Add/Remove functions is another option that preserves the existing function visibility.

We can trivially extend the existing AccessPointTest, AccessPointFactoryTest, and AccessPointControllerTest with the functionality needed in the tests. For example, AccessPointTest would just save whatever values requested to be set in members. Should be straight-forward. I'll take a look at doing this later today.

@abeltrano
Copy link
Contributor

Looking at this now, the AccessPointManager part will be easier than expected as it has AddAccessPoint and RemoveAccessPoint functions; they're private, but I don't see much harm in making them public, allowing the test to use them and add arbitrary access points. Alternatively, a thin wrapper class exposing the Add/Remove functions is another option that preserves the existing function visibility.

We can trivially extend the existing AccessPointTest, AccessPointFactoryTest, and AccessPointControllerTest with the functionality needed in the tests. For example, AccessPointTest would just save whatever values requested to be set in members. Should be straight-forward. I'll take a look at doing this later today.

Done in #136.

Comment on lines +183 to +192
message Dot11AkmSuiteConfiguration
{
Microsoft.Net.Wifi.Dot11AuthenticationAlgorithm AuthenticationAlgorithm = 1;
Microsoft.Net.Wifi.Dot11AkmSuite AkmSuite = 2;
oneof Configuration
{
Dot11AkmSuiteConfigurationNone ConfigurationNone = 3;
Dot11AkmSuiteConfigurationSharedKey ConfigurationSharedKey = 4;
Dot11AkmSuiteConfigurationEnterprise ConfigurationEnterprise = 5;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I'm still trying to parse out whether this is the best encoding of all the auth args w.r.t. to the 802.11 specification. I think it's very close, if not completely correct.

I'm giving the auth-related parts of the spec a careful read through to hopefully resolve this.

@abeltrano abeltrano force-pushed the user/corbinphipps/add-update-config-apis branch from 4ce5e7b to b1292b9 Compare January 30, 2024 03:09
@abeltrano abeltrano force-pushed the user/corbinphipps/add-update-config-apis branch from b1292b9 to e91aa8e Compare January 31, 2024 03:00
@abeltrano abeltrano mentioned this pull request Feb 7, 2024
10 tasks
@abeltrano abeltrano closed this Jun 28, 2024
@corbin-phipps corbin-phipps deleted the user/corbinphipps/add-update-config-apis branch June 28, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants