diff --git a/.gitignore b/.gitignore index f1e1d9ba..80f55ec1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,12 @@ _deps /docker-compose/.env /docker-compose/.env_* /cmake-build/ -/uploads/ test_scripts/curl/token.json .vscode/c_cpp_properties.json test_scripts/curl/result.json *.swp helm/charts/* !helm/charts/.gitkeep +/portal-test/ +/src/ow_version.h + diff --git a/.idea/.gitignore b/.idea/.gitignore index 73f69e09..b0811f16 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ /dataSources.local.xml # Editor-based HTTP Client requests /httpRequests/ +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/.idea/misc.xml b/.idea/misc.xml index 89cf9396..501b2dd1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,8 @@ + + diff --git a/BUILDING.md b/BUILDING.md index b627e06d..17770aec 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,5 +1,5 @@ # Building from source -In order to build the OWGW, you will need to install its dependencies, which includes the following: +In order to build OWGW, you will need to install its dependencies, which includes the following: - cmake - boost - POCO 1.10.1 or later @@ -12,43 +12,43 @@ In order to build the OWGW, you will need to install its dependencies, which inc The build is done in 2 parts. The first part is to build a local copy of the framework tailored to your environment. This framework is called [Poco](https://github.com/pocoproject/poco). The version used in this project has a couple of fixes -from the master copy needed for cmake. Please use the version of this [Poco fix](https://github.com/AriliaWireless/poco). Building +from the master copy needed for cmake. Please use the version of this [Poco fix](https://github.com/Telecominfraproject/wlan-cloud-lib-poco). Building Poco may take several minutes depending on the platform you are building on. ## Ubuntu These instructions have proven to work on Ubuntu 20.4. ```bash -sudo apt install git cmake g++ libssl-dev libmariadb-dev -sudo apt install libpq-dev libaprutil1-dev apache2-dev libboost-all-dev -sudo apt install librdkafka-dev // default-libmysqlclient-dev -sudo apt install nlohmann-json-dev +sudo apt install git cmake g++ libssl-dev libmariadb-dev \ + libpq-dev libaprutil1-dev apache2-dev libboost-all-dev \ + librdkafka-dev // default-libmysqlclient-dev \ + nlohmann-json-dev -cd ~ -git clone https://github.com/AriliaWireless/poco --branch poco-tip-v2 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco cd poco mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ -git clone https://github.com/AriliaWireless/cppkafka --branch tip-v1 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka cd cppkafka mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ -git clone https://github.com/AriliaWireless/valijson --branch tip-v1 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch tip-v1 valijson cd valijson mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. git clone https://github.com/fmtlib/fmt --branch 9.0.0 /fmtlib cd fmtlib @@ -57,56 +57,59 @@ cd cmake-build cmake .. make make install +cd ../.. -cd ~ git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralgw cd wlan-cloud-ucentralgw mkdir cmake-build cd cmake-build cmake .. make -j 8 +cd ../.. ``` ## Fedora The following instructions have proven to work on Fedora 33 ```bash -sudo yum install cmake g++ openssl-devel mysql-devel mysql apr-util-devel boost boost-devel -sudo yum install yaml-cpp-devel lua-devel +sudo yum install cmake g++ openssl-devel mysql-devel mysql apr-util-devel boost boost-devel \ + yaml-cpp-devel lua-devel sudo dnf install postgresql.x86_64 librdkafka-devel sudo dnf install postgresql-devel json-devel -git clone https://github.com/AriliaWireless/poco --branch poco-tip-v2 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco cd poco mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -git clone https://github.com/AriliaWireless/cppkafka --branch tip-v1 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka cd cppkafka mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ -git clone https://github.com/AriliaWireless/valijson --branch tip-v1 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch tip-v1 valijson cd valijson mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralgw cd wlan-cloud-ucentralgw mkdir cmake-build cd cmake-build cmake .. make +cd ../.. ``` ## macOS Build @@ -125,7 +128,7 @@ brew install openssl \ nlohmann-json \ fmt -git clone https://github.com/AriliaWireless/poco --branch poco-tip-v2 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco pushd poco mkdir cmake-build push cmake-build @@ -135,7 +138,7 @@ sudo cmake --build . --target install popd popd -git clone https://github.com/AriliaWireless/cppkafka --branch tip-v1 +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch tip-v1 cppkafka pushd cppkafka mkdir cmake-build pushd cmake-build @@ -145,10 +148,10 @@ sudo cmake --build . --target install popd popd -git clone https://github.com/AriliaWireless/valijson --branch tip-v1 -cd valijson +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch tip-v1 valijson +pushd valijson mkdir cmake-build -cd cmake-build +pushd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install @@ -171,20 +174,23 @@ support. You can build with only SQLite support by not installing the packages f adding -DSMALL_BUILD=1 on the cmake build line. ```bash -sudo apt install git cmake g++ libssl-dev libaprutil1-dev apache2-dev libboost-all-dev libyaml-cpp-dev -git clone https://github.com/stephb9959/poco +sudo apt install git cmake g++ libssl-dev libaprutil1-dev apache2-dev \ + libboost-all-dev libyaml-cpp-dev + +git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch poco-tip-v1 poco cd poco mkdir cmake-build cd cmake-build cmake .. cmake --build . --config Release sudo cmake --build . --target install +cd ../.. -cd ~ git clone https://github.com/Telecominfraproject/wlan-cloud-ucentralgw cd wlan-cloud-ucentralgw mkdir cmake-build cd cmake-build cmake -DSMALL_BUILD=1 .. make +cd ../.. ``` diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f0c2947..f9aa74ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.13) -project(owgw VERSION 3.0.0) +project(owgw VERSION 3.0.2) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED True) if(UNIX AND APPLE) set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) @@ -148,6 +149,7 @@ add_executable( owgw src/RESTAPI/RESTAPI_script_handler.cpp src/RESTAPI/RESTAPI_script_handler.h src/RESTAPI/RESTAPI_regulatory.cpp src/RESTAPI/RESTAPI_regulatory.h src/RESTAPI/RESTAPI_radiussessions_handler.cpp src/RESTAPI/RESTAPI_radiussessions_handler.h + src/storage/storage_blacklist.cpp src/storage/storage_tables.cpp src/storage/storage_logs.cpp src/storage/storage_command.cpp src/storage/storage_healthcheck.cpp src/storage/storage_statistics.cpp src/storage/storage_device.cpp src/storage/storage_capabilities.cpp src/storage/storage_defconfig.cpp @@ -175,7 +177,7 @@ add_executable( owgw src/SDKcalls.cpp src/SDKcalls.h src/StateUtils.cpp src/StateUtils.h - src/AP_WS_ReactorPool.h + src/AP_WS_Reactor_Pool.h src/AP_WS_Connection.h src/AP_WS_Connection.cpp src/TelemetryClient.h src/TelemetryClient.cpp @@ -211,7 +213,8 @@ add_executable( owgw src/RegulatoryInfo.cpp src/RegulatoryInfo.h src/RADIUSSessionTracker.cpp src/RADIUSSessionTracker.h src/libs/Scheduler.h src/libs/InterruptableSleep.h src/libs/ctpl_stl.h src/libs/Cron.h - src/GenericScheduler.cpp src/GenericScheduler.h src/framework/default_device_types.h src/AP_WS_Process_rebootLog.cpp src/AP_WS_ConfigAutoUpgrader.cpp src/AP_WS_ConfigAutoUpgrader.h src/RESTAPI/RESTAPI_default_firmwares.cpp src/RESTAPI/RESTAPI_default_firmwares.h src/RESTAPI/RESTAPI_default_firmware.cpp src/RESTAPI/RESTAPI_default_firmware.h src/storage/storage_def_firmware.cpp src/firmware_revision_cache.h src/sdks/sdk_fms.h) + src/GenericScheduler.cpp src/GenericScheduler.h src/framework/default_device_types.h src/AP_WS_Process_rebootLog.cpp src/AP_WS_ConfigAutoUpgrader.cpp src/AP_WS_ConfigAutoUpgrader.h src/RESTAPI/RESTAPI_default_firmwares.cpp src/RESTAPI/RESTAPI_default_firmwares.h src/RESTAPI/RESTAPI_default_firmware.cpp src/RESTAPI/RESTAPI_default_firmware.h src/storage/storage_def_firmware.cpp src/firmware_revision_cache.h src/sdks/sdk_fms.h + src/AP_WS_LookForUpgrade.cpp) if(NOT SMALL_BUILD) diff --git a/Dockerfile b/Dockerfile index 629f9faa..d1eb639e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,8 @@ FROM build-base AS poco-build ARG POCO_VERSION -ADD https://api.github.com/repos/AriliaWireless/poco/git/refs/tags/${POCO_VERSION} version.json -RUN git clone https://github.com/AriliaWireless/poco --branch ${POCO_VERSION} /poco +ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-poco/git/refs/tags/${POCO_VERSION} version.json +RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-poco --branch ${POCO_VERSION} /poco WORKDIR /poco RUN mkdir cmake-build @@ -31,8 +31,8 @@ FROM build-base AS cppkafka-build ARG CPPKAFKA_VERSION -ADD https://api.github.com/repos/AriliaWireless/cppkafka/git/refs/tags/${CPPKAFKA_VERSION} version.json -RUN git clone https://github.com/AriliaWireless/cppkafka --branch ${CPPKAFKA_VERSION} /cppkafka +ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-cppkafka/git/refs/tags/${CPPKAFKA_VERSION} version.json +RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka --branch ${CPPKAFKA_VERSION} /cppkafka WORKDIR /cppkafka RUN mkdir cmake-build @@ -45,8 +45,8 @@ FROM build-base AS valijson-build ARG VALIJASON_VERSION -ADD https://api.github.com/repos/AriliaWireless/valijson/git/refs/tags/${VALIJASON_VERSION} version.json -RUN git clone https://github.com/AriliaWireless/valijson --branch ${VALIJASON_VERSION} /valijson +ADD https://api.github.com/repos/Telecominfraproject/wlan-cloud-lib-valijson/git/refs/tags/${VALIJASON_VERSION} version.json +RUN git clone https://github.com/Telecominfraproject/wlan-cloud-lib-valijson --branch ${VALIJASON_VERSION} /valijson WORKDIR /valijson RUN mkdir cmake-build diff --git a/PROTOCOL.md b/PROTOCOL.md index aaf7be1d..c84eb1fc 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -355,6 +355,39 @@ The device should answer: - 1 : the device is busy but will reboot soon. `text` may indicate why. - 2 : the device will not reboot. `text` contains information as to why. +#### Controller wants to power-cycle PoE port(s) +Controller sends this command to power-cycle 1 or more PoE ports +```json +{ "jsonrpc" : "2.0" , + "method" : "powercycle" , + "params" : { + "serial" : , + "ports" : [ { "name" : "Ethernet1", "cycle" : 5000}, { "name" : "Ethernet8", "cycle" : 10000 } ], + "when" : Optional - + }, + "id" : +} +``` + +The device should answer: +```json +{ "jsonrpc" : "2.0" , + "result" : { + "serial" : , + "status" : { + "error" : 0 or an error number, + "text" : [ "Error 1" , "Error 2" ], + "when" :