Skip to content
This repository was archived by the owner on Sep 7, 2020. It is now read-only.

Conversation

@RanRegev
Copy link
Collaborator

This PR is for https://jira.prplfoundation.org/browse/PPM-4
This PR disables #1514 and #1550 which were mixed and are not clean.
This PR has everything that is needed.

A file explaining the content of this directory
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
added hostapd Configuration class to
be used by applications that wants to
edit, add, delete, enable, disable, etc
parametrs in hostapd configuration file
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
unit tests to test hostapd
configuration functionality
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
created CMakeLists.txt to build prplmest_hostapd library
and its unit tests
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
introducing: set_create_vap_value
functionality and unit test
also: few minor general issues:
* a variable for the test file
* interface to get the last message (not implemented yet)
* change the variable name from error to message and fix
accordingly in the code
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
introducing: set_create_vap_value, int overload
implemented the function using the string version
added functionality and tests
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
introducing: store
stores internal configuration into the same
file it was loaded from, effectively changing the
configuration.
added functionality and tests
also:
* chnaged prerequisite in tests from
EXPECT to ASSERT - as we can't continue without it
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
introducing: get_vap_value
added the ability to get a value
for a specific vap with a given key.
added functionality and tests
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
added functionality to disable all vaps that
are access-points (as opposed to STA for example).
the code mimics the existing functionality taken from
ap_wlan_hal_dwpal.cpp.
added funcvtionlity and unit test
note:
the example unit-test configuration file did not
contain any vap with the mode= line, therefore it
was added few of this.
also:
it was discovered that it is OK to look for non-exiting key
within vap's configuration and the code was changed accordingly
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
added private helper functions for functions
changed all usages accordingly
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
comment out (disable) the given vap
by adding a comment (#) to it and to
all keys related to this vap
added functionality and unit test
also:
clang format chages
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
load, search and store comented lines in the
file. this ability is needed for disabling
vaps in the "up stream" version of hostapd.
the intel version disables vaps by adding the line
"start_disabled=1"
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
uncomment (enable) the given vap
by removing all comment signes (###) from it
and from all keys related to this vap
added functionality and unit test
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
introducing: a function that goes all over all
vaps which their mode is "ap" and apply the
input function to them.
may be used for example to disable all
vaps.
added functionality and tested by:
- adding a parameter "start_disabled=1" to all.
- commenting out
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
There is a need to go on both the ap-vaps configured in hostapd
and in paralell go over the given configuration (non-hostapd structure)
The added functionality gives hostapd configuration class the
responsibility of iterating over the vaps _and_ increment the
user-iterator. the result is that the user's function is called
with the next vap _and_ the next element in its given list.
it is the user responsibility however to make sure that its container
has at least as the number of vaps. otherwise for_all_ap_vaps() would
increment the iterator passed the end of the user's container
tested by implementing the non iterator version of for_all_ap_vaps()
in term of the iterator version, with a dummy iterator
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
a test that goes all over all
vaps and enables them
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
testing the ability to iterate over the user
container and the hostapd's ap-vaps in paralel
giving the user the ability to set parametrs
based on its own container and the hostapd container
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
rebase --autosquash -i origin/master
introduced issues that I couldn't figure out
how to fix with rebasing again.
gave up and added this fix commit.
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
added a functionality to set or create key/value
in the header part: either string or int
added functionality and tests
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
added a function to get a value from the head section
added functionality and unit test
also in this commit:
the variable named it_str is now called line_iter
(it is better describs its meaning)
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
originally bss= was the only sign for
vap configuration inside the hostapd file.
this was based on intel's hostapd version.
the hostapd upstream indicates vap configuration
with interface= sign.
load() now seeks for the vap sign as set
by the user.
also in this commit:
- removed namespace config from prplmesh::hostapd.
left with only the two and class Configuration.
- clang format fixes
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
there is a need to let the usr the ability to decide
if a given vap is an ap vap or not.
e.g.
for intel the predicate is: mode=ap
for ap stream hostapd: all vaps are ap vaps
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
this commnit fixes all relevant comments for
#1550
https://jira.prplfoundation.org/browse/PPM-249

Signed-off-by: Ran Regev <[email protected]>
there is a need to let the usr the ability to decide
if a given vap is an ap vap or not.
e.g.
for intel the predicate is: mode=ap
for up stream's hostapd: all vaps are ap vaps

Signed-off-by: Ran Regev <[email protected]>
added prplmesh_hostapd dependency to bwl and btl
in cmake

Signed-off-by: Ran Regev <[email protected]>
added hostapd configuration to
update_vap_credentials()
the implementation was copied and then adopted
from dwpal implementation
(common/beerocks/bwl/dwpal/ap_wlan_hal_dwpal.cpp)
tested on Turris Omnia

Signed-off-by: Ran Regev <[email protected]>
this commit closes issues found in
#1550
https://jira.prplfoundation.org/browse/PPM-4
MAP-4.2.1:turris-omnia

Signed-off-by: Ran Regev <[email protected]>
Set the unit tests file to completely match
turris omnia configuration as found in the CI.
this trail-and-error approach for working with hostapd
configurartion is the best that we can do now.

Signed-off-by: Ran Regev <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants