Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Use RMP (Reliable Messaging Protocol) to retire WRMP and WRM in CHIP … #2173

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/inet/InetFaultInjection.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef enum
{
kFault_DNSResolverNew, /**< Fail the allocation of a DNSResolver object */
kFault_Send, /**< Fail sending a message over TCP or UDP */
kFault_SendNonCritical, /**< Fail sending a UDP message returning an error considered non-critical by WRMP */
kFault_SendNonCritical, /**< Fail sending a UDP message returning an error considered non-critical by RMP */
kFault_NumItems,
} InetFaultInjectionID;

Expand Down
2 changes: 1 addition & 1 deletion src/inet/tests/TestInetCommonOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ FaultInjectionOptions::FaultInjectionOptions()
" --extra-cleanup-time\n"
" Allow extra time before asserting resource leaks; this is useful when\n"
" running fault-injection tests to let the system free stale ExchangeContext\n"
" instances after WRMP has exhausted all retransmission; a failed WRMP transmission\n"
" instances after RMP has exhausted all retransmission; a failed RMP transmission\n"
" should fail a normal happy-sequence test, but not necessarily a fault-injection test.\n"
" The value is in milliseconds; a common value is 10000.\n"
"\n"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/CHIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

#include "CHIPEventLoggingConfig.h"

#include "CHIPWRMPConfig.h"
#include "CHIPRMPConfig.h"
*/
/**
* @def CHIP_CONFIG_ERROR_TYPE
Expand Down
2 changes: 1 addition & 1 deletion src/lib/message/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static_library("message") {
"CHIPSecurityMgr.cpp",
"CHIPServerBase.h",
"CHIPServerBase.cpp",
"CHIPWRMPConfig.h",
"CHIPRMPConfig.h",
"HostPortList.h",
"HostPortList.cpp",
]
Expand Down
54 changes: 27 additions & 27 deletions src/lib/message/CHIPBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace chip {
* Retrieve the IP address information for the peer, if available.
*
* The availability of the peer's IP address information depends on the state and configuration of the binding.
* IP address information is only available when using an IP-based transport (TCP, UDP, or UDP with WRMP). Prior to
* IP address information is only available when using an IP-based transport (TCP, UDP, or UDP with RMP). Prior to
* the start of preparation, address information is only available if it has been set expressly by the application
* during configuration. During the preparation phase, address information is available when address preparation
* completes (e.g. after DNS resolution has completed). After the Binding is ready, address information remains
Expand Down Expand Up @@ -116,20 +116,20 @@ namespace chip {
*/

/**
* @fn const WRMPConfig& Binding::GetDefaultWRMPConfig(void) const
* @fn const RMPConfig& Binding::GetDefaultRMPConfig(void) const
*
* Get the default WRMP configuration to be used when communicating with the peer.
* Get the default RMP configuration to be used when communicating with the peer.
*
* @return A reference to a WRMPConfig structure containing
* @return A reference to a RMPConfig structure containing
* the default configuration values.
*/

/**
* @fn void Binding::SetDefaultWRMPConfig(const WRMPConfig& aWRMPConfig)
* @fn void Binding::SetDefaultRMPConfig(const RMPConfig& aRMPConfig)
*
* Set the default WRMP configuration to be used when communicating with the peer.
* Set the default RMP configuration to be used when communicating with the peer.
*
* @param[in] aWRMPConfig A reference to a WRMPConfig structure containing
* @param[in] aRMPConfig A reference to a RMPConfig structure containing
* the new default configuration.
*/

Expand Down Expand Up @@ -445,7 +445,7 @@ void Binding::ResetConfig()
mTransportOption = kTransport_NotSpecified;
mDefaultResponseTimeoutMsec = 0;
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mDefaultWRMPConfig = gDefaultWRMPConfig;
mDefaultRMPConfig = gDefaultRMPConfig;
#endif
mUDPPathMTU = CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE;

Expand Down Expand Up @@ -545,21 +545,21 @@ CHIP_ERROR Binding::DoPrepare(CHIP_ERROR configErr)
#if CHIP_CONFIG_ENABLE_CASE_INITIATOR
// Shared CASE session not supported over connection-oriented transports.
VerifyOrExit(mSecurityOption != kSecurityOption_SharedCASESession || mTransportOption == kTransport_UDP ||
mTransportOption == kTransport_UDP_WRM,
mTransportOption == kTransport_UDP_RMP,
err = CHIP_ERROR_NOT_IMPLEMENTED);
#endif

#if CHIP_CONFIG_ENABLE_PASE_INITIATOR
// PASE sessions not supported over UDP transports.
VerifyOrExit(mSecurityOption != kSecurityOption_PASESession ||
(mTransportOption != kTransport_UDP && mTransportOption != kTransport_UDP_WRM),
(mTransportOption != kTransport_UDP && mTransportOption != kTransport_UDP_RMP),
err = CHIP_ERROR_NOT_IMPLEMENTED);
#endif

