Skip to content

Commit

Permalink
Remove all dead config options from SDK
Browse files Browse the repository at this point in the history
- All `CHIP_CONFIG_*` that came from OpenWeave and had no current usage
  outside CHIPProjectConfig.h or were always disabled in common code for
  > 1 year and have obviously no use anymore, were removed.

Fixes project-chip#17118
  • Loading branch information
tcarmelveilleux committed Apr 6, 2022
1 parent fc1eae7 commit 1f7176e
Show file tree
Hide file tree
Showing 76 changed files with 189 additions and 1,499 deletions.
3 changes: 0 additions & 3 deletions config/android/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

// Enable use of an ephemeral UDP source port for locally initiated CHIP exchanges.
#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

// Enable UDP listening on demand in the CHIPDeviceController
#define CHIP_CONFIG_DEVICE_CONTROLLER_DEMAND_ENABLE_UDP 1

Expand Down
3 changes: 0 additions & 3 deletions config/ios/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

// Enable use of an ephemeral UDP source port for locally initiated CHIP exchanges.
#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

// Enable UDP listening on demand in the CHIPDeviceController
#define CHIP_CONFIG_DEVICE_CONTROLLER_DEMAND_ENABLE_UDP 1

Expand Down
3 changes: 0 additions & 3 deletions config/python/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1
Expand All @@ -51,7 +49,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#define CHIP_CONFIG_ENABLE_UPDATE 1

Expand Down
3 changes: 0 additions & 3 deletions config/standalone/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#ifndef CHIPPROJECTCONFIG_H
#define CHIPPROJECTCONFIG_H

#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1
Expand Down Expand Up @@ -57,7 +55,6 @@
// To build with this flag, pass 'treat_warnings_as_errors=false' to gn/ninja.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#define CHIP_CONFIG_ENABLE_UPDATE 1

Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
Expand Down
3 changes: 0 additions & 3 deletions examples/chip-tool/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#define CHIP_CONFIG_MAX_FABRICS 17

#define CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT 1

#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2

#define CHIP_CONFIG_EVENT_LOGGING_EXTERNAL_EVENT_SUPPORT 1
Expand All @@ -53,7 +51,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#define CHIP_CONFIG_ENABLE_UPDATE 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
17 changes: 0 additions & 17 deletions examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default setup PIN code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down Expand Up @@ -109,22 +108,6 @@
*/
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1

/**
* CHIP_CONFIG_MAX_BINDINGS
*
* Maximum number of simultaneously active bindings per ChipExchangeManager
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
* in the worst case. Keeping another 4 as buffer.
*/
#define CHIP_CONFIG_MAX_BINDINGS 8

/**
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
*
* Select the ability to offload event logs to any interested subscribers using WDM.
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT
*
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
17 changes: 0 additions & 17 deletions examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default setup PIN code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down Expand Up @@ -109,22 +108,6 @@
*/
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1

/**
* CHIP_CONFIG_MAX_BINDINGS
*
* Maximum number of simultaneously active bindings per ChipExchangeManager
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
* in the worst case. Keeping another 4 as buffer.
*/
#define CHIP_CONFIG_MAX_BINDINGS 8

/**
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
*
* Select the ability to offload event logs to any interested subscribers using WDM.
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT
*
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION
Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/ota-requestor-app/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

// Security and Authentication enabled for release build.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#else // development build

Expand All @@ -42,7 +41,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/persistent-storage/p6/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/pigweed-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

// Security and Authentication always enabled
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#if BUILD_RELEASE // release build
// Note: Default Pairing/PIN/Serial Numbers being used. These should not be enabled for production builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

// Security and Authentication always enabled
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

#if BUILD_RELEASE // release build
// Note: Default Pairing/PIN/Serial Numbers being used. These should not be enabled for production builds
Expand Down
1 change: 0 additions & 1 deletion examples/shell/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
17 changes: 0 additions & 17 deletions examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
// WARNING: These options make it possible to circumvent basic CHIP security functionality,
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 0

// Use a default setup PIN code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
Expand Down Expand Up @@ -109,22 +108,6 @@
*/
//#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 1

