diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index f432dc48c4ec52..ce0bbf50cc802e 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -90,7 +90,6 @@ static_library("inet") { "InetLayer.h", "InetLayerBasis.h", "InetLayerEvents.h", - "InetUtils.cpp", "arpa-inet-compatibility.h", ] diff --git a/src/inet/EndPointBasis.cpp b/src/inet/EndPointBasis.cpp index 68bbb72446ef67..63b233b5e849f5 100644 --- a/src/inet/EndPointBasis.cpp +++ b/src/inet/EndPointBasis.cpp @@ -35,18 +35,18 @@ void EndPointBasis::InitEndPointBasis(InetLayer & aInetLayer, void * aAppState) InitInetLayerBasis(aInetLayer, aAppState); #if CHIP_SYSTEM_CONFIG_USE_LWIP - mLwIPEndPointType = kLwIPEndPointType_Unknown; + mLwIPEndPointType = LwIPEndPointType::Unknown; #endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS - mSocket = INET_INVALID_SOCKET_FD; + mSocket = kInvalidSocketFd; #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS } #if CHIP_SYSTEM_CONFIG_USE_LWIP -void EndPointBasis::DeferredFree(chip::System::Object::ReleaseDeferralErrorTactic aTactic) +void EndPointBasis::DeferredFree(System::Object::ReleaseDeferralErrorTactic aTactic) { - if (!CHIP_SYSTEM_CONFIG_USE_SOCKETS || IsLWIPEndPoint()) + if (!CHIP_SYSTEM_CONFIG_USE_SOCKETS || (mVoid != nullptr)) { DeferredRelease(static_cast(Layer().SystemLayer()), aTactic); } diff --git a/src/inet/EndPointBasis.h b/src/inet/EndPointBasis.h index 31ed82ca41d2d9..f34db99496d996 100644 --- a/src/inet/EndPointBasis.h +++ b/src/inet/EndPointBasis.h @@ -26,11 +26,8 @@ #include -#include "inet/IANAConstants.h" -#include "inet/InetLayerBasis.h" -#include -#include -#include +#include +#include #include @@ -42,58 +39,29 @@ #include #endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK -//--- Declaration of LWIP protocol control buffer structure names #if CHIP_SYSTEM_CONFIG_USE_LWIP -#if INET_CONFIG_ENABLE_UDP_ENDPOINT struct udp_pcb; -#endif // INET_CONFIG_ENABLE_UDP_ENDPOINT -#if INET_CONFIG_ENABLE_TCP_ENDPOINT struct tcp_pcb; -#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT #endif // CHIP_SYSTEM_CONFIG_USE_LWIP namespace chip { namespace Inet { /** - * @class EndPointBasis - * - * @brief Basis of internet transport endpoint classes + * Basis of internet transport endpoint classes. */ class DLL_EXPORT EndPointBasis : public InetLayerBasis { -public: - /** Common state codes */ - enum - { - kBasisState_Closed = 0 /**< Encapsulated descriptor is not valid. */ - }; - -#if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK - /** Test whether endpoint is a Network.framework endpoint */ - bool IsNetworkFrameworkEndPoint(void) const; -#endif - -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS - /** Test whether endpoint is a POSIX socket */ - bool IsSocketsEndPoint() const; -#endif - -#if CHIP_SYSTEM_CONFIG_USE_LWIP - /** Test whether endpoint is a LwIP protocol control buffer */ - bool IsLWIPEndPoint(void) const; -#endif - - /** Test whether endpoint has a valid descriptor. */ - bool IsOpenEndPoint() const; - protected: + void InitEndPointBasis(InetLayer & aInetLayer, void * aAppState = nullptr); + #if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK nw_parameters_t mParameters; IPAddressType mAddrType; /**< Protocol family, i.e. IPv4 or IPv6. */ #endif #if CHIP_SYSTEM_CONFIG_USE_SOCKETS + static constexpr int kInvalidSocketFd = -1; int mSocket; /**< Encapsulated socket descriptor. */ IPAddressType mAddrType; /**< Protocol family, i.e. IPv4 or IPv6. */ System::SocketWatchToken mWatch; /**< Socket event watcher */ @@ -112,63 +80,18 @@ class DLL_EXPORT EndPointBasis : public InetLayerBasis #endif // INET_CONFIG_ENABLE_TCP_ENDPOINT }; - enum + enum class LwIPEndPointType : uint8_t { - kLwIPEndPointType_Unknown = 0, - - kLwIPEndPointType_Raw = 1, - kLwIPEndPointType_UDP = 2, - kLwIPEndPointType_UCP = 3, - kLwIPEndPointType_TCP = 4 - }; - - uint8_t mLwIPEndPointType; - - void DeferredFree(chip::System::Object::ReleaseDeferralErrorTactic aTactic); + Unknown = 0, + Raw = 1, + UDP = 2, + UCP = 3, + TCP = 4 + } mLwIPEndPointType; + + void DeferredFree(System::Object::ReleaseDeferralErrorTactic aTactic); #endif // CHIP_SYSTEM_CONFIG_USE_LWIP - - void InitEndPointBasis(InetLayer & aInetLayer, void * aAppState = nullptr); }; -#if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK -inline bool EndPointBasis::IsNetworkFrameworkEndPoint(void) const -{ - return mParameters != NULL; -} -#endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK - -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS -inline bool EndPointBasis::IsSocketsEndPoint() const -{ - return mSocket != INET_INVALID_SOCKET_FD; -} -#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS - -#if CHIP_SYSTEM_CONFIG_USE_LWIP -inline bool EndPointBasis::IsLWIPEndPoint(void) const -{ - return mVoid != NULL; -} -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP - -inline bool EndPointBasis::IsOpenEndPoint() const -{ - bool lResult = false; - -#if CHIP_SYSTEM_CONFIG_USE_LWIP - lResult = (lResult || IsLWIPEndPoint()); -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP - -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS - lResult = (lResult || IsSocketsEndPoint()); -#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS - -#if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK - lResult = (lResult || IsNetworkFrameworkEndPoint()); -#endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK - - return lResult; -} - } // namespace Inet } // namespace chip diff --git a/src/inet/IPEndPointBasis.cpp b/src/inet/IPEndPointBasis.cpp index 58511770563845..e75813149110d4 100644 --- a/src/inet/IPEndPointBasis.cpp +++ b/src/inet/IPEndPointBasis.cpp @@ -345,7 +345,7 @@ CHIP_ERROR IPEndPointBasis::SetMulticastLoopback(IPVersion aIPVersion, bool aLoo { #if INET_CONFIG_ENABLE_UDP_ENDPOINT - case kLwIPEndPointType_UDP: + case LwIPEndPointType::UDP: udp_set_flags(mUDP, UDP_FLAGS_MULTICAST_LOOP); break; #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT @@ -361,7 +361,7 @@ CHIP_ERROR IPEndPointBasis::SetMulticastLoopback(IPVersion aIPVersion, bool aLoo { #if INET_CONFIG_ENABLE_UDP_ENDPOINT - case kLwIPEndPointType_UDP: + case LwIPEndPointType::UDP: udp_clear_flags(mUDP, UDP_FLAGS_MULTICAST_LOOP); break; #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT @@ -907,7 +907,7 @@ CHIP_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System: CHIP_ERROR IPEndPointBasis::GetSocket(IPAddressType aAddressType, int aType, int aProtocol) { - if (mSocket == INET_INVALID_SOCKET_FD) + if (mSocket == kInvalidSocketFd) { const int one = 1; int family; diff --git a/src/inet/IPEndPointBasis.h b/src/inet/IPEndPointBasis.h index e22e2cf4b84806..b3d86fb7f41e60 100644 --- a/src/inet/IPEndPointBasis.h +++ b/src/inet/IPEndPointBasis.h @@ -28,6 +28,8 @@ #include +#include +#include #include #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -61,21 +63,13 @@ class DLL_EXPORT IPEndPointBasis : public EndPointBasis * state after binding to a local interface address, then proceed to the * "listening" state when they have continuations registered for handling * events for reception of ICMP messages. - * - * @note - * The \c kBasisState_Closed state enumeration is mapped to \c - * kState_Ready for historical binary-compatibility reasons. The - * existing \c kState_Closed exists to identify separately the - * distinction between "not opened yet" and "previously opened - * now closed" that existed previously in the \c kState_Ready and - * \c kState_Closed states. */ enum { - kState_Ready = kBasisState_Closed, /**< Endpoint initialized, but not open. */ - kState_Bound = 1, /**< Endpoint bound, but not listening. */ - kState_Listening = 2, /**< Endpoint receiving datagrams. */ - kState_Closed = 3 /**< Endpoint closed, ready for release. */ + kState_Ready = 0, /**< Endpoint initialized, but not open. */ + kState_Bound = 1, /**< Endpoint bound, but not listening. */ + kState_Listening = 2, /**< Endpoint receiving datagrams. */ + kState_Closed = 3 /**< Endpoint closed, ready for release. */ } mState; /** diff --git a/src/inet/InetConfig.h b/src/inet/InetConfig.h index 32f0a132480f35..04533c08abef17 100644 --- a/src/inet/InetConfig.h +++ b/src/inet/InetConfig.h @@ -113,19 +113,6 @@ #define INET_CONFIG_WILL_OVERRIDE_LWIP_ERROR_FUNCS 0 #endif // INET_CONFIG_WILL_OVERRIDE_LWIP_ERROR_FUNCS -/** - * @def INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS - * - * @brief - * This defines whether (1) or not (0) your platform will override - * the platform- and system-specific InetLayer WillInit, DidInit, - * WillShutdown, and DidShutdown. - * - */ -#ifndef INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS -#define INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS 0 -#endif // INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS - /** * @def INET_CONFIG_MAX_DROPPABLE_EVENTS * diff --git a/src/inet/InetLayer.cpp b/src/inet/InetLayer.cpp index 14357b97a589b2..4ffeabf9152827 100644 --- a/src/inet/InetLayer.cpp +++ b/src/inet/InetLayer.cpp @@ -221,13 +221,6 @@ void InetLayer::DroppableEventDequeued(void) * LwIP-based adaptations, this will typically be a pointer to the * event queue associated with the InetLayer instance. * - * Platforms may choose to assert - * #INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS in their - * platform-specific configuration header and enable the - * Platform::InetLayer::WillInit and Platform::InetLayer::DidInit - * hooks to effect platform-specific customizations or data extensions - * to InetLayer. - * * @param[in] aSystemLayer A required instance of the chip System Layer * already successfully initialized. * @@ -247,8 +240,6 @@ void InetLayer::DroppableEventDequeued(void) */ CHIP_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext) { - CHIP_ERROR err = CHIP_NO_ERROR; - Inet::RegisterLayerErrorFormatter(); if (State != kState_NotInitialized) @@ -260,54 +251,35 @@ CHIP_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext) mPlatformData = nullptr; - err = Platform::InetLayer::WillInit(this, aContext); - SuccessOrExit(err); - mSystemLayer = &aSystemLayer; mContext = aContext; #if CHIP_SYSTEM_CONFIG_USE_LWIP - err = InitQueueLimiter(); - SuccessOrExit(err); + ReturnErrorOnFailure(InitQueueLimiter()); static_cast(mSystemLayer)->AddEventHandlerDelegate(sInetEventHandlerDelegate); #endif // CHIP_SYSTEM_CONFIG_USE_LWIP State = kState_Initialized; -#if INET_CONFIG_ENABLE_DNS_RESOLVER -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS - err = mAsyncDNSResolver.Init(this); - SuccessOrExit(err); -#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS -#endif // INET_CONFIG_ENABLE_DNS_RESOLVER +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS + ReturnErrorOnFailure(mAsyncDNSResolver.Init(this)); +#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS -exit: - Platform::InetLayer::DidInit(this, mContext, err); - return err; + return CHIP_NO_ERROR; } /** * This is the InetLayer explicit deinitializer and should be called * prior to disposing of an instantiated InetLayer instance. * - * Platforms may choose to assert - * #INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS in their - * platform-specific configuration header and enable the - * Platform::InetLayer::WillShutdown and - * Platform::InetLayer::DidShutdown hooks to effect clean-up of - * platform-specific customizations or data extensions to InetLayer. - * * @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating * the reason for shutdown failure. * */ CHIP_ERROR InetLayer::Shutdown() { - CHIP_ERROR err; - - err = Platform::InetLayer::WillShutdown(this, mContext); - SuccessOrExit(err); + CHIP_ERROR err = CHIP_NO_ERROR; if (State == kState_Initialized) { @@ -353,9 +325,6 @@ CHIP_ERROR InetLayer::Shutdown() State = kState_NotInitialized; -exit: - Platform::InetLayer::DidShutdown(this, mContext, err); - return err; } @@ -1020,110 +989,5 @@ void IPPacketInfo::Clear() DestPort = 0; } -#if !INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS - -// MARK: InetLayer platform- and system-specific functions for InetLayer -// construction and destruction. - -namespace Platform { -namespace InetLayer { - -/** - * This is a platform-specific InetLayer pre-initialization hook. This - * may be overridden by assserting the preprocessor definition, - * #INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS. - * - * @param[in,out] aLayer A pointer to the InetLayer instance being - * initialized. - * - * @param[in,out] aContext Platform-specific context data passed to - * the layer initialization method, \::Init. - * - * @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating - * the reason for initialization failure. Returning non-successful - * status will abort initialization. - * - */ -DLL_EXPORT CHIP_ERROR WillInit(Inet::InetLayer * aLayer, void * aContext) -{ - (void) aLayer; - (void) aContext; - - return CHIP_NO_ERROR; -} - -/** - * This is a platform-specific InetLayer post-initialization hook. This - * may be overridden by assserting the preprocessor definition, - * #INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS. - * - * @param[in,out] aLayer A pointer to the InetLayer instance being - * initialized. - * - * @param[in,out] aContext Platform-specific context data passed to - * the layer initialization method, \::Init. - * - * @param[in] anError The overall status being returned via the - * InetLayer \::Init method. - * - */ -DLL_EXPORT void DidInit(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError) -{ - (void) aLayer; - (void) aContext; - (void) anError; -} - -/** - * This is a platform-specific InetLayer pre-shutdown hook. This - * may be overridden by assserting the preprocessor definition, - * #INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS. - * - * @param[in,out] aLayer A pointer to the InetLayer instance being - * shutdown. - * - * @param[in,out] aContext Platform-specific context data passed to - * the layer initialization method, \::Init. - * - * @return #CHIP_NO_ERROR on success; otherwise, a specific error indicating - * the reason for shutdown failure. Returning non-successful - * status will abort shutdown. - * - */ -DLL_EXPORT CHIP_ERROR WillShutdown(Inet::InetLayer * aLayer, void * aContext) -{ - (void) aLayer; - (void) aContext; - - return CHIP_NO_ERROR; -} - -/** - * This is a platform-specific InetLayer post-shutdown hook. This - * may be overridden by assserting the preprocessor definition, - * #INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS. - * - * @param[in,out] aLayer A pointer to the InetLayer instance being - * shutdown. - * - * @param[in,out] aContext Platform-specific context data passed to - * the layer initialization method, \::Init. - * - * @param[in] anError The overall status being returned via the - * InetLayer \::Shutdown method. - * - */ -DLL_EXPORT void DidShutdown(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError) -{ - (void) aLayer; - (void) aContext; - (void) anError; -} - -} // namespace InetLayer -} // namespace Platform - -#endif // !INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS - } // namespace Inet } // namespace chip diff --git a/src/inet/InetLayer.h b/src/inet/InetLayer.h index 35f6adf00dd644..b557cc01a2259e 100644 --- a/src/inet/InetLayer.h +++ b/src/inet/InetLayer.h @@ -105,22 +105,8 @@ namespace chip { namespace Inet { -// Forward Declarations - class InetLayer; -namespace Platform { -namespace InetLayer { - -extern CHIP_ERROR WillInit(Inet::InetLayer * aLayer, void * aContext); -extern void DidInit(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError); - -extern CHIP_ERROR WillShutdown(Inet::InetLayer * aLayer, void * aContext); -extern void DidShutdown(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError); - -} // namespace InetLayer -} // namespace Platform - /** * @class InetLayer * @@ -143,6 +129,9 @@ class DLL_EXPORT InetLayer { #if INET_CONFIG_ENABLE_DNS_RESOLVER friend class DNSResolver; +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS + friend class AsyncDNSResolverSockets; +#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS #endif // INET_CONFIG_ENABLE_DNS_RESOLVER #if INET_CONFIG_ENABLE_TCP_ENDPOINT @@ -153,12 +142,6 @@ class DLL_EXPORT InetLayer friend class UDPEndPoint; #endif // INET_CONFIG_ENABLE_UDP_ENDPOINT -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS -#if INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS - friend class AsyncDNSResolverSockets; -#endif // INET_CONFIG_ENABLE_DNS_RESOLVER && INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS -#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS - public: /** * The current state of the InetLayer object. @@ -285,12 +268,6 @@ class DLL_EXPORT InetLayer #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS - friend CHIP_ERROR Platform::InetLayer::WillInit(Inet::InetLayer * aLayer, void * aContext); - friend void Platform::InetLayer::DidInit(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError); - - friend CHIP_ERROR Platform::InetLayer::WillShutdown(Inet::InetLayer * aLayer, void * aContext); - friend void Platform::InetLayer::DidShutdown(Inet::InetLayer * aLayer, void * aContext, CHIP_ERROR anError); - bool IsIdleTimerRunning(); }; @@ -316,11 +293,5 @@ class IPPacketInfo void Clear(); }; -extern CHIP_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, - uint16_t & aPort); - -extern CHIP_ERROR ParseHostPortAndInterface(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, - uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen); - } // namespace Inet } // namespace chip diff --git a/src/inet/InetLayerBasis.h b/src/inet/InetLayerBasis.h index cfde74effad6c6..4645a8a118e67a 100644 --- a/src/inet/InetLayerBasis.h +++ b/src/inet/InetLayerBasis.h @@ -17,94 +17,48 @@ */ /** - * @file - * This file contains the basis class for reference counting - * objects by the Inet layer as well as a class for representing - * the pending or resulting I/O events on a socket. + * This file contains the basis class for reference counting objects by the Inet layer. */ #pragma once -#include - -#include -#include #include -#include -#include -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS -#include -#endif - namespace chip { namespace Inet { -//--- Forward declaration of InetLayer singleton class class InetLayer; /** - * @class InetLayerBasis - * - * @brief - * This is the basis class of reference-counted objects managed by an - * InetLayer object. - * + * This is the basis class of reference-counted objects managed by an InetLayer object. */ class InetLayerBasis : public chip::System::Object { public: - InetLayer & Layer() const; - bool IsCreatedByInetLayer(const InetLayer & aInetLayer) const; + /** + * Returns a reference to the Inet layer object that owns this basis object. + */ + InetLayer & Layer() const { return *mInetLayer; } + + /** + * Returns \c true if the basis object was obtained by the specified Inet layer instance. + * + * @note + * Does not check whether the object is actually obtained by the system layer instance associated with the Inet layer + * instance. It merely tests whether \c aInetLayer is the Inet layer instance that was provided to \c InitInetLayerBasis. + */ + bool IsCreatedByInetLayer(const InetLayer & aInetLayer) const { return mInetLayer == &aInetLayer; } protected: - void InitInetLayerBasis(InetLayer & aInetLayer, void * aAppState = nullptr); + void InitInetLayerBasis(InetLayer & aInetLayer, void * aAppState = nullptr) + { + AppState = aAppState; + mInetLayer = &aInetLayer; + } private: InetLayer * mInetLayer; /**< Pointer to the InetLayer object that owns this object. */ }; -/** - * Returns a reference to the Inet layer object that owns this basis object. - */ -inline InetLayer & InetLayerBasis::Layer() const -{ - return *mInetLayer; -} - -/** - * Returns \c true if the basis object was obtained by the specified INET layer instance. - * - * @param[in] aInetLayer An instance of the INET layer. - * - * @return \c true if owned by \c aInetLayer, otherwise \c false. - * - * @note - * Does not check whether the object is actually obtained by the system layer instance associated with the INET layer - * instance. It merely tests whether \c aInetLayer is the INET layer instance that was provided to \c InitInetLayerBasis. - */ -inline bool InetLayerBasis::IsCreatedByInetLayer(const InetLayer & aInetLayer) const -{ - return mInetLayer == &aInetLayer; -} - -inline void InetLayerBasis::InitInetLayerBasis(InetLayer & aInetLayer, void * aAppState) -{ - AppState = aAppState; - mInetLayer = &aInetLayer; -} - -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS - -/** - * @def INET_INVALID_SOCKET_FD - * - * @brief - * This is the invalid socket file descriptor identifier. - */ -#define INET_INVALID_SOCKET_FD (-1) - -#endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS - } // namespace Inet } // namespace chip diff --git a/src/inet/InetUtils.cpp b/src/inet/InetUtils.cpp deleted file mode 100644 index 19d550032ef8a3..00000000000000 --- a/src/inet/InetUtils.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2013-2017 Nest Labs, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This file implements methods for parsing host names or IP - * addresses and an optional port number and/or an optional - * interface name from a human-readable string. - * - */ - -#include -#include - -#include - -#include - -namespace chip { -namespace Inet { - -/** - * Parse a human-readable string containing a host or IP address and - * an optional port number (separated by a ':'), supporting the - * following formats: - * - * * - * * :\ - * * - * * :\ - * * - * * []:\ - * - * @param[in] aString The human-reable string to parse. - * - * @param[in] aStringLen The length, in characters, of aString. - * - * @param[out] aHost A pointer to the host name portion of the parsed - * string. - * - * @param[out] aHostLen The length, in characters, of aHost. - * - * @param[out] aPort The port number, if present and successfully - * parsed; otherwise, 0. - * - * @return #INET_ERROR_INVALID_HOST_NAME If the input to be parsed is of - * zero-length or otherwise - * malformed. - * @return #INET_ERROR_HOST_NAME_TOO_LONG If the host name exceeds 253 - * characters. - * @return #CHIP_NO_ERROR On success. - * - */ -DLL_EXPORT CHIP_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, - uint16_t & aPort) -{ - const char * end = aString + aStringLen; - const char * p; - - if (aStringLen == 0) - return INET_ERROR_INVALID_HOST_NAME; - - // If the string starts with a [ then it is a backeted - // host/address, possibly with a port number following it. - - if (*aString == '[') - { - // Search for the end bracket. - p = static_cast(memchr(aString, ']', aStringLen)); - if (p == nullptr) - return INET_ERROR_INVALID_HOST_NAME; - - // Return the IPv6 address. - aHost = aString + 1; - // Cast is safe because we know p != aString, so p >= aHost, and at the - // same time p - aString < aStringLen, which is uint16_t. - static_assert(std::is_same::value, "String length might be too big"); - aHostLen = static_cast(p - aHost); - - // Skip the end bracket. - p++; - } - - // Otherwise, not a bracketed IPv6 address... - else - { - // Search for a colon. - p = static_cast(memchr(aString, ':', aStringLen)); - - // If the string contains no colons, then it is a host name or - // IPv4 address without a port. - // - // If the string contains MULTIPLE colons, then it is an IPv6 - // address without a port. - // - // Note: The cast is safe because p points into the string of p is not - // null, so end - p - 1 can't be negative. - if (p == nullptr || memchr(p + 1, ':', static_cast(end - p - 1)) != nullptr) - p = end; - - // Return the host/address portion. - aHost = aString; - // Cast is safe because we know p - aString < aStringLen, which is - // uint16_t. - static_assert(std::is_same::value, "String length might be too big"); - aHostLen = static_cast(p - aString); - } - - // Enforce the DNS limit on the maximum length of a host name. - if (aHostLen > 253) - return INET_ERROR_HOST_NAME_TOO_LONG; - - // If there are more characters after the host name... - if (p < end) - { - // Verify the presence of a colon. - if (*p++ != ':') - return INET_ERROR_INVALID_HOST_NAME; - - // Verify that the port number portion is not too long. - if ((end - p) > 5) - return INET_ERROR_INVALID_HOST_NAME; - - // Parse the port number. - aPort = 0; - for (; p < end; p++) - if (*p >= '0' && *p <= '9') - aPort = static_cast((aPort * 10) + (*p - '0')); - else - return INET_ERROR_INVALID_HOST_NAME; - } - - // Otherwise, tell the caller there was no port number. - else - aPort = 0; - - return CHIP_NO_ERROR; -} - -/** - * Parse a human-readable string containing a host or IP address, an - * optional port number (separated by a ':'), and an optional - * interface name (separated by a '%'), supporting the following - * formats: - * - * * - * * %\ - * * :\ - * * :\%\ - * * - * * %\ - * * :\ - * * :\%\ - * * - * * %\ - * * []:\ - * * []:\%\ - * - * @param[in] aString The human-reable string to parse. - * - * @param[in] aStringLen The length, in characters, of aString. - * - * @param[out] aHost A pointer to the host name portion of the parsed - * string. - * - * @param[out] aHostLen The length, in characters, of aHost. - * - * @param[out] aPort The port number, if present and successfully - * parsed; otherwise, 0. - * - * @param[out] aInterface A pointer to the interface portion of the parsed - * string. - * - * @param[out] aInterfaceLen The length, in characters, of aInterface. - * - * @return #INET_ERROR_INVALID_HOST_NAME If the input to be parsed is of - * zero-length or otherwise - * malformed. - * @return #INET_ERROR_HOST_NAME_TOO_LONG If the host name exceeds 253 - * characters. - * @return #CHIP_NO_ERROR On success. - * - */ -DLL_EXPORT CHIP_ERROR ParseHostPortAndInterface(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, - uint16_t & aPort, const char *& aInterface, uint16_t & aInterfaceLen) -{ - const char * end = aString + aStringLen; - - aInterface = nullptr; - aInterfaceLen = 0; - - for (uint16_t i = 1; i < aStringLen; i++) - { - char ch = *(end - i); - if (ch == '%') - { - aInterface = end - i + 1; - aInterfaceLen = static_cast(i - 1); - aStringLen = static_cast(aStringLen - i); - break; - } - if (ch == ':' || ch == ']') - break; - } - - return ParseHostAndPort(aString, aStringLen, aHost, aHostLen, aPort); -} - -} // namespace Inet -} // namespace chip diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp index 9ed434decde1ae..2030d6920b50bd 100644 --- a/src/inet/TCPEndPoint.cpp +++ b/src/inet/TCPEndPoint.cpp @@ -287,7 +287,7 @@ CHIP_ERROR TCPEndPoint::Listen(uint16_t backlog) // Start listening for incoming connections. mTCP = tcp_listen(mTCP); - mLwIPEndPointType = kLwIPEndPointType_TCP; + mLwIPEndPointType = LwIPEndPointType::TCP; tcp_arg(mTCP, this); @@ -1627,7 +1627,7 @@ CHIP_ERROR TCPEndPoint::DoClose(CHIP_ERROR err, bool suppressCallback) // Discard the reference to the PCB to ensure there is no further interaction with it // after this point. mTCP = NULL; - mLwIPEndPointType = kLwIPEndPointType_Unknown; + mLwIPEndPointType = LwIPEndPointType::Unknown; } } @@ -1639,7 +1639,7 @@ CHIP_ERROR TCPEndPoint::DoClose(CHIP_ERROR err, bool suppressCallback) // Discard the reference to the PCB to ensure there is no further interaction with it // after this point. mTCP = NULL; - mLwIPEndPointType = kLwIPEndPointType_Unknown; + mLwIPEndPointType = LwIPEndPointType::Unknown; } } @@ -1651,7 +1651,7 @@ CHIP_ERROR TCPEndPoint::DoClose(CHIP_ERROR err, bool suppressCallback) #if CHIP_SYSTEM_CONFIG_USE_SOCKETS // If the socket hasn't been closed already... - if (mSocket != INET_INVALID_SOCKET_FD) + if (mSocket != kInvalidSocketFd) { // If entering the Closed state // OR if entering the Closing state, and there's no unsent data in the send queue @@ -1670,7 +1670,7 @@ CHIP_ERROR TCPEndPoint::DoClose(CHIP_ERROR err, bool suppressCallback) static_cast(Layer().SystemLayer())->StopWatchingSocket(&mWatch); close(mSocket); - mSocket = INET_INVALID_SOCKET_FD; + mSocket = kInvalidSocketFd; } } @@ -1961,7 +1961,7 @@ CHIP_ERROR TCPEndPoint::GetPCB(IPAddressType addrType) } else { - mLwIPEndPointType = kLwIPEndPointType_TCP; + mLwIPEndPointType = LwIPEndPointType::TCP; } } else @@ -2001,7 +2001,7 @@ CHIP_ERROR TCPEndPoint::GetPCB(IPAddressType addrType) } else { - mLwIPEndPointType = kLwIPEndPointType_TCP; + mLwIPEndPointType = LwIPEndPointType::TCP; } } else @@ -2251,7 +2251,7 @@ err_t TCPEndPoint::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpc // Put the new end point into the Connected state. conEP->State = kState_Connected; conEP->mTCP = tpcb; - conEP->mLwIPEndPointType = kLwIPEndPointType_TCP; + conEP->mLwIPEndPointType = LwIPEndPointType::TCP; conEP->Retain(); // Setup LwIP callback functions for the new PCB. @@ -2344,7 +2344,7 @@ void TCPEndPoint::LwIPHandleError(void * arg, err_t lwipErr) // of this is that the mTCP field is shared state between the two threads and thus must only be // accessed with the LwIP lock held. ep->mTCP = NULL; - ep->mLwIPEndPointType = kLwIPEndPointType_Unknown; + ep->mLwIPEndPointType = LwIPEndPointType::Unknown; // Post callback to HandleError. CHIP_ERROR err = chip::System::MapErrorLwIP(lwipErr); @@ -2412,7 +2412,7 @@ CHIP_ERROR TCPEndPoint::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId CHIP_ERROR TCPEndPoint::GetSocket(IPAddressType addrType) { - if (mSocket == INET_INVALID_SOCKET_FD) + if (mSocket == kInvalidSocketFd) { int family; if (addrType == kIPAddressType_IPv6) diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h index 8aa7d1a90471d6..698e2dda2d4d91 100644 --- a/src/inet/TCPEndPoint.h +++ b/src/inet/TCPEndPoint.h @@ -29,6 +29,7 @@ #include #include +#include #include @@ -72,23 +73,18 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * Objects are initialized in the "ready" state, proceed to subsequent * states corresponding to a simplification of the states of the TCP * transport state machine. - * - * @note - * The \c kBasisState_Closed state enumeration is mapped to \c kState_Ready for historical binary-compatibility reasons. The - * existing \c kState_Closed exists to identify separately the distinction between "not opened yet" and "previously opened now - * closed" that existed previously in the \c kState_Ready and \c kState_Closed states. */ enum { - kState_Ready = kBasisState_Closed, /**< Endpoint initialized, but not bound. */ - kState_Bound = 1, /**< Endpoint bound, but not listening. */ - kState_Listening = 2, /**< Endpoint receiving connections. */ - kState_Connecting = 3, /**< Endpoint attempting to connect. */ - kState_Connected = 4, /**< Endpoint connected, ready for tx/rx. */ - kState_SendShutdown = 5, /**< Endpoint initiated its half-close. */ - kState_ReceiveShutdown = 6, /**< Endpoint responded to half-close. */ - kState_Closing = 7, /**< Endpoint closing bidirectionally. */ - kState_Closed = 8 /**< Endpoint closed, ready for release. */ + kState_Ready = 0, /**< Endpoint initialized, but not bound. */ + kState_Bound = 1, /**< Endpoint bound, but not listening. */ + kState_Listening = 2, /**< Endpoint receiving connections. */ + kState_Connecting = 3, /**< Endpoint attempting to connect. */ + kState_Connected = 4, /**< Endpoint connected, ready for tx/rx. */ + kState_SendShutdown = 5, /**< Endpoint initiated its half-close. */ + kState_ReceiveShutdown = 6, /**< Endpoint responded to half-close. */ + kState_Closing = 7, /**< Endpoint closing bidirectionally. */ + kState_Closed = 8 /**< Endpoint closed, ready for release. */ } State; TCPEndPoint() = default; diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp index 60bd3f841083a8..340d8105511181 100644 --- a/src/inet/UDPEndPoint.cpp +++ b/src/inet/UDPEndPoint.cpp @@ -382,7 +382,7 @@ void UDPEndPoint::Close() { udp_remove(mUDP); mUDP = NULL; - mLwIPEndPointType = kLwIPEndPointType_Unknown; + mLwIPEndPointType = LwIPEndPointType::Unknown; } // Unlock LwIP stack @@ -392,11 +392,11 @@ void UDPEndPoint::Close() #if CHIP_SYSTEM_CONFIG_USE_SOCKETS - if (mSocket != INET_INVALID_SOCKET_FD) + if (mSocket != kInvalidSocketFd) { static_cast(Layer().SystemLayer())->StopWatchingSocket(&mWatch); close(mSocket); - mSocket = INET_INVALID_SOCKET_FD; + mSocket = kInvalidSocketFd; } #if CHIP_SYSTEM_CONFIG_USE_DISPATCH diff --git a/src/inet/tests/TestInetEndPoint.cpp b/src/inet/tests/TestInetEndPoint.cpp index 2f7941e9eaf468..d5b809a86162b9 100644 --- a/src/inet/tests/TestInetEndPoint.cpp +++ b/src/inet/tests/TestInetEndPoint.cpp @@ -181,31 +181,6 @@ static void TestResolveHostAddress(nlTestSuite * inSuite, void * inContext) } #endif // INET_CONFIG_ENABLE_DNS_RESOLVER -// Test Inet ParseHostPortAndInterface -static void TestParseHost(nlTestSuite * inSuite, void * inContext) -{ - char correctHostNames[7][30] = { - "10.0.0.1", "10.0.0.1:3000", "www.google.com", "www.google.com:3000", "[fd00:0:1:1::1]:3000", "[fd00:0:1:1::1]:300%wpan0", - "%wpan0" - }; - char invalidHostNames[4][30] = { "[fd00::1]5", "[fd00:0:1:1::1:3000", "10.0.0.1:1234567", "10.0.0.1:er31" }; - const char * host; - const char * intf; - uint16_t port, hostlen, intflen; - CHIP_ERROR err; - - for (char * correctHostName : correctHostNames) - { - err = ParseHostPortAndInterface(correctHostName, uint16_t(strlen(correctHostName)), host, hostlen, port, intf, intflen); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - } - for (char * invalidHostName : invalidHostNames) - { - err = ParseHostPortAndInterface(invalidHostName, uint16_t(strlen(invalidHostName)), host, hostlen, port, intf, intflen); - NL_TEST_ASSERT(inSuite, err == INET_ERROR_INVALID_HOST_NAME); - } -} - static void TestInetError(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -469,7 +444,6 @@ static const nlTest sTests[] = { NL_TEST_DEF("InetEndPoint::PreTest", TestInetPr #if INET_CONFIG_ENABLE_DNS_RESOLVER NL_TEST_DEF("InetEndPoint::ResolveHostAddress", TestResolveHostAddress), #endif // INET_CONFIG_ENABLE_DNS_RESOLVER - NL_TEST_DEF("InetEndPoint::TestParseHost", TestParseHost), NL_TEST_DEF("InetEndPoint::TestInetError", TestInetError), NL_TEST_DEF("InetEndPoint::TestInetInterface", TestInetInterface), NL_TEST_DEF("InetEndPoint::TestInetEndPoint", TestInetEndPointInternal), diff --git a/src/system/BUILD.gn b/src/system/BUILD.gn index b06a9eee6a7f1e..83989935b6f7ef 100644 --- a/src/system/BUILD.gn +++ b/src/system/BUILD.gn @@ -135,7 +135,6 @@ static_library("system") { "SystemLayerImpl${chip_system_config_event_loop}.cpp", "SystemLayerImpl${chip_system_config_event_loop}.h", "SystemLayerImpl.h", - "SystemLayerPrivate.h", "SystemMutex.cpp", "SystemMutex.h", "SystemObject.cpp", diff --git a/src/system/SystemClock.cpp b/src/system/SystemClock.cpp index 5d8cc3f821a494..2ea39427fec423 100644 --- a/src/system/SystemClock.cpp +++ b/src/system/SystemClock.cpp @@ -24,9 +24,6 @@ #include -// common private -#include "SystemLayerPrivate.h" - #include #include #include diff --git a/src/system/SystemError.cpp b/src/system/SystemError.cpp index 6b79bc14d35b68..356c697e15c996 100644 --- a/src/system/SystemError.cpp +++ b/src/system/SystemError.cpp @@ -27,9 +27,6 @@ // Include module header #include -// Include common private header -#include "SystemLayerPrivate.h" - #include #include diff --git a/src/system/SystemEvent.h b/src/system/SystemEvent.h index 95865210e6ee9f..fbc66e139b9e0e 100644 --- a/src/system/SystemEvent.h +++ b/src/system/SystemEvent.h @@ -54,9 +54,5 @@ typedef CHIP_SYSTEM_CONFIG_EVENT_TYPE EventType; */ typedef CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE Event; -#if CHIP_SYSTEM_CONFIG_USE_LWIP - -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP - } // namespace System } // namespace chip diff --git a/src/system/SystemFaultInjection.cpp b/src/system/SystemFaultInjection.cpp index b79653fce4b0fd..8383dfdee76513 100644 --- a/src/system/SystemFaultInjection.cpp +++ b/src/system/SystemFaultInjection.cpp @@ -26,8 +26,6 @@ /* module header, also carries config, comes first */ #include -#include "SystemLayerPrivate.h" - #include #include diff --git a/src/system/SystemLayerPrivate.h b/src/system/SystemLayerPrivate.h deleted file mode 100644 index 135803671c24d7..00000000000000 --- a/src/system/SystemLayerPrivate.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2017 Nest Labs, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * This header file includes common private definitions for the CHIP system layer. - */ -#pragma once - -#include - -// -// Common definitions for the LwIP configuration -// -#if CHIP_SYSTEM_CONFIG_USE_LWIP - -#include -#include - -// To use LwIP 1.x, some additional definitions are required here. -#if LWIP_VERSION_MAJOR < 2 - -// Compatibility adaptations for statistical data in LwIP 1.x -#ifndef MEMP_STATS_GET -#define MEMP_STATS_GET(FIELD, INDEX) (lwip_stats.memp[INDEX].FIELD) -#endif // !defined(MEMP_STATS_GET) -#endif // LWIP_VERSION_MAJOR - -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP diff --git a/src/system/SystemMutex.cpp b/src/system/SystemMutex.cpp index abd06718158c5d..878a1dda9b1983 100644 --- a/src/system/SystemMutex.cpp +++ b/src/system/SystemMutex.cpp @@ -25,9 +25,6 @@ // Include module header #include -// Include common private header -#include "SystemLayerPrivate.h" - #if !CHIP_SYSTEM_CONFIG_NO_LOCKING // Include system headers diff --git a/src/system/SystemObject.cpp b/src/system/SystemObject.cpp index 342cbe62c08a52..fc1ebf987f9836 100644 --- a/src/system/SystemObject.cpp +++ b/src/system/SystemObject.cpp @@ -25,9 +25,6 @@ // Include module header #include -// Include common private header -#include "SystemLayerPrivate.h" - // Include local headers #include #include diff --git a/src/system/SystemObject.h b/src/system/SystemObject.h index 4a38fa0e864e68..6dfcb557009781 100644 --- a/src/system/SystemObject.h +++ b/src/system/SystemObject.h @@ -102,8 +102,6 @@ class DLL_EXPORT Object void Release(); Layer & SystemLayer() const; -protected: -#if CHIP_SYSTEM_CONFIG_USE_LWIP /**< What to do when DeferredRelease fails to post a kEvent_ReleaseObj. */ enum ReleaseDeferralErrorTactic { @@ -112,6 +110,8 @@ class DLL_EXPORT Object kReleaseDeferralErrorTactic_Die, /**< Die with message. */ }; +protected: +#if CHIP_SYSTEM_CONFIG_USE_LWIP void DeferredRelease(LayerLwIP * aSystemLayer, ReleaseDeferralErrorTactic aTactic); #endif // CHIP_SYSTEM_CONFIG_USE_LWIP diff --git a/src/system/SystemPacketBuffer.cpp b/src/system/SystemPacketBuffer.cpp index 6d5c57b4626086..a0361908210036 100644 --- a/src/system/SystemPacketBuffer.cpp +++ b/src/system/SystemPacketBuffer.cpp @@ -31,9 +31,6 @@ // Include module header #include -// Include common private header -#include "SystemLayerPrivate.h" - // Include local headers #include #include diff --git a/src/system/SystemStats.cpp b/src/system/SystemStats.cpp index de4c17a61e1385..20169719db4f4f 100644 --- a/src/system/SystemStats.cpp +++ b/src/system/SystemStats.cpp @@ -22,9 +22,6 @@ * on the state of CHIP, Inet and System resources */ -// Include common private header -#include "SystemLayerPrivate.h" - // Include local headers #include @@ -113,6 +110,14 @@ bool Difference(Snapshot & result, Snapshot & after, Snapshot & before) } #if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_STATS && MEMP_STATS + +// To use LwIP 1.x, some additional definitions are required here. +#if LWIP_VERSION_MAJOR < 2 +#ifndef MEMP_STATS_GET +#define MEMP_STATS_GET(FIELD, INDEX) (lwip_stats.memp[INDEX].FIELD) +#endif // !defined(MEMP_STATS_GET) +#endif // LWIP_VERSION_MAJOR + void UpdateLwipPbufCounts(void) { #if LWIP_PBUF_FROM_CUSTOM_POOLS diff --git a/src/system/SystemStats.h b/src/system/SystemStats.h index cb5be8c72eb20d..f80cf93b7738ca 100644 --- a/src/system/SystemStats.h +++ b/src/system/SystemStats.h @@ -37,9 +37,11 @@ #include #if CHIP_SYSTEM_CONFIG_USE_LWIP +#include #include #include #include +#include #endif // CHIP_SYSTEM_CONFIG_USE_LWIP #include diff --git a/src/system/SystemTimer.cpp b/src/system/SystemTimer.cpp index 3e136ebdcd42d4..d776a8b2af9b2a 100644 --- a/src/system/SystemTimer.cpp +++ b/src/system/SystemTimer.cpp @@ -26,9 +26,6 @@ // Include module header #include -// Include common private header -#include "SystemLayerPrivate.h" - // Include local headers #include