[ICD] Move ICD server sources to the server directory (#31674)

* Move ICD server files to server directory

* update all the icd paths

* update examples paths

* restyle

* cmake icd path

* fix src/app path

* update comment path

* fix icd_config to icd_server_config rename

* Fix ESP builds

* restyle
diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt
index f2f432a..b47def7 100644
--- a/examples/all-clusters-app/esp32/main/CMakeLists.txt
+++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt
@@ -36,7 +36,7 @@
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/mode-support"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
-                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd"
+                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server"
diff --git a/examples/light-switch-app/esp32/main/CMakeLists.txt b/examples/light-switch-app/esp32/main/CMakeLists.txt
index 5bdac22..210cbce 100644
--- a/examples/light-switch-app/esp32/main/CMakeLists.txt
+++ b/examples/light-switch-app/esp32/main/CMakeLists.txt
@@ -31,7 +31,7 @@
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting"
-                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd"
+                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information"
diff --git a/examples/lit-icd-app/linux/BUILD.gn b/examples/lit-icd-app/linux/BUILD.gn
index 6a2a26c..fd8c0df 100644
--- a/examples/lit-icd-app/linux/BUILD.gn
+++ b/examples/lit-icd-app/linux/BUILD.gn
@@ -21,7 +21,7 @@
   deps = [
     "${chip_root}/examples/lit-icd-app/lit-icd-common",
     "${chip_root}/examples/platform/linux:app-main",
-    "${chip_root}/src/app/icd:manager",
+    "${chip_root}/src/app/icd/server:manager",
     "${chip_root}/src/lib",
     "${chip_root}/third_party/jsoncpp",
   ]
diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt
index 7efc567..e726690 100644
--- a/examples/lock-app/esp32/main/CMakeLists.txt
+++ b/examples/lock-app/esp32/main/CMakeLists.txt
@@ -50,7 +50,7 @@
                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting"
-                     "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd"
+                     "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server"
                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server"
                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information"
@@ -163,7 +163,7 @@
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting"
-                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd"
+                      "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd/server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server"
                       "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information"
diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp
index 99acb26..5870de2 100644
--- a/examples/platform/silabs/BaseApplication.cpp
+++ b/examples/platform/silabs/BaseApplication.cpp
@@ -36,7 +36,7 @@
 
 #include "SilabsDeviceDataProvider.h"
 #if CHIP_CONFIG_ENABLE_ICD_SERVER == 1
-#include <app/icd/ICDNotifier.h> // nogncheck
+#include <app/icd/server/ICDNotifier.h> // nogncheck
 #endif
 #include <app/server/OnboardingCodesUtil.h>
 #include <app/util/attribute-storage.h>
diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn
index 4439190..803a866 100644
--- a/src/app/BUILD.gn
+++ b/src/app/BUILD.gn
@@ -254,8 +254,8 @@
     ":message-def",
     ":paths",
     ":subscription-manager",
-    "${chip_root}/src/app/icd:icd_config",
-    "${chip_root}/src/app/icd:observer",
+    "${chip_root}/src/app/icd/server:icd-server-config",
+    "${chip_root}/src/app/icd/server:observer",
     "${chip_root}/src/lib/address_resolve",
     "${chip_root}/src/lib/support",
     "${chip_root}/src/protocols/interaction_model",
@@ -333,7 +333,7 @@
     ":interaction-model",
     ":pre-encoded-value",
     ":revision_info",
-    "${chip_root}/src/app/icd:icd_config",
+    "${chip_root}/src/app/icd/server:icd-server-config",
     "${chip_root}/src/lib/address_resolve",
     "${chip_root}/src/lib/support",
     "${chip_root}/src/messaging",
@@ -353,8 +353,8 @@
 
   if (chip_enable_icd_server) {
     public_deps += [
-      "${chip_root}/src/app/icd:manager",
-      "${chip_root}/src/app/icd:notifier",
+      "${chip_root}/src/app/icd/server:manager",
+      "${chip_root}/src/app/icd/server:notifier",
     ]
   }
 
diff --git a/src/app/FailSafeContext.cpp b/src/app/FailSafeContext.cpp
index 9ecc3dea..699fcb8 100644
--- a/src/app/FailSafeContext.cpp
+++ b/src/app/FailSafeContext.cpp
@@ -20,9 +20,9 @@
  *          Provides the implementation of the FailSafeContext object.
  */
 #include "FailSafeContext.h"
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDNotifier.h> // nogncheck
+#include <app/icd/server/ICDNotifier.h> // nogncheck
 #endif
 #include <lib/support/SafeInt.h>
 #include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp
index c0cfbe4..df8516d 100644
--- a/src/app/ReadHandler.cpp
+++ b/src/app/ReadHandler.cpp
@@ -28,7 +28,7 @@
 #include <app/MessageDef/StatusResponseMessage.h>
 #include <app/MessageDef/SubscribeRequestMessage.h>
 #include <app/MessageDef/SubscribeResponseMessage.h>
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <lib/core/TLVUtilities.h>
 #include <messaging/ExchangeContext.h>
 
@@ -36,7 +36,7 @@
 #include <app/reporting/Engine.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDConfigurationData.h> //nogncheck
+#include <app/icd/server/ICDConfigurationData.h> //nogncheck
 #endif
 
 namespace chip {
diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake
index 0126836..3e1d669 100644
--- a/src/app/chip_data_model.cmake
+++ b/src/app/chip_data_model.cmake
@@ -139,9 +139,9 @@
         ${CHIP_APP_BASE_DIR}/util/attribute-storage.cpp
         ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp
         ${CHIP_APP_BASE_DIR}/util/binding-table.cpp
-        ${CHIP_APP_BASE_DIR}/icd/ICDMonitoringTable.cpp
-        ${CHIP_APP_BASE_DIR}/icd/ICDNotifier.cpp
-        ${CHIP_APP_BASE_DIR}/icd/ICDConfigurationData.cpp
+        ${CHIP_APP_BASE_DIR}/icd/server/ICDMonitoringTable.cpp
+        ${CHIP_APP_BASE_DIR}/icd/server/ICDNotifier.cpp
+        ${CHIP_APP_BASE_DIR}/icd/server/ICDConfigurationData.cpp
         ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp
         ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp
         ${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp
diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni
index d4d4913..aede00f 100644
--- a/src/app/chip_data_model.gni
+++ b/src/app/chip_data_model.gni
@@ -300,10 +300,10 @@
           "${_app_root}/clusters/${cluster}/${cluster}.h",
         ]
         deps += [
-          "${chip_root}/src/app/icd:configuration-data",
-          "${chip_root}/src/app/icd:icd_config",
-          "${chip_root}/src/app/icd:monitoring-table",
-          "${chip_root}/src/app/icd:notifier",
+          "${chip_root}/src/app/icd/server:configuration-data",
+          "${chip_root}/src/app/icd/server:icd-server-config",
+          "${chip_root}/src/app/icd/server:monitoring-table",
+          "${chip_root}/src/app/icd/server:notifier",
         ]
       } else if (cluster == "resource-monitoring-server") {
         sources += [
diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp
index da4bada..e748030 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.cpp
+++ b/src/app/clusters/icd-management-server/icd-management-server.cpp
@@ -23,8 +23,8 @@
 #include <app-common/zap-generated/cluster-objects.h>
 #include <app-common/zap-generated/ids/Clusters.h>
 #include <app/AttributeAccessInterface.h>
-#include <app/icd/ICDMonitoringTable.h>
-#include <app/icd/ICDNotifier.h>
+#include <app/icd/server/ICDMonitoringTable.h>
+#include <app/icd/server/ICDNotifier.h>
 #include <app/server/Server.h>
 #include <app/util/af.h>
 #include <app/util/attribute-storage.h>
diff --git a/src/app/clusters/icd-management-server/icd-management-server.h b/src/app/clusters/icd-management-server/icd-management-server.h
index 0255112..308d508 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.h
+++ b/src/app/clusters/icd-management-server/icd-management-server.h
@@ -20,8 +20,8 @@
 #include <app-common/zap-generated/cluster-objects.h>
 #include <app/CommandHandler.h>
 #include <app/ConcreteAttributePath.h>
-#include <app/icd/ICDConfigurationData.h>
-#include <app/icd/ICDMonitoringTable.h>
+#include <app/icd/server/ICDConfigurationData.h>
+#include <app/icd/server/ICDMonitoringTable.h>
 #include <app/util/basic-types.h>
 #include <crypto/SessionKeystore.h>
 #include <lib/core/CHIPPersistentStorageDelegate.h>
diff --git a/src/app/icd/BUILD.gn b/src/app/icd/server/BUILD.gn
similarity index 86%
rename from src/app/icd/BUILD.gn
rename to src/app/icd/server/BUILD.gn
index f1d3a8a..ee2b2be 100644
--- a/src/app/icd/BUILD.gn
+++ b/src/app/icd/server/BUILD.gn
@@ -14,13 +14,13 @@
 
 import("//build_overrides/chip.gni")
 import("${chip_root}/build/chip/buildconfig_header.gni")
-import("icd.gni")
+import("${chip_root}/src/app/icd/icd.gni")
 
 # ICD Server sources and configurations
 
-buildconfig_header("icd_buildconfig") {
-  header = "ICDBuildConfig.h"
-  header_dir = "app/icd"
+buildconfig_header("icd-server-buildconfig") {
+  header = "ICDServerBuildConfig.h"
+  header_dir = "app/icd/server"
 
   defines = [
     "CHIP_CONFIG_ENABLE_ICD_SERVER=${chip_enable_icd_server}",
@@ -29,13 +29,13 @@
     "ICD_ENFORCE_SIT_SLOW_POLL_LIMIT=${icd_enforce_sit_slow_poll_limit}",
   ]
 
-  visibility = [ ":icd_config" ]
+  visibility = [ ":icd-server-config" ]
 }
 
-source_set("icd_config") {
-  sources = [ "ICDConfig.h" ]
+source_set("icd-server-config") {
+  sources = [ "ICDServerConfig.h" ]
 
-  deps = [ ":icd_buildconfig" ]
+  deps = [ ":icd-server-buildconfig" ]
 }
 
 source_set("observer") {
@@ -49,7 +49,7 @@
   ]
 
   deps = [
-    ":icd_config",
+    ":icd-server-config",
     "${chip_root}/src/lib/core",
   ]
 }
@@ -62,7 +62,7 @@
     "ICDManager.h",
   ]
 
-  deps = [ ":icd_config" ]
+  deps = [ ":icd-server-config" ]
 
   public_deps = [
     ":configuration-data",
@@ -112,7 +112,7 @@
   ]
 
   deps = [
-    ":icd_config",
+    ":icd-server-config",
     "${chip_root}/src/lib/core",
     "${chip_root}/src/lib/support",
   ]
diff --git a/src/app/icd/ICDCheckInSender.cpp b/src/app/icd/server/ICDCheckInSender.cpp
similarity index 97%
rename from src/app/icd/ICDCheckInSender.cpp
rename to src/app/icd/server/ICDCheckInSender.cpp
index 69f4713..21bcc33 100644
--- a/src/app/icd/ICDCheckInSender.cpp
+++ b/src/app/icd/server/ICDCheckInSender.cpp
@@ -15,9 +15,9 @@
  *    limitations under the License.
  */
 
-#include <app/icd/ICDCheckInSender.h>
-#include <app/icd/ICDConfigurationData.h>
-#include <app/icd/ICDNotifier.h>
+#include <app/icd/server/ICDCheckInSender.h>
+#include <app/icd/server/ICDConfigurationData.h>
+#include <app/icd/server/ICDNotifier.h>
 #include <lib/dnssd/Resolver.h>
 #include <protocols/secure_channel/CheckinMessage.h>
 #include <system/SystemPacketBuffer.h>
diff --git a/src/app/icd/ICDCheckInSender.h b/src/app/icd/server/ICDCheckInSender.h
similarity index 97%
rename from src/app/icd/ICDCheckInSender.h
rename to src/app/icd/server/ICDCheckInSender.h
index a9d7919..b681bec 100644
--- a/src/app/icd/ICDCheckInSender.h
+++ b/src/app/icd/server/ICDCheckInSender.h
@@ -16,7 +16,7 @@
  */
 #pragma once
 
-#include <app/icd/ICDMonitoringTable.h>
+#include <app/icd/server/ICDMonitoringTable.h>
 #include <credentials/FabricTable.h>
 #include <lib/address_resolve/AddressResolve.h>
 
diff --git a/src/app/icd/ICDConfigurationData.cpp b/src/app/icd/server/ICDConfigurationData.cpp
similarity index 97%
rename from src/app/icd/ICDConfigurationData.cpp
rename to src/app/icd/server/ICDConfigurationData.cpp
index 9c2079a..e29ec6f 100644
--- a/src/app/icd/ICDConfigurationData.cpp
+++ b/src/app/icd/server/ICDConfigurationData.cpp
@@ -16,7 +16,7 @@
  */
 
 #include "ICDConfigurationData.h"
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <lib/support/CodeUtils.h>
 
 namespace chip {
diff --git a/src/app/icd/ICDConfigurationData.h b/src/app/icd/server/ICDConfigurationData.h
similarity index 98%
rename from src/app/icd/ICDConfigurationData.h
rename to src/app/icd/server/ICDConfigurationData.h
index 2762077..855cbae 100644
--- a/src/app/icd/ICDConfigurationData.h
+++ b/src/app/icd/server/ICDConfigurationData.h
@@ -92,7 +92,7 @@
     // ICD related information is managed by the ICDManager but stored in the ICDConfigurationData to enable consummers to access it
     // without creating a circular dependency. To avoid allowing consummers changing the state of the ICD mode without going through
     // the ICDManager, the ICDManager is a friend that can access the private setters. If a consummer needs to be notified when a
-    // value is changed, they can leverage the Observer events the ICDManager generates. See src/app/icd/ICDStateObserver.h
+    // value is changed, they can leverage the Observer events the ICDManager generates. See src/app/icd/server/ICDStateObserver.h
     friend class chip::app::ICDManager;
     friend class chip::app::TestICDManager;
 
diff --git a/src/app/icd/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp
similarity index 98%
rename from src/app/icd/ICDManager.cpp
rename to src/app/icd/server/ICDManager.cpp
index f6c1fe5..08aee64 100644
--- a/src/app/icd/ICDManager.cpp
+++ b/src/app/icd/server/ICDManager.cpp
@@ -18,10 +18,10 @@
 #include <app-common/zap-generated/attributes/Accessors.h>
 #include <app-common/zap-generated/ids/Attributes.h>
 #include <app-common/zap-generated/ids/Clusters.h>
-#include <app/icd/ICDConfig.h>
-#include <app/icd/ICDConfigurationData.h>
-#include <app/icd/ICDManager.h>
-#include <app/icd/ICDMonitoringTable.h>
+#include <app/icd/server/ICDConfigurationData.h>
+#include <app/icd/server/ICDManager.h>
+#include <app/icd/server/ICDMonitoringTable.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <lib/support/CodeUtils.h>
 #include <lib/support/logging/CHIPLogging.h>
 #include <platform/ConnectivityManager.h>
diff --git a/src/app/icd/ICDManager.h b/src/app/icd/server/ICDManager.h
similarity index 96%
rename from src/app/icd/ICDManager.h
rename to src/app/icd/server/ICDManager.h
index 4299423..e5cec3e 100644
--- a/src/app/icd/ICDManager.h
+++ b/src/app/icd/server/ICDManager.h
@@ -18,11 +18,11 @@
 
 #include <app-common/zap-generated/cluster-enums.h>
 #include <app/SubscriptionManager.h>
-#include <app/icd/ICDCheckInSender.h>
-#include <app/icd/ICDConfigurationData.h>
-#include <app/icd/ICDMonitoringTable.h>
-#include <app/icd/ICDNotifier.h>
-#include <app/icd/ICDStateObserver.h>
+#include <app/icd/server/ICDCheckInSender.h>
+#include <app/icd/server/ICDConfigurationData.h>
+#include <app/icd/server/ICDMonitoringTable.h>
+#include <app/icd/server/ICDNotifier.h>
+#include <app/icd/server/ICDStateObserver.h>
 #include <credentials/FabricTable.h>
 #include <lib/support/BitFlags.h>
 #include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/icd/ICDMonitoringTable.cpp b/src/app/icd/server/ICDMonitoringTable.cpp
similarity index 100%
rename from src/app/icd/ICDMonitoringTable.cpp
rename to src/app/icd/server/ICDMonitoringTable.cpp
diff --git a/src/app/icd/ICDMonitoringTable.h b/src/app/icd/server/ICDMonitoringTable.h
similarity index 100%
rename from src/app/icd/ICDMonitoringTable.h
rename to src/app/icd/server/ICDMonitoringTable.h
diff --git a/src/app/icd/ICDNotifier.cpp b/src/app/icd/server/ICDNotifier.cpp
similarity index 98%
rename from src/app/icd/ICDNotifier.cpp
rename to src/app/icd/server/ICDNotifier.cpp
index 8266c2a..4df2379 100644
--- a/src/app/icd/ICDNotifier.cpp
+++ b/src/app/icd/server/ICDNotifier.cpp
@@ -15,7 +15,7 @@
  *    limitations under the License.
  */
 
-#include <app/icd/ICDNotifier.h>
+#include <app/icd/server/ICDNotifier.h>
 #include <cstdint>
 #include <cstring>
 
diff --git a/src/app/icd/ICDNotifier.h b/src/app/icd/server/ICDNotifier.h
similarity index 98%
rename from src/app/icd/ICDNotifier.h
rename to src/app/icd/server/ICDNotifier.h
index bde16ff..1223732 100644
--- a/src/app/icd/ICDNotifier.h
+++ b/src/app/icd/server/ICDNotifier.h
@@ -16,7 +16,7 @@
  */
 #pragma once
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <lib/core/CHIPError.h>
 #include <lib/support/BitFlags.h>
 
diff --git a/src/app/icd/ICDConfig.h b/src/app/icd/server/ICDServerConfig.h
similarity index 92%
rename from src/app/icd/ICDConfig.h
rename to src/app/icd/server/ICDServerConfig.h
index 4c85d39..aca74da 100644
--- a/src/app/icd/ICDConfig.h
+++ b/src/app/icd/server/ICDServerConfig.h
@@ -18,5 +18,5 @@
 #pragma once
 
 #if CHIP_HAVE_CONFIG_H
-#include <app/icd/ICDBuildConfig.h>
+#include <app/icd/server/ICDServerBuildConfig.h>
 #endif
diff --git a/src/app/icd/ICDStateObserver.h b/src/app/icd/server/ICDStateObserver.h
similarity index 100%
rename from src/app/icd/ICDStateObserver.h
rename to src/app/icd/server/ICDStateObserver.h
diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp
index f230e30..2530ec7 100644
--- a/src/app/reporting/Engine.cpp
+++ b/src/app/reporting/Engine.cpp
@@ -23,9 +23,9 @@
  *
  */
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDNotifier.h> // nogncheck
+#include <app/icd/server/ICDNotifier.h> // nogncheck
 #endif
 #include <app/AppConfig.h>
 #include <app/InteractionModelEngine.h>
diff --git a/src/app/reporting/ReportScheduler.h b/src/app/reporting/ReportScheduler.h
index d823c2f..622a10a 100644
--- a/src/app/reporting/ReportScheduler.h
+++ b/src/app/reporting/ReportScheduler.h
@@ -19,7 +19,7 @@
 #pragma once
 
 #include <app/ReadHandler.h>
-#include <app/icd/ICDStateObserver.h>
+#include <app/icd/server/ICDStateObserver.h>
 #include <lib/core/CHIPError.h>
 #include <system/SystemClock.h>
 
diff --git a/src/app/server/BUILD.gn b/src/app/server/BUILD.gn
index 60f88cf..690da23 100644
--- a/src/app/server/BUILD.gn
+++ b/src/app/server/BUILD.gn
@@ -51,8 +51,8 @@
 
   public_deps = [
     "${chip_root}/src/app",
-    "${chip_root}/src/app/icd:icd_config",
-    "${chip_root}/src/app/icd:observer",
+    "${chip_root}/src/app/icd/server:icd-server-config",
+    "${chip_root}/src/app/icd/server:observer",
     "${chip_root}/src/lib/address_resolve",
     "${chip_root}/src/lib/dnssd",
     "${chip_root}/src/messaging",
@@ -63,6 +63,6 @@
   ]
 
   if (chip_enable_icd_server) {
-    public_deps += [ "${chip_root}/src/app/icd:notifier" ]
+    public_deps += [ "${chip_root}/src/app/icd/server:notifier" ]
   }
 }
diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp
index 8e37d0a..01509a4 100644
--- a/src/app/server/CommissioningWindowManager.cpp
+++ b/src/app/server/CommissioningWindowManager.cpp
@@ -15,10 +15,10 @@
  *    limitations under the License.
  */
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <app/server/CommissioningWindowManager.h>
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDNotifier.h> // nogncheck
+#include <app/icd/server/ICDNotifier.h> // nogncheck
 #endif
 #include <app/reporting/reporting.h>
 #include <app/server/Dnssd.h>
diff --git a/src/app/server/Dnssd.h b/src/app/server/Dnssd.h
index 6a9af18..559cac6 100644
--- a/src/app/server/Dnssd.h
+++ b/src/app/server/Dnssd.h
@@ -17,11 +17,11 @@
 
 #pragma once
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDManager.h> // nogncheck
+#include <app/icd/server/ICDManager.h> // nogncheck
 #endif
-#include <app/icd/ICDStateObserver.h>
+#include <app/icd/server/ICDStateObserver.h>
 #include <app/server/CommissioningModeProvider.h>
 #include <credentials/FabricTable.h>
 #include <lib/core/CHIPError.h>
diff --git a/src/app/server/Server.h b/src/app/server/Server.h
index e574b52..5e51254 100644
--- a/src/app/server/Server.h
+++ b/src/app/server/Server.h
@@ -18,7 +18,7 @@
 #pragma once
 
 #include <app/AppConfig.h>
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 
 #include <access/AccessControl.h>
 #include <access/examples/ExampleAccessControlDelegate.h>
@@ -70,7 +70,7 @@
 #include <transport/raw/UDP.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDManager.h> // nogncheck
+#include <app/icd/server/ICDManager.h> // nogncheck
 #endif
 
 namespace chip {
diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn
index 520fb3a..88311e2 100644
--- a/src/app/tests/BUILD.gn
+++ b/src/app/tests/BUILD.gn
@@ -207,8 +207,8 @@
     ":time-sync-data-provider-test-srcs",
     "${chip_root}/src/app",
     "${chip_root}/src/app/common:cluster-objects",
-    "${chip_root}/src/app/icd:manager",
     "${chip_root}/src/app/icd/client:manager",
+    "${chip_root}/src/app/icd/server:manager",
     "${chip_root}/src/app/tests:helpers",
     "${chip_root}/src/app/util/mock:mock_ember",
     "${chip_root}/src/lib/core",
diff --git a/src/app/tests/TestICDManager.cpp b/src/app/tests/TestICDManager.cpp
index 06669b4..bcd7423 100644
--- a/src/app/tests/TestICDManager.cpp
+++ b/src/app/tests/TestICDManager.cpp
@@ -17,10 +17,10 @@
  */
 #include <app/EventManagement.h>
 #include <app/SubscriptionManager.h>
-#include <app/icd/ICDConfigurationData.h>
-#include <app/icd/ICDManager.h>
-#include <app/icd/ICDNotifier.h>
-#include <app/icd/ICDStateObserver.h>
+#include <app/icd/server/ICDConfigurationData.h>
+#include <app/icd/server/ICDManager.h>
+#include <app/icd/server/ICDNotifier.h>
+#include <app/icd/server/ICDStateObserver.h>
 #include <app/tests/AppTestContext.h>
 #include <lib/core/DataModelTypes.h>
 #include <lib/core/NodeId.h>
diff --git a/src/app/tests/TestICDMonitoringTable.cpp b/src/app/tests/TestICDMonitoringTable.cpp
index 1a6460e..f5de7ed 100644
--- a/src/app/tests/TestICDMonitoringTable.cpp
+++ b/src/app/tests/TestICDMonitoringTable.cpp
@@ -15,7 +15,7 @@
  *    limitations under the License.
  */
 
-#include <app/icd/ICDMonitoringTable.h>
+#include <app/icd/server/ICDMonitoringTable.h>
 #include <crypto/CHIPCryptoPAL.h>
 #include <lib/core/CHIPError.h>
 #include <lib/support/DefaultStorageKeyAllocator.h>
diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h
index 70f9d48..ed881f7 100644
--- a/src/include/platform/ConnectivityManager.h
+++ b/src/include/platform/ConnectivityManager.h
@@ -25,7 +25,7 @@
 #include <memory>
 
 #include <app/AttributeAccessInterface.h>
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <inet/UDPEndPoint.h>
 #include <lib/support/CodeUtils.h>
 #include <platform/CHIPDeviceConfig.h>
diff --git a/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp b/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp
index a77abeb..b3b1f8e 100644
--- a/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp
+++ b/src/lib/dnssd/Advertiser_ImplMinimalMdns.cpp
@@ -23,7 +23,7 @@
 #include "MinimalMdnsServer.h"
 #include "ServiceNaming.h"
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <crypto/RandUtils.h>
 #include <lib/dnssd/Advertiser_ImplMinimalMdnsAllocator.h>
 #include <lib/dnssd/minimal_mdns/AddressPolicy.h>
diff --git a/src/lib/dnssd/BUILD.gn b/src/lib/dnssd/BUILD.gn
index cb8fb44..295be7d 100644
--- a/src/lib/dnssd/BUILD.gn
+++ b/src/lib/dnssd/BUILD.gn
@@ -23,7 +23,7 @@
 static_library("dnssd") {
   public_deps = [
     ":platform_header",
-    "${chip_root}/src/app/icd:icd_config",
+    "${chip_root}/src/app/icd/server:icd-server-config",
     "${chip_root}/src/crypto",
     "${chip_root}/src/lib/core",
     "${chip_root}/src/lib/support",
diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp
index 240bb97..8b1bbbf 100644
--- a/src/lib/dnssd/Discovery_ImplPlatform.cpp
+++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp
@@ -19,7 +19,7 @@
 
 #include <inttypes.h>
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <crypto/RandUtils.h>
 #include <lib/core/CHIPConfig.h>
 #include <lib/core/CHIPSafeCasts.h>
diff --git a/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp b/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp
index c265d18..aa6fcf0 100644
--- a/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp
+++ b/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp
@@ -14,7 +14,7 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #include <lib/dnssd/Advertiser.h>
 
 #include <string>
diff --git a/src/messaging/BUILD.gn b/src/messaging/BUILD.gn
index 4c8ba1b..7d402e7 100644
--- a/src/messaging/BUILD.gn
+++ b/src/messaging/BUILD.gn
@@ -67,7 +67,7 @@
 
   public_deps = [
     ":messaging_mrp_config",
-    "${chip_root}/src/app/icd:icd_config",
+    "${chip_root}/src/app/icd/server:icd-server-config",
     "${chip_root}/src/crypto",
     "${chip_root}/src/inet",
     "${chip_root}/src/lib/core",
@@ -80,8 +80,8 @@
 
   if (chip_enable_icd_server) {
     public_deps += [
-      "${chip_root}/src/app/icd:configuration-data",
-      "${chip_root}/src/app/icd:notifier",
+      "${chip_root}/src/app/icd/server:configuration-data",
+      "${chip_root}/src/app/icd/server:notifier",
     ]
   }
 }
diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp
index af3b87c..15522eb 100644
--- a/src/messaging/ExchangeContext.cpp
+++ b/src/messaging/ExchangeContext.cpp
@@ -32,9 +32,9 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#include <app/icd/ICDConfig.h>
+#include <app/icd/server/ICDServerConfig.h>
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDNotifier.h> // nogncheck
+#include <app/icd/server/ICDNotifier.h> // nogncheck
 #endif
 #include <lib/core/CHIPCore.h>
 #include <lib/core/CHIPEncoding.h>
diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp
index d4e2457..2db80c5 100644
--- a/src/messaging/ReliableMessageMgr.cpp
+++ b/src/messaging/ReliableMessageMgr.cpp
@@ -37,8 +37,8 @@
 #include <platform/ConnectivityManager.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDConfigurationData.h> // nogncheck
-#include <app/icd/ICDNotifier.h>          // nogncheck
+#include <app/icd/server/ICDConfigurationData.h> // nogncheck
+#include <app/icd/server/ICDNotifier.h>          // nogncheck
 #endif
 
 using namespace chip::System::Clock::Literals;
diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp
index 46d4b4b..67e1997 100644
--- a/src/messaging/ReliableMessageProtocolConfig.cpp
+++ b/src/messaging/ReliableMessageProtocolConfig.cpp
@@ -30,7 +30,7 @@
 #include <platform/CHIPDeviceConfig.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDConfigurationData.h> // nogncheck
+#include <app/icd/server/ICDConfigurationData.h> // nogncheck
 #endif
 
 namespace chip {
diff --git a/src/messaging/tests/BUILD.gn b/src/messaging/tests/BUILD.gn
index db09de5..d2d3ebb 100644
--- a/src/messaging/tests/BUILD.gn
+++ b/src/messaging/tests/BUILD.gn
@@ -83,6 +83,6 @@
   ]
 
   if (chip_enable_icd_server) {
-    public_deps += [ "${chip_root}/src/app/icd:configuration-data" ]
+    public_deps += [ "${chip_root}/src/app/icd/server:configuration-data" ]
   }
 }
diff --git a/src/messaging/tests/TestAbortExchangesForFabric.cpp b/src/messaging/tests/TestAbortExchangesForFabric.cpp
index 4c2d682..455462b 100644
--- a/src/messaging/tests/TestAbortExchangesForFabric.cpp
+++ b/src/messaging/tests/TestAbortExchangesForFabric.cpp
@@ -33,7 +33,7 @@
 #include <transport/SessionManager.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDConfigurationData.h> // nogncheck
+#include <app/icd/server/ICDConfigurationData.h> // nogncheck
 #endif
 
 namespace {
diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp
index db5dc14..cfdd00b 100644
--- a/src/messaging/tests/TestReliableMessageProtocol.cpp
+++ b/src/messaging/tests/TestReliableMessageProtocol.cpp
@@ -46,7 +46,7 @@
 #include <messaging/tests/MessagingContext.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDConfigurationData.h> // nogncheck
+#include <app/icd/server/ICDConfigurationData.h> // nogncheck
 #endif
 
 namespace {
diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn
index f8dcd3b..1a86fab 100644
--- a/src/platform/BUILD.gn
+++ b/src/platform/BUILD.gn
@@ -516,7 +516,7 @@
       ":platform_base",
       "${chip_root}/src/app:app_config",
       "${chip_root}/src/app/common:cluster-objects",
-      "${chip_root}/src/app/icd:icd_config",
+      "${chip_root}/src/app/icd/server:icd-server-config",
       "${chip_root}/src/credentials:build_time_header",
       "${chip_root}/src/crypto",
       "${chip_root}/src/lib/support",
diff --git a/src/protocols/secure_channel/tests/BUILD.gn b/src/protocols/secure_channel/tests/BUILD.gn
index de3984a..fe3cafe 100644
--- a/src/protocols/secure_channel/tests/BUILD.gn
+++ b/src/protocols/secure_channel/tests/BUILD.gn
@@ -24,7 +24,7 @@
   sources = [ "CheckIn_Message_test_vectors.h" ]
 
   public_deps = [
-    "${chip_root}/src/app/icd:icd_config",
+    "${chip_root}/src/app/icd/server:icd-server-config",
     "${chip_root}/src/credentials/tests:cert_test_vectors",
     "${chip_root}/src/crypto/tests:tests.lib",
     "${chip_root}/src/lib/core",
@@ -42,6 +42,6 @@
   cflags = [ "-Wconversion" ]
 
   if (chip_enable_icd_server) {
-    public_deps += [ "${chip_root}/src/app/icd:configuration-data" ]
+    public_deps += [ "${chip_root}/src/app/icd/server:configuration-data" ]
   }
 }
diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp
index 01e987d..f94ebb0 100644
--- a/src/protocols/secure_channel/tests/TestPASESession.cpp
+++ b/src/protocols/secure_channel/tests/TestPASESession.cpp
@@ -36,7 +36,7 @@
 #include <stdarg.h>
 
 #if CHIP_CONFIG_ENABLE_ICD_SERVER
-#include <app/icd/ICDConfigurationData.h> // nogncheck
+#include <app/icd/server/ICDConfigurationData.h> // nogncheck
 #endif
 
 // This test suite pushes multiple PASESession objects onto the stack for the