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

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prplfoundation/prplMesh
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5df65ff9d754fa54378c73360b64a36430ea679f
Choose a base ref
..
head repository: prplfoundation/prplMesh
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6b4002f2cdd4537eddba25279acf13763ae2b8bf
Choose a head ref
Showing with 2,042 additions and 575 deletions.
  1. +34 −3 .gitlab-ci.yml
  2. +0 −5 CMakeLists.txt
  3. +2 −0 README.md
  4. +93 −1 agent/src/beerocks/slave/ap_manager_thread.cpp
  5. +15 −0 agent/src/beerocks/slave/ap_manager_thread.h
  6. +117 −78 agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp
  7. +35 −1 agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.h
  8. +6 −2 agent/src/beerocks/slave/son_slave_thread.cpp
  9. +156 −0 ci/owncloud/owncloud_definitions.sh
  10. +148 −0 ci/owncloud/upload_to_owncloud.sh
  11. +63 −29 ci/run_easymesh_cert.sh
  12. +0 −87 ci/upload_to_owncloud.sh
  13. +0 −1 common/beerocks/bcl/include/bcl/beerocks_config_file.h
  14. +0 −1 common/beerocks/bcl/source/beerocks_config_file.cpp
  15. +7 −1 common/beerocks/bwl/dummy/base_wlan_hal_dummy.cpp
  16. +17 −0 common/beerocks/bwl/dwpal/base_wlan_hal_dwpal.cpp
  17. +1 −1 common/beerocks/bwl/dwpal/mon_wlan_hal_dwpal.cpp
  18. +15 −12 common/beerocks/bwl/include/bwl/base_wlan_hal_types.h
  19. +17 −0 common/beerocks/bwl/include/bwl/nl80211_client.h
  20. +17 −0 common/beerocks/bwl/nl80211/base_wlan_hal_nl80211.cpp
  21. +2 −4 common/beerocks/bwl/shared/netlink_socket.cpp
  22. +1 −1 common/beerocks/bwl/shared/netlink_socket.h
  23. +45 −55 common/beerocks/bwl/shared/nl80211_client_impl.cpp
  24. +1 −1 common/beerocks/bwl/shared/nl80211_socket.cpp
  25. +1 −1 common/beerocks/bwl/shared/nl80211_socket.h
  26. +2 −0 common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_apmanager.h
  27. +4 −0 common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_backhaul.h
  28. +4 −0 common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_common.h
  29. +11 −0 common/beerocks/tlvf/AutoGenerated/src/beerocks/tlvf/beerocks_message_apmanager.cpp
  30. +22 −0 common/beerocks/tlvf/AutoGenerated/src/beerocks/tlvf/beerocks_message_backhaul.cpp
  31. +1 −0 common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_apmanager.yaml
  32. +2 −0 common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_backhaul.yaml
  33. +2 −0 common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_common.yaml
  34. +0 −1 controller/config/beerocks_controller.conf.in
  35. +2 −1 controller/src/beerocks/bml/rdkb/bml_rdkb.h
  36. +3 −1 controller/src/beerocks/bml/rdkb/internal/bml_rdkb_internal.cpp
  37. +7 −1 controller/src/beerocks/master/beerocks_master_main.cpp
  38. +0 −6 controller/src/beerocks/master/son_actions.cpp
  39. +0 −2 controller/src/beerocks/master/son_management.cpp
  40. +4 −4 controller/src/beerocks/master/son_master_thread.cpp
  41. +5 −4 controller/src/beerocks/master/tasks/client_steering_task.cpp
  42. +22 −7 controller/src/beerocks/master/tasks/rdkb/rdkb_wlan_task.cpp
  43. +1 −0 controller/src/beerocks/master/tasks/rdkb/rdkb_wlan_task.h
  44. +155 −0 documentation/images/plantuml/boardfarm_prplMesh_classes.puml
  45. +42 −0 documentation/images/plantuml/boardfarm_prplMesh_test_setup.puml
  46. +15 −2 framework/platform/bpl/include/bpl/bpl_cfg.h
  47. +39 −0 framework/platform/bpl/linux/bpl_cfg.cpp
  48. +56 −0 framework/platform/bpl/uci/cfg/bpl_cfg.cpp
  49. +3 −0 framework/platform/bpl/uci/db/prplmesh_db
  50. +1 −0 framework/tlvf/AutoGenerated/include/tlvf/ieee_1905_1/eMediaType.h
  51. +1 −0 framework/tlvf/AutoGenerated/src/tlvf/wfa_map/tlvClientAssociationControlRequest.cpp
  52. +3 −1 framework/tlvf/tlvf.py
  53. +1 −0 framework/tlvf/yaml/tlvf/ieee_1905_1/eMediaType.yaml
  54. +7 −1 framework/tlvf/yaml/tlvf/wfa_map/tlvClientAssociationControlRequest.yaml
  55. +156 −0 tests/certification/all_agent_tests.txt
  56. +69 −0 tests/environment.py
  57. +1 −0 tests/opts.py
  58. +46 −0 tests/sniffer.py
  59. +446 −214 tests/test_flows.py
  60. +60 −25 tests/test_gw_repeater.sh
  61. +1 −0 tools/docker/builder/Dockerfile
  62. +1 −1 tools/docker/builder/openwrt/build.sh
  63. +7 −4 tools/docker/run.sh
  64. +7 −1 tools/docker/runner/entrypoint.sh
  65. +1 −0 tools/docker/tests-runner/Dockerfile
  66. +39 −15 tools/download_ipk.sh