#if CHIP_CONFIG_ENABLE_TAKE_INITIATOR
// TAKE sessions not supported over UDP transports.
VerifyOrExit(mSecurityOption != kSecurityOption_TAKESession ||
(mTransportOption != kTransport_UDP && mTransportOption != kTransport_UDP_WRM),
(mTransportOption != kTransport_UDP && mTransportOption != kTransport_UDP_RMP),
err = CHIP_ERROR_NOT_IMPLEMENTED);
#endif

Expand Down Expand Up @@ -887,8 +887,8 @@ void Binding::HandleBindingReady()
case kTransport_UDP:
transport = "UDP";
break;
case kTransport_UDP_WRM:
transport = "WRM";
case kTransport_UDP_RMP:
transport = "RMP";
break;
case kTransport_TCP:
case kTransport_ExistingConnection:
Expand Down Expand Up @@ -1236,7 +1236,7 @@ bool Binding::IsAuthenticMessageFromPeer(const chip::ChipMessageHeader * msgInfo
}
else
{
if (mTransportOption != kTransport_UDP && mTransportOption != kTransport_UDP_WRM)
if (mTransportOption != kTransport_UDP && mTransportOption != kTransport_UDP_RMP)
return false;
}

Expand All @@ -1252,7 +1252,7 @@ bool Binding::IsAuthenticMessageFromPeer(const chip::ChipMessageHeader * msgInfo
/**
* Get the max CHIP payload size that can fit inside the supplied PacketBuffer.
*
* For UDP, including UDP with WRM, the maximum payload size returned will
* For UDP, including UDP with RMP, the maximum payload size returned will
* ensure the resulting CHIP message will not overflow the configured UDP MTU.
*
* Additionally, this method will ensure the CHIP payload will not overflow
Expand All @@ -1268,7 +1268,7 @@ uint32_t Binding::GetMaxChipPayloadSize(const System::PacketBuffer * msgBuf)
// Constrain the max CHIP payload size by the UDP MTU if we are using UDP.
// TODO: Eventually, we may configure a custom UDP MTU size on the binding
// instead of using the default value directly.
bool isUDP = (mTransportOption == kTransport_UDP || mTransportOption == kTransport_UDP_WRM);
bool isUDP = (mTransportOption == kTransport_UDP || mTransportOption == kTransport_UDP_RMP);
return ChipMessageLayer::GetMaxChipPayloadSize(msgBuf, isUDP, mUDPPathMTU);
}

Expand Down Expand Up @@ -1318,11 +1318,11 @@ CHIP_ERROR Binding::NewExchangeContext(chip::ExchangeContext *& appExchangeConte

#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING

// Set the default WRMP configuration in the new exchange.
appExchangeContext->mWRMPConfig = mDefaultWRMPConfig;
// Set the default RMP configuration in the new exchange.
appExchangeContext->mRMPConfig = mDefaultRMPConfig;

// If CHIP reliable messaging was expressly requested as a transport...
if (mTransportOption == kTransport_UDP_WRM)
if (mTransportOption == kTransport_UDP_RMP)
{
// Enable the auto-request ACK feature in the exchange so that all outgoing messages
// include a request for acknowledgment.
Expand Down Expand Up @@ -1628,10 +1628,10 @@ Binding::Configuration & Binding::Configuration::Transport_UDP()
*
* @return A reference to the binding object.
*/
Binding::Configuration & Binding::Configuration::Transport_UDP_WRM()
Binding::Configuration & Binding::Configuration::Transport_UDP_RMP()
{
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mBinding.mTransportOption = kTransport_UDP_WRM;
mBinding.mTransportOption = kTransport_UDP_RMP;
#else // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mError = CHIP_ERROR_NOT_IMPLEMENTED;
#endif // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
Expand All @@ -1653,18 +1653,18 @@ Binding::Configuration & Binding::Configuration::Transport_UDP_PathMTU(uint32_t
}

/**
* Set the default WRMP configuration for exchange contexts created from this Binding object.
* Set the default RMP configuration for exchange contexts created from this Binding object.
*
* @param[in] aWRMPConfig A reference to the new default WRMP configuration.
* @param[in] aRMPConfig A reference to the new default RMP configuration.
*
* @return A reference to the binding object.
*/
Binding::Configuration & Binding::Configuration::Transport_DefaultWRMPConfig(const chip::WRMPConfig & aWRMPConfig)
Binding::Configuration & Binding::Configuration::Transport_DefaultRMPConfig(const chip::RMPConfig & aRMPConfig)
{
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
mBinding.mDefaultWRMPConfig = aWRMPConfig;
mBinding.mDefaultRMPConfig = aRMPConfig;
#else // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
IgnoreUnusedVariable(aWRMPConfig);
IgnoreUnusedVariable(aRMPConfig);
mError = CHIP_ERROR_NOT_IMPLEMENTED;
#endif // CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
return *this;
Expand Down Expand Up @@ -1940,7 +1940,7 @@ Binding::Configuration & Binding::Configuration::ConfigureFromMessage(const chip
if (aMsgInfo->Flags & kChipMessageFlag_PeerRequestedAck)
{
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
Transport_UDP_WRM();
Transport_UDP_RMP();
#else
mError = CHIP_ERROR_NOT_IMPLEMENTED;
#endif // #if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
Expand Down
30 changes: 15 additions & 15 deletions src/lib/message/CHIPBinding.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#endif // __STDC_FORMAT_MACROS

#include <message/CHIPMessageLayer.h>
#include <message/CHIPWRMPConfig.h>
#include <message/CHIPRMPConfig.h>

namespace chip {

Expand Down Expand Up @@ -190,16 +190,16 @@ class Binding
uint32_t GetDefaultResponseTimeout() const;
void SetDefaultResponseTimeout(uint32_t msec);
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
const WRMPConfig & GetDefaultWRMPConfig(void) const;
void SetDefaultWRMPConfig(const WRMPConfig & wrmpConfig);
const RMPConfig & GetDefaultRMPConfig(void) const;
void SetDefaultRMPConfig(const RMPConfig & RMPConfig);
#endif // #if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
EventCallback GetEventCallback() const;
void SetEventCallback(EventCallback aEventCallback);
ChipConnection * GetConnection() const;
ChipExchangeManager * GetExchangeManager() const;
bool IsConnectionTransport() const;
bool IsUDPTransport() const;
bool IsWRMTransport() const;
bool IsRMPTransport() const;
bool IsUnreliableUDPTransport() const;

enum
Expand Down Expand Up @@ -244,7 +244,7 @@ class Binding
{
kTransport_NotSpecified = 0,
kTransport_UDP = 1,
kTransport_UDP_WRM = 2,
kTransport_UDP_RMP = 2,
kTransport_TCP = 3,
kTransport_ExistingConnection = 4,
};
Expand Down Expand Up @@ -295,7 +295,7 @@ class Binding
uint32_t mDefaultResponseTimeoutMsec;
uint32_t mUDPPathMTU;
#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
WRMPConfig mDefaultWRMPConfig;
RMPConfig mDefaultRMPConfig;
#endif
uint8_t mHostNameLen;

Expand Down Expand Up @@ -369,9 +369,9 @@ class Binding::Configuration

Configuration & Transport_TCP(void);
Configuration & Transport_UDP(void);
Configuration & Transport_UDP_WRM(void);
Configuration & Transport_UDP_RMP(void);
Configuration & Transport_UDP_PathMTU(uint32_t aPathMTU);
Configuration & Transport_DefaultWRMPConfig(const WRMPConfig & aWRMPConfig);
Configuration & Transport_DefaultRMPConfig(const RMPConfig & aRMPConfig);
Configuration & Transport_ExistingConnection(ChipConnection * apConnection);

Configuration & Exchange_ResponseTimeoutMsec(uint32_t aResponseTimeoutMsec);
Expand Down Expand Up @@ -522,14 +522,14 @@ inline void Binding::SetDefaultResponseTimeout(uint32_t timeout)

#if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING

inline const WRMPConfig & Binding::GetDefaultWRMPConfig(void) const
inline const RMPConfig & Binding::GetDefaultRMPConfig(void) const
{
return mDefaultWRMPConfig;
return mDefaultRMPConfig;
}

inline void Binding::SetDefaultWRMPConfig(const WRMPConfig & aWRMPConfig)
inline void Binding::SetDefaultRMPConfig(const RMPConfig & aRMPConfig)
{
mDefaultWRMPConfig = aWRMPConfig;
mDefaultRMPConfig = aRMPConfig;
}

#endif // #if CHIP_CONFIG_ENABLE_RELIABLE_MESSAGING
Expand Down Expand Up @@ -588,12 +588,12 @@ inline bool Binding::IsConnectionTransport() const

inline bool Binding::IsUDPTransport() const
{
return mTransportOption == kTransport_UDP || mTransportOption == kTransport_UDP_WRM;
return mTransportOption == kTransport_UDP || mTransportOption == kTransport_UDP_RMP;
}

inline bool Binding::IsWRMTransport() const
inline bool Binding::IsRMPTransport() const
{
return mTransportOption == kTransport_UDP_WRM;
return mTransportOption == kTransport_UDP_RMP;
}

inline bool Binding::IsUnreliableUDPTransport() const
Expand Down
Loading