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 hostapd interaction interface: define and implement basic commands #30

Merged
merged 24 commits into from
Nov 22, 2023

Conversation

abeltrano
Copy link
Contributor

This pull request includes a wide range of changes to the codebase related to the Hostapd protocol, cache management, response handling, and testing. The most important changes include adding new definitions and structures related to the Hostapd protocol, implementing the Hostapd class with necessary headers and member functions, and adding new methods and attributes to the Notification class for extracting information from GitHub notifications.

Main protocol changes:

  • linux/wpa-controller/include/Wpa/ProtocolHostapd.hxx: Added new definitions and structures related to the Hostapd protocol.
  • linux/wpa-controller/Hostapd.cxx: Implemented the Hostapd class, including necessary headers and member functions for sending commands to the hostapd daemon and handling responses.
  • linux/wpa-controller/include/Wpa/Hostapd.hxx: Added the declaration of the Hostapd class, providing the necessary member functions to control the hostapd daemon.
  • linux/wpa-controller/ProtocolHostapd.cxx: Added new functions to convert a string representation of the hostapd interface state to an enum value and to check if a given hostapd interface state is operational.

Cache and response handling changes:

  • linux/wpa-controller/WpaResponse.cxx: Added two new member functions to the WpaResponse class, operator bool() and IsOk(), for boolean context usage and checking if the response is considered "OK".
  • linux/wpa-controller/include/Wpa/WpaCommandStatus.hxx: Added a new header file defining a struct WpaCommandStatus that inherits from WpaCommand and adds a Status member variable of type HostapdStatus.
  • linux/wpa-controller/include/Wpa/WpaCommand.hxx: Modified the WpaCommand struct to include a default constructor and a constructor that takes a std::string_view parameter.
  • linux/wpa-controller/WpaCommand.cxx: Removed the WpaCommand constructor that takes a std::string_view parameter.
  • linux/wpa-controller/include/Wpa/WpaResponseStatus.hxx: Added a new header file defining a struct WpaResponseStatus inheriting from WpaResponse and adding a member variable Status of type HostapdStatus.
  • linux/wpa-controller/include/Wpa/WpaResponse.hxx: Added additional member functions and a private member variable to the WpaResponse struct, including a constructor, an implicit conversion operator, and two member functions IsOk() and Failed().
  • linux/wpa-controller/include/Wpa/ProtocolWpa.hxx: Added a new header file defining a struct ProtocolWpa that contains constants for various command and response payloads used in the WPA daemon protocol.
  • linux/wpa-controller/include/Wpa/IHostapd.hxx: Added a new header file defining an interface IHostapd for interacting with the hostapd daemon.

Testing and build system changes:

  • test/models/notification/cleaner_test.rb: Added new tests to the Notification::Cleaner class. (Fdc3fd42R1)
  • linux/wpa-controller/CMakeLists.txt: Added new source files and header files to the wpa-controller target, as well as new include directories. [1] [2]
  • src/shared/notstd/CMakeLists.txt: Added a new library target called notstd and included the Exceptions.hxx header file in the target sources.
  • src/shared/CMakeLists.txt: Added a new subdirectory notstd to the src/shared directory.
  • tests/unit/linux/wpa-controller/CMakeLists.txt: Added a new source file TestHostapd.cxx to the wpa-controller-test-unit target.
  • linux/wpa-controller/WpaCommandStatus.cxx: Added a new source file defining the constructor for the WpaCommandStatus struct.
  • linux/wpa-controller/ProtocolWpa.cxx: Added a new source file defining two static member functions for checking if a given response starts with "OK" or "FAIL" payloads.
  • src/shared/notstd/include/notstd/Exceptions.hxx: Added a new header file defining a new exception class NotImplementedException.

@abeltrano abeltrano requested a review from a team as a code owner November 22, 2023 04:25
@abeltrano abeltrano merged commit e4ca4f7 into develop Nov 22, 2023
2 checks passed
@abeltrano abeltrano deleted the wpactrlsettings branch November 22, 2023 19:54
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.

1 participant