37 changes: 34 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
stages:
- build
- test
- upload

.in-prplmesh-builder:
image:
name: prplfoundationinc/prplmesh-builder:ubuntu-18.04
@@ -23,9 +28,10 @@ flake8:
stage: build
image: pipelinecomponents/flake8:f087c4c
variables:
FLAKE8_FILES: "tests/capi.py tests/opts.py"
FLAKE8_FILES: "tests/*.py"
script:
- flake8 --verbose $FLAKE8_FILES
- apk add --update --no-cache git
- git ls-files -z -- $FLAKE8_FILES | xargs -0 -t flake8 --verbose

flake8-diff:
stage: build
@@ -83,6 +89,31 @@ build-in-docker-static:
variables:
EXTRA_CMAKE_FLAGS: "-DBUILD_SHARED_LIBS=OFF"

upload-artifacts:
stage: upload
extends: .in-prplmesh-builder
script:
# the owncloud password is stored in the file pointed by "$CI_OWNCLOUD_PASSWORD".
# We can only store the password in it, since spaces are not supported in Gitlab masked variables.
# We symlink the file to .netrc and pre-pend to it to avoid manipulating the password itself
# on the command line.
- ln -s "$CI_OWNCLOUD_PASSWORD" ~/.netrc
- sed --follow-symlinks -i 's/^/machine ftp.essensium.com login prplmesh-robot-ci password /' ~/.netrc
- ci/owncloud/upload_to_owncloud.sh -v "artifacts/$CI_COMMIT_SHA-$CI_JOB_ID" ./build
- |
if [ $CI_COMMIT_BRANCH = "master" ] ; then
echo "Updating the 'latest' folder"
# Copying takes a lot of time, and we want the "latest" folder to be updated
# "as fast as possible", so we make a copy and move it:
ci/owncloud/owncloud_definitions.sh copy "artifacts/$CI_COMMIT_SHA-$CI_JOB_ID" "temp_uploads/latest_$CI_COMMIT_SHA-$CI_JOB_ID"
ci/owncloud/owncloud_definitions.sh move "temp_uploads/latest_$CI_COMMIT_SHA-$CI_JOB_ID" "artifacts/latest"
fi
needs:
- build-in-docker
- build-for-netgear-rax40
- build-for-glinet-b1300
- build-for-turris-omnia

.run-test-in-docker:
stage: test
extends: .in-prplmesh-builder
@@ -208,6 +239,6 @@ run-certification-tests:
- job: build-for-netgear-rax40
tags:
- certs-tests
timeout: 24h
timeout: 36h
rules:
- if: '$TESTS_TO_RUN'
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -103,11 +103,8 @@ endif()

