-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
silabs-multiprotocol: Revert to Gecko SDK v4.3.1 (#3388)
* Revert "silabs-multiprotocol: Update to Gecko SDK v4.4.0 (#3370)" This reverts commit 07104ea. * Update CHANGELOG.md accordingly * Update silabs-multiprotocol/CHANGELOG.md Co-authored-by: puddly <32534428+puddly@users.noreply.github.com> --------- Co-authored-by: puddly <32534428+puddly@users.noreply.github.com>
- Loading branch information
Showing
14 changed files
with
1,230 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
silabs-multiprotocol/otbr-patches/0001-rest-support-erasing-all-persistent-info-1908.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
From 29c0b6b142c6692a53a83fb4604fc2bcebeb17af Mon Sep 17 00:00:00 2001 | ||
Message-ID: <29c0b6b142c6692a53a83fb4604fc2bcebeb17af.1691047014.git.stefan@agner.ch> | ||
From: Stefan Agner <stefan@agner.ch> | ||
Date: Thu, 13 Jul 2023 20:00:34 +0200 | ||
Subject: [PATCH] [rest] support erasing all persistent info (#1908) | ||
|
||
Add REST API to support erasing all persistent information, effectively | ||
factory resetting the OTBR. The implementation follows the semantic of | ||
the D-Bus API and automatically disables the Thread network. | ||
|
||
After erasing all persistent information the dataset is cleared too. So | ||
this allows to build a new Thread network with subsequent use of the | ||
PUT method to the /node/dataset/active endpoint. | ||
--- | ||
src/rest/openapi.yaml | 9 +++++++++ | ||
src/rest/resource.cpp | 38 ++++++++++++++++++++++++++++++++++---- | ||
src/rest/resource.hpp | 1 + | ||
src/rest/response.cpp | 2 +- | ||
4 files changed, 45 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/src/rest/openapi.yaml b/src/rest/openapi.yaml | ||
index 43747e2e01..2ba2a4dd56 100644 | ||
--- a/src/rest/openapi.yaml | ||
+++ b/src/rest/openapi.yaml | ||
@@ -43,6 +43,15 @@ paths: | ||
application/json: | ||
schema: | ||
type: object | ||
+ delete: | ||
+ tags: | ||
+ - node | ||
+ summary: Erase all persistent information, essentially factory reset the Border Router. | ||
+ responses: | ||
+ "200": | ||
+ description: Successful operation | ||
+ "409": | ||
+ description: Thread interface is in wrong state. | ||
/node/ba-id: | ||
get: | ||
tags: | ||
diff --git a/src/rest/resource.cpp b/src/rest/resource.cpp | ||
index 1139a2d788..a60e9d9483 100644 | ||
--- a/src/rest/resource.cpp | ||
+++ b/src/rest/resource.cpp | ||
@@ -257,16 +257,46 @@ exit: | ||
} | ||
} | ||
|
||
-void Resource::NodeInfo(const Request &aRequest, Response &aResponse) const | ||
+void Resource::DeleteNodeInfo(Response &aResponse) const | ||
{ | ||
+ otbrError error = OTBR_ERROR_NONE; | ||
std::string errorCode; | ||
- if (aRequest.GetMethod() == HttpMethod::kGet) | ||
+ | ||
+ VerifyOrExit(mNcp->GetThreadHelper()->Detach() == OT_ERROR_NONE, error = OTBR_ERROR_INVALID_STATE); | ||
+ VerifyOrExit(otInstanceErasePersistentInfo(mInstance) == OT_ERROR_NONE, error = OTBR_ERROR_REST); | ||
+ mNcp->Reset(); | ||
+ | ||
+exit: | ||
+ if (error == OTBR_ERROR_NONE) | ||
{ | ||
- GetNodeInfo(aResponse); | ||
+ errorCode = GetHttpStatus(HttpStatusCode::kStatusOk); | ||
+ aResponse.SetResponsCode(errorCode); | ||
} | ||
- else | ||
+ else if (error == OTBR_ERROR_INVALID_STATE) | ||
+ { | ||
+ ErrorHandler(aResponse, HttpStatusCode::kStatusConflict); | ||
+ } | ||
+ else if (error != OTBR_ERROR_NONE) | ||
{ | ||
+ ErrorHandler(aResponse, HttpStatusCode::kStatusInternalServerError); | ||
+ } | ||
+} | ||
+ | ||
+void Resource::NodeInfo(const Request &aRequest, Response &aResponse) const | ||
+{ | ||
+ std::string errorCode; | ||
+ | ||
+ switch (aRequest.GetMethod()) | ||
+ { | ||
+ case HttpMethod::kGet: | ||
+ GetNodeInfo(aResponse); | ||
+ break; | ||
+ case HttpMethod::kDelete: | ||
+ DeleteNodeInfo(aResponse); | ||
+ break; | ||
+ default: | ||
ErrorHandler(aResponse, HttpStatusCode::kStatusMethodNotAllowed); | ||
+ break; | ||
} | ||
} | ||
|
||
diff --git a/src/rest/resource.hpp b/src/rest/resource.hpp | ||
index 0c089c7296..d79085dbfc 100644 | ||
--- a/src/rest/resource.hpp | ||
+++ b/src/rest/resource.hpp | ||
@@ -137,6 +137,7 @@ private: | ||
void HandleDiagnosticCallback(const Request &aRequest, Response &aResponse); | ||
|
||
void GetNodeInfo(Response &aResponse) const; | ||
+ void DeleteNodeInfo(Response &aResponse) const; | ||
void GetDataBaId(Response &aResponse) const; | ||
void GetDataExtendedAddr(Response &aResponse) const; | ||
void GetDataState(Response &aResponse) const; | ||
diff --git a/src/rest/response.cpp b/src/rest/response.cpp | ||
index 93cbe0b6df..3460b90e1f 100644 | ||
--- a/src/rest/response.cpp | ||
+++ b/src/rest/response.cpp | ||
@@ -34,7 +34,7 @@ | ||
#define OT_REST_RESPONSE_ACCESS_CONTROL_ALLOW_HEADERS \ | ||
"Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, " \ | ||
"Access-Control-Request-Headers" | ||
-#define OT_REST_RESPONSE_ACCESS_CONTROL_ALLOW_METHOD "GET, OPTIONS, PUT" | ||
+#define OT_REST_RESPONSE_ACCESS_CONTROL_ALLOW_METHOD "DELETE, GET, OPTIONS, PUT" | ||
#define OT_REST_RESPONSE_CONNECTION "close" | ||
|
||
namespace otbr { | ||
-- | ||
2.41.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
silabs-multiprotocol/otbr-patches/0003-mdns-update-mDNSResponder-to-1790.80.10.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
From b7c0c61b56d32ec5fc65160d10c0fd66f0ac9c8a Mon Sep 17 00:00:00 2001 | ||
Message-ID: <b7c0c61b56d32ec5fc65160d10c0fd66f0ac9c8a.1691047014.git.stefan@agner.ch> | ||
In-Reply-To: <29c0b6b142c6692a53a83fb4604fc2bcebeb17af.1691047014.git.stefan@agner.ch> | ||
References: <29c0b6b142c6692a53a83fb4604fc2bcebeb17af.1691047014.git.stefan@agner.ch> | ||
From: Stefan Agner <stefan@agner.ch> | ||
Date: Wed, 21 Jun 2023 12:04:33 +0200 | ||
Subject: [PATCH] [mdns] update mDNSResponder to 1790.80.10 | ||
|
||
--- | ||
script/bootstrap | 11 +++++------ | ||
tests/scripts/bootstrap.sh | 9 ++++----- | ||
2 files changed, 9 insertions(+), 11 deletions(-) | ||
|
||
diff --git a/script/bootstrap b/script/bootstrap | ||
index 0b72aa4971..2256f5e437 100755 | ||
--- a/script/bootstrap | ||
+++ b/script/bootstrap | ||
@@ -56,16 +56,15 @@ install_packages_apt() | ||
|
||
# mDNS | ||
sudo apt-get install --no-install-recommends -y libavahi-client3 libavahi-common-dev libavahi-client-dev avahi-daemon | ||
- (MDNS_RESPONDER_SOURCE_NAME=mDNSResponder-1310.80.1 \ | ||
+ (MDNS_RESPONDER_SOURCE_NAME=mDNSResponder-1790.80.10 \ | ||
&& cd /tmp \ | ||
&& wget --no-check-certificate https://github.com/apple-oss-distributions/mDNSResponder/archive/refs/tags/$MDNS_RESPONDER_SOURCE_NAME.tar.gz \ | ||
&& mkdir -p $MDNS_RESPONDER_SOURCE_NAME \ | ||
&& tar xvf $MDNS_RESPONDER_SOURCE_NAME.tar.gz -C $MDNS_RESPONDER_SOURCE_NAME --strip-components=1 \ | ||
- && cd /tmp/$MDNS_RESPONDER_SOURCE_NAME/Clients \ | ||
- && sed -i '/#include <ctype.h>/a #include <stdarg.h>' dns-sd.c \ | ||
- && sed -i '/#include <ctype.h>/a #include <sys/param.h>' dns-sd.c \ | ||
- && cd /tmp/$MDNS_RESPONDER_SOURCE_NAME/mDNSPosix \ | ||
- && make os=linux && sudo make install os=linux) | ||
+ && cd /tmp/"$MDNS_RESPONDER_SOURCE_NAME"/mDNSShared \ | ||
+ && sed -i 's/__block mStatus err;/mStatus err;/' uds_daemon.c \ | ||
+ && cd /tmp/"$MDNS_RESPONDER_SOURCE_NAME"/mDNSPosix \ | ||
+ && make os=linux tls=no && sudo make install os=linux tls=no) | ||
|
||
# Boost | ||
sudo apt-get install --no-install-recommends -y libboost-dev libboost-filesystem-dev libboost-system-dev | ||
diff --git a/tests/scripts/bootstrap.sh b/tests/scripts/bootstrap.sh | ||
index a89e9ccd6e..6b4affffce 100755 | ||
--- a/tests/scripts/bootstrap.sh | ||
+++ b/tests/scripts/bootstrap.sh | ||
@@ -126,15 +126,14 @@ case "$(uname)" in | ||
fi | ||
|
||
if [ "${OTBR_MDNS-}" == 'mDNSResponder' ]; then | ||
- SOURCE_NAME=mDNSResponder-1310.80.1 | ||
+ SOURCE_NAME=mDNSResponder-1790.80.10 | ||
wget https://github.com/apple-oss-distributions/mDNSResponder/archive/refs/tags/$SOURCE_NAME.tar.gz \ | ||
&& mkdir -p $SOURCE_NAME \ | ||
&& tar xvf $SOURCE_NAME.tar.gz -C $SOURCE_NAME --strip-components=1 \ | ||
- && cd $SOURCE_NAME/Clients \ | ||
- && sed -i '/#include <ctype.h>/a #include <stdarg.h>' dns-sd.c \ | ||
- && sed -i '/#include <ctype.h>/a #include <sys/param.h>' dns-sd.c \ | ||
+ && cd "$SOURCE_NAME"/mDNSShared \ | ||
+ && sed -i 's/__block mStatus err;/mStatus err;/' uds_daemon.c \ | ||
&& cd ../mDNSPosix \ | ||
- && make os=linux && sudo make install os=linux | ||
+ && make os=linux tls=no && sudo make install os=linux tls=no | ||
fi | ||
|
||
# Enable IPv6 | ||
-- | ||
2.41.0 | ||
|
Oops, something went wrong.