From 21749a262aa32af5bb1ca4f6fb86d00bdd970c8b Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Wed, 17 Nov 2021 11:38:59 -0800 Subject: [PATCH] Move FabricTable class out of transport layer --- examples/common/pigweed/rpc_services/Device.h | 2 +- .../ota-requestor-common/ExampleOTARequestor.h | 2 +- .../operational-credentials-server.cpp | 2 +- src/app/server/Dnssd.cpp | 2 +- src/app/server/Server.h | 2 +- src/controller/CHIPDeviceController.h | 2 +- src/controller/CHIPDeviceControllerSystemState.h | 2 +- src/credentials/BUILD.gn | 2 ++ src/{transport => credentials}/FabricTable.cpp | 3 ++- src/{transport => credentials}/FabricTable.h | 0 src/credentials/tests/BUILD.gn | 1 + src/{transport => credentials}/tests/TestFabricTable.cpp | 2 +- src/protocols/secure_channel/CASESession.h | 2 +- src/transport/BUILD.gn | 2 -- src/transport/tests/BUILD.gn | 1 - 15 files changed, 14 insertions(+), 13 deletions(-) rename src/{transport => credentials}/FabricTable.cpp (99%) rename src/{transport => credentials}/FabricTable.h (100%) rename src/{transport => credentials}/tests/TestFabricTable.cpp (99%) diff --git a/examples/common/pigweed/rpc_services/Device.h b/examples/common/pigweed/rpc_services/Device.h index 81b719e63b60e8..6a92c0454df645 100644 --- a/examples/common/pigweed/rpc_services/Device.h +++ b/examples/common/pigweed/rpc_services/Device.h @@ -21,10 +21,10 @@ #include #include "app/server/Server.h" +#include "credentials/FabricTable.h" #include "device_service/device_service.rpc.pb.h" #include "platform/ConfigurationManager.h" #include "platform/PlatformManager.h" -#include "transport/FabricTable.h" namespace chip { namespace rpc { diff --git a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h index 9e1675e40be0e1..6348c56b6aa88f 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h +++ b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include // An example implementation for how an application might handle receiving an AnnounceOTAProvider command. In this case, the // AnnounceOTAProvider command will be used as a trigger to send a QueryImage command and begin the OTA process. This class also diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp index 633353b6ee7bd0..2575148ede0cb2 100644 --- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,6 @@ #include #include #include -#include using namespace chip; using namespace ::chip::DeviceLayer; diff --git a/src/app/server/Dnssd.cpp b/src/app/server/Dnssd.cpp index aa39e8d9d8d0e8..76f236847527ed 100644 --- a/src/app/server/Dnssd.cpp +++ b/src/app/server/Dnssd.cpp @@ -32,8 +32,8 @@ #if CHIP_ENABLE_ROTATING_DEVICE_ID #include #endif +#include #include -#include #include diff --git a/src/app/server/Server.h b/src/app/server/Server.h index 5ca187010f5746..a4fedca91fd440 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 29215884e7f3dc..7cfced16dcce6b 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/src/controller/CHIPDeviceControllerSystemState.h b/src/controller/CHIPDeviceControllerSystemState.h index 5d0ab170d28ece..02862ab816ebea 100644 --- a/src/controller/CHIPDeviceControllerSystemState.h +++ b/src/controller/CHIPDeviceControllerSystemState.h @@ -30,8 +30,8 @@ #pragma once #include +#include #include -#include #include #include #if CONFIG_DEVICE_LAYER diff --git a/src/credentials/BUILD.gn b/src/credentials/BUILD.gn index c4790e9f3d0235..7083984f89bb12 100644 --- a/src/credentials/BUILD.gn +++ b/src/credentials/BUILD.gn @@ -32,6 +32,8 @@ static_library("credentials") { "DeviceAttestationVendorReserved.h", "DeviceAttestationVerifier.cpp", "DeviceAttestationVerifier.h", + "FabricTable.cpp", + "FabricTable.h", "GenerateChipX509Cert.cpp", "GroupDataProvider.h", "examples/DeviceAttestationCredsExample.cpp", diff --git a/src/transport/FabricTable.cpp b/src/credentials/FabricTable.cpp similarity index 99% rename from src/transport/FabricTable.cpp rename to src/credentials/FabricTable.cpp index 5987c326b5dd8b..37a4c8ccb66f8d 100644 --- a/src/transport/FabricTable.cpp +++ b/src/credentials/FabricTable.cpp @@ -19,11 +19,12 @@ * @brief Defines a table of fabrics that have provisioned the device. */ +#include "FabricTable.h" + #include #include #include #include -#include #if CHIP_CRYPTO_HSM #include #endif diff --git a/src/transport/FabricTable.h b/src/credentials/FabricTable.h similarity index 100% rename from src/transport/FabricTable.h rename to src/credentials/FabricTable.h diff --git a/src/credentials/tests/BUILD.gn b/src/credentials/tests/BUILD.gn index 99a77f05ec01a3..4e84039a76ea36 100644 --- a/src/credentials/tests/BUILD.gn +++ b/src/credentials/tests/BUILD.gn @@ -41,6 +41,7 @@ chip_test_suite("tests") { "TestChipCert.cpp", "TestDeviceAttestationConstruction.cpp", "TestDeviceAttestationCredentials.cpp", + "TestFabricTable.cpp", "TestGroupDataProvider.cpp", ] diff --git a/src/transport/tests/TestFabricTable.cpp b/src/credentials/tests/TestFabricTable.cpp similarity index 99% rename from src/transport/tests/TestFabricTable.cpp rename to src/credentials/tests/TestFabricTable.cpp index 3c31d01ca169e9..2972171475007e 100644 --- a/src/transport/tests/TestFabricTable.cpp +++ b/src/credentials/tests/TestFabricTable.cpp @@ -26,7 +26,7 @@ #include -#include +#include #include #include diff --git a/src/protocols/secure_channel/CASESession.h b/src/protocols/secure_channel/CASESession.h index 012cae3b4b8092..a8bbadd3cf1b75 100644 --- a/src/protocols/secure_channel/CASESession.h +++ b/src/protocols/secure_channel/CASESession.h @@ -30,6 +30,7 @@ #if CHIP_CRYPTO_HSM #include #endif +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/src/transport/BUILD.gn b/src/transport/BUILD.gn index e85742aff382a4..7516067eb7c9eb 100644 --- a/src/transport/BUILD.gn +++ b/src/transport/BUILD.gn @@ -22,8 +22,6 @@ static_library("transport") { sources = [ "CryptoContext.cpp", "CryptoContext.h", - "FabricTable.cpp", - "FabricTable.h", "MessageCounter.cpp", "MessageCounter.h", "MessageCounterManagerInterface.h", diff --git a/src/transport/tests/BUILD.gn b/src/transport/tests/BUILD.gn index 6c2c28fb67a5a1..aa7a40160d7020 100644 --- a/src/transport/tests/BUILD.gn +++ b/src/transport/tests/BUILD.gn @@ -23,7 +23,6 @@ chip_test_suite("tests") { output_name = "libTransportLayerTests" test_sources = [ - "TestFabricTable.cpp", "TestPeerConnections.cpp", "TestSecureSession.cpp", "TestSessionHandle.cpp",