/**
* CHIP_CONFIG_MAX_BINDINGS
*
* Maximum number of simultaneously active bindings per ChipExchangeManager
* 1 (Time Sync) + 2 (Two 1-way subscriptions) + 1 (Software Update) = 4
* in the worst case. Keeping another 4 as buffer.
*/
#define CHIP_CONFIG_MAX_BINDINGS 8

/**
* CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD
*
* Select the ability to offload event logs to any interested subscribers using WDM.
*/
#define CHIP_CONFIG_EVENT_LOGGING_WDM_OFFLOAD 1

/**
* @def CHIP_CONFIG_ENABLE_SERVER_IM_EVENT
*
Expand Down
1 change: 0 additions & 1 deletion examples/shell/qpg/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
1 change: 0 additions & 1 deletion examples/window-app/efr32/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS.
//
#define CHIP_CONFIG_SECURITY_TEST_MODE 0
#define CHIP_CONFIG_REQUIRE_AUTH 1

/**
* CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID
Expand Down
21 changes: 1 addition & 20 deletions src/app/CASESessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ CHIP_ERROR CASESessionManager::FindOrEstablishSession(PeerId peerId, Callback::C
{
Dnssd::ResolvedNodeData resolutionData;

bool nodeIDWasResolved =
#if CHIP_CONFIG_MDNS_CACHE_SIZE > 0
(mConfig.dnsCache != nullptr && mConfig.dnsCache->Lookup(peerId, resolutionData) == CHIP_NO_ERROR);
#else
false;
#endif
bool nodeIDWasResolved = false;

ChipLogDetail(CASESessionManager,
"FindOrEstablishSession: PeerId = " ChipLogFormatX64 ":" ChipLogFormatX64 ", NodeIdWasResolved = %d",
Expand Down Expand Up @@ -97,20 +92,6 @@ void CASESessionManager::ReleaseAllSessions()

CHIP_ERROR CASESessionManager::GetPeerAddress(PeerId peerId, Transport::PeerAddress & addr)
{
#if CHIP_CONFIG_MDNS_CACHE_SIZE > 0
if (mConfig.dnsCache != nullptr)
{
Dnssd::ResolvedNodeData resolutionData;
// TODO(andy31415): DNS caching is generally not populated, need to move
// caching into a the address resolve layer and not have a global one anymore.
if (mConfig.dnsCache->Lookup(peerId, resolutionData) == CHIP_NO_ERROR)
{
addr = OperationalDeviceProxy::ToPeerAddress(resolutionData);
return CHIP_NO_ERROR;
}
}
#endif

OperationalDeviceProxy * session = FindExistingSession(peerId);
VerifyOrReturnError(session != nullptr, CHIP_ERROR_NOT_CONNECTED);
addr = session->GetPeerAddress();
Expand Down
3 changes: 0 additions & 3 deletions src/app/CASESessionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ namespace chip {
struct CASESessionManagerConfig
{
DeviceProxyInitParams sessionInitParams;
#if CHIP_CONFIG_MDNS_CACHE_SIZE > 0
Dnssd::DnssdCache<CHIP_CONFIG_MDNS_CACHE_SIZE> * dnsCache = nullptr;
#endif
OperationalDeviceProxyPoolDelegate * devicePool = nullptr;
};

Expand Down
3 changes: 0 additions & 3 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
.clientPool = &mCASEClientPool,
.groupDataProvider = mGroupsProvider,
},
#if CHIP_CONFIG_MDNS_CACHE_SIZE > 0
.dnsCache = nullptr,
#endif
.devicePool = &mDevicePool,
};

Expand Down
Loading

0 comments on commit 1f7176e

Please sign in to comment.