# Default values
set(BEEROCKS_WLAN1_IFACE "wlan0")
set(BEEROCKS_WLAN1_STEERING_VAPS "wlan0.0")
set(BEEROCKS_WLAN2_IFACE "wlan2")
set(BEEROCKS_WLAN2_STEERING_VAPS "wlan2.0")
set(BEEROCKS_WLAN3_IFACE "wlan4")
set(BEEROCKS_WLAN3_STEERING_VAPS "wlan4.0")
set(BEEROCKS_BRIDGE_IFACE "br-lan")
if (NOT DEFINED BEEROCKS_BH_WIRE_IFACE)
set(BEEROCKS_BH_WIRE_IFACE "eth1")
@@ -126,8 +123,6 @@ set(BEEROCKS_LOG_SYSLOG_ENABLED "false")
# Platform specific flags
if (TARGET_PLATFORM STREQUAL "openwrt")
if (TARGET_PLATFORM_TYPE STREQUAL "ugw")
set(BEEROCKS_WLAN1_STEERING_VAPS "wlan0.1")
set(BEEROCKS_WLAN2_STEERING_VAPS "wlan2.2")
add_definitions(-DBEEROCKS_UGW)
set(BEEROCKS_REPEATER_MODE 1)
else()
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -64,6 +64,8 @@ Alternatively, [tools/maptools.py](tools/README.md) can be used to build and ins

Note - to build and run with Docker, see provided [building with docker](tools/docker/README.md)

Build artifacts are also available through the following link: https://ftp.essensium.com/owncloud/index.php/s/Sp7esHfmfH3bfwn .

## Running Instructions

Once built, prplMesh controller, agent and framework can be started using `prplmesh_utils.sh`:
94 changes: 93 additions & 1 deletion agent/src/beerocks/slave/ap_manager_thread.cpp
Original file line number Diff line number Diff line change
@@ -393,6 +393,9 @@ void ap_manager_thread::after_select(bool timeout)
now + std::chrono::seconds(HEARTBEAT_NOTIFICATION_DELAY_SEC);
}
}

// allow clients with expired blocking period timer
allow_expired_clients();
}

bool ap_manager_thread::socket_disconnected(Socket *sd)
@@ -699,9 +702,52 @@ bool ap_manager_thread::handle_cmdu(Socket *sd, ieee1905_1::CmduMessageRx &cmdu_

std::string sta_mac = network_utils::mac_to_string(request->mac());
std::string bssid = network_utils::mac_to_string(request->bssid());

const auto &vap_unordered_map = ap_wlan_hal->get_radio_info().available_vaps;
auto it = std::find_if(vap_unordered_map.begin(), vap_unordered_map.end(),
[&](const std::pair<int, bwl::VAPElement> &element) {
return element.second.mac == bssid;
});

if (it == vap_unordered_map.end()) {
//AP does not have the requested vap, probably will be handled on the other AP
return true;
}

LOG(DEBUG) << "CLIENT_DISALLOW: mac = " << sta_mac << ", bssid = " << bssid;

ap_wlan_hal->sta_deny(sta_mac, bssid);

// Check if validity period is set then add it to the "disallowed client timeouts" list
// This list will be polled in after_select()
// When validity period is timed out sta_allow will be called.
if (request->validity_period_sec()) {

disallowed_client_t disallowed_client;

// calculate new disallow timeout from client validity period parameter [sec]
disallowed_client.timeout = std::chrono::steady_clock::now() +
std::chrono::seconds(request->validity_period_sec());
disallowed_client.mac = request->mac();
disallowed_client.bssid = request->bssid();

// Remove old disallow period timeout from the list before inserting new
remove_client_from_disallowed_list(request->mac(), request->bssid());

// insert new disallow timeout to the list
m_disallowed_clients.push_back(disallowed_client);

LOG(DEBUG) << "client " << disallowed_client.mac
<< " will be allowed to accosiate with bssid " << disallowed_client.bssid
<< " in "
<< std::chrono::duration_cast<std::chrono::seconds>(
disallowed_client.timeout - std::chrono::steady_clock::now())
.count()
<< "sec";
} else {
LOG(WARNING) << "CLIENT_DISALLOW validity period set to 0, STA mac " << request->mac()
<< " will remain blocked from bssid " << request->bssid();
}
break;
}
case beerocks_message::ACTION_APMANAGER_CLIENT_ALLOW_REQUEST: {
@@ -714,9 +760,23 @@ bool ap_manager_thread::handle_cmdu(Socket *sd, ieee1905_1::CmduMessageRx &cmdu_

std::string sta_mac = network_utils::mac_to_string(request->mac());
std::string bssid = network_utils::mac_to_string(request->bssid());
LOG(DEBUG) << "CLIENT_ALLOW: mac = " << sta_mac << ", bssid = " << bssid;

const auto &vap_unordered_map = ap_wlan_hal->get_radio_info().available_vaps;
auto it = std::find_if(vap_unordered_map.begin(), vap_unordered_map.end(),
[&](const std::pair<int, bwl::VAPElement> &element) {
return element.second.mac == bssid;
});

if (it == vap_unordered_map.end()) {
//AP does not have the requested vap, probably will be handled on the other AP
return true;
}

remove_client_from_disallowed_list(request->mac(), request->bssid());

LOG(DEBUG) << "CLIENT_ALLOW: mac = " << sta_mac << ", bssid = " << bssid;
ap_wlan_hal->sta_allow(sta_mac, bssid);

break;
}
case beerocks_message::ACTION_APMANAGER_READ_ACS_REPORT_REQUEST: {
@@ -1506,6 +1566,9 @@ void ap_manager_thread::handle_hostapd_attached()
notification->cs_params().bandwidth = uint8_t(
beerocks::utils::convert_bandwidth_to_enum(ap_wlan_hal->get_radio_info().bandwidth));

notification->params().frequency_band = ap_wlan_hal->get_radio_info().frequency_band;
notification->params().max_bandwidth = ap_wlan_hal->get_radio_info().max_bandwidth;

// Copy the channels supported by the AP
copy_radio_supported_channels(ap_wlan_hal, notification->params().supported_channels);

@@ -1662,3 +1725,32 @@ void ap_manager_thread::send_steering_return_status(beerocks_message::eActionOp_
}
return;
}

void ap_manager_thread::remove_client_from_disallowed_list(const sMacAddr &mac,
const sMacAddr &bssid)
{
auto it = std::find_if(m_disallowed_clients.begin(), m_disallowed_clients.end(),
[&](const son::ap_manager_thread::disallowed_client_t &element) {
return ((element.mac == mac) && (element.bssid == bssid));
});

if (it != m_disallowed_clients.end()) {
// remove client from the disallow list
m_disallowed_clients.erase(it);
}
}

void ap_manager_thread::allow_expired_clients()
{
// check if any client disallow period has expired and allow it.
for (auto it = m_disallowed_clients.begin(); it != m_disallowed_clients.end();) {
if (std::chrono::steady_clock::now() > it->timeout) {
LOG(DEBUG) << "CLIENT_ALLOW: mac = " << it->mac << ", bssid = " << it->bssid;
ap_wlan_hal->sta_allow(network_utils::mac_to_string(it->mac),
network_utils::mac_to_string(it->bssid));
m_disallowed_clients.erase(it);
} else {
it++;
}
}
}
15 changes: 15 additions & 0 deletions agent/src/beerocks/slave/ap_manager_thread.h
Original file line number Diff line number Diff line change
@@ -47,6 +47,18 @@ class ap_manager_thread : public beerocks::socket_thread {
eBackhaulVapType type;
};

/**
* disallowed client parameters
* Used to save clients mac, bssid that the client is disallowed from and
* validity period of time (blocking)
* so we could unblock it when the period expires
*/
struct disallowed_client_t {
sMacAddr mac;
sMacAddr bssid;
std::chrono::steady_clock::time_point timeout;
};

enum eThreadErrors : uint32_t {
APMANAGER_THREAD_ERROR_NO_ERROR = 0,
APMANAGER_THREAD_ERROR_HOSTAP_DISABLED = 1,
@@ -75,13 +87,16 @@ class ap_manager_thread : public beerocks::socket_thread {
void send_heartbeat();
void send_steering_return_status(beerocks_message::eActionOp_APMANAGER ActionOp,
int32_t status);
void remove_client_from_disallowed_list(const sMacAddr &mac, const sMacAddr &bssid);
void allow_expired_clients();

std::string slave_uds;
uint8_t wifi_channel;
bool acs_enabled;
bool low_filter;
int bss_steer_valid_int;
int bss_steer_imminent_valid_int;
std::vector<disallowed_client_t> m_disallowed_clients;

std::list<backhaul_vap_list_element_t> backhaul_vaps_list;

Loading