From b9b57cc9e2183ac0abfc185e030594d1a901e057 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Tue, 6 Nov 2018 12:48:08 +0800 Subject: [PATCH] [core] rename UDP proxy to UDP forward (#3266) Thread defines UDP proxy as a feature to allow secure, two-way communication of Thread Management Commands between the Commissioner and any Thread Device in the Thread Network via the Border Agent. This commit renames the existing UDP proxy feature which forwards UDP packets back and forth between Host and NCP to UDP forward. --- .travis/script.sh | 2 +- configure.ac | 30 +++++++++++++-------------- examples/Makefile-posix | 2 +- examples/common-switches.mk | 4 ++-- include/openthread-config-android.h | 6 +++--- include/openthread/udp.h | 32 ++++++++++++++--------------- src/core/api/udp_api.cpp | 18 ++++++++-------- src/core/meshcop/border_agent.cpp | 8 ++++---- src/core/meshcop/border_agent.hpp | 8 ++++---- src/core/net/udp6.cpp | 8 ++++---- src/core/net/udp6.hpp | 20 +++++++++--------- src/ncp/ncp_base.cpp | 8 ++++---- src/ncp/ncp_base.hpp | 16 +++++++-------- src/ncp/ncp_base_dispatcher.cpp | 6 +++--- src/ncp/ncp_base_mtd.cpp | 26 +++++++++++------------ src/ncp/spinel.c | 8 ++++---- src/ncp/spinel.h | 10 ++++----- src/posix/Makefile-posix | 2 +- 18 files changed, 107 insertions(+), 107 deletions(-) diff --git a/.travis/script.sh b/.travis/script.sh index a0ddb2564..a172d5ee4 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -76,7 +76,7 @@ python --version || die --enable-raw-link-api \ --enable-service \ --enable-sntp-client \ - --enable-udp-proxy \ + --enable-udp-forward \ --with-examples=posix || die scan-build --status-bugs -analyze-headers -v make || die diff --git a/configure.ac b/configure.ac index bec4bc51c..b0953ea2f 100644 --- a/configure.ac +++ b/configure.ac @@ -674,36 +674,36 @@ AC_MSG_CHECKING([should NCP support UART]) AC_MSG_RESULT([${OPENTHREAD_ENABLE_UART}]) # -# Thread UDP Proxy +# Thread UDP forward # -AC_MSG_CHECKING([whether to enable UDP proxy]) -AC_ARG_ENABLE(udp_proxy, - [AS_HELP_STRING([--enable-udp-proxy], [Enable UDP proxy support @<:@default=no@:>@.])], +AC_MSG_CHECKING([whether to enable UDP forward]) +AC_ARG_ENABLE(udp_forward, + [AS_HELP_STRING([--enable-udp-forward], [Enable UDP forward support @<:@default=no@:>@.])], [ case "${enableval}" in no|yes) - enable_udp_proxy=${enableval} + enable_udp_forward=${enableval} ;; *) - AC_MSG_ERROR([Invalid value ${enable_udp_proxy} for --enable-udp-proxy]) + AC_MSG_ERROR([Invalid value ${enable_udp_forward} for --enable-udp-forward]) ;; esac ], - [enable_udp_proxy=no]) + [enable_udp_forward=no]) -if test "$enable_udp_proxy" = "yes"; then - OPENTHREAD_ENABLE_UDP_PROXY=1 +if test "$enable_udp_forward" = "yes"; then + OPENTHREAD_ENABLE_UDP_FORWARD=1 else - OPENTHREAD_ENABLE_UDP_PROXY=0 + OPENTHREAD_ENABLE_UDP_FORWARD=0 fi -AC_MSG_RESULT(${enable_udp_proxy}) -AC_SUBST(OPENTHREAD_ENABLE_UDP_PROXY) -AM_CONDITIONAL([OPENTHREAD_ENABLE_UDP_PROXY], [test "${enable_udp_proxy}" = "yes"]) -AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_UDP_PROXY], [${OPENTHREAD_ENABLE_UDP_PROXY}], [Define to 1 to enable the UDP proxy feature.]) +AC_MSG_RESULT(${enable_udp_forward}) +AC_SUBST(OPENTHREAD_ENABLE_UDP_FORWARD) +AM_CONDITIONAL([OPENTHREAD_ENABLE_UDP_FORWARD], [test "${enable_udp_forward}" = "yes"]) +AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_UDP_FORWARD], [${OPENTHREAD_ENABLE_UDP_FORWARD}], [Define to 1 to enable the UDP forward feature.]) # # Thread Border Agent @@ -1930,7 +1930,7 @@ AC_MSG_NOTICE([ OpenThread Multiple Instances support : ${enable_multiple_instances} OpenThread MTD Network Diagnostic support : ${enable_mtd_network_diagnostic} OpenThread builtin mbedtls support : ${enable_builtin_mbedtls} - OpenThread UDP Proxy support : ${enable_udp_proxy} + OpenThread UDP forward support : ${enable_udp_forward} OpenThread Commissioner support : ${enable_commissioner} OpenThread Joiner support : ${enable_joiner} OpenThread DTLS support : ${enable_dtls} diff --git a/examples/Makefile-posix b/examples/Makefile-posix index 4d30e08fe..7431a928e 100644 --- a/examples/Makefile-posix +++ b/examples/Makefile-posix @@ -69,7 +69,7 @@ configure_OPTIONS = \ --enable-radio-only \ --enable-raw-link-api \ --enable-service \ - --enable-udp-proxy \ + --enable-udp-forward \ --with-examples=posix \ $(NULL) diff --git a/examples/common-switches.mk b/examples/common-switches.mk index 674a6afbf..944043514 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -123,8 +123,8 @@ ifeq ($(SNTP_CLIENT),1) configure_OPTIONS += --enable-sntp-client endif -ifeq ($(UDP_PROXY),1) -configure_OPTIONS += --enable-udp-proxy +ifeq ($(UDP_FORWARD),1) +configure_OPTIONS += --enable-udp-forward endif ifeq ($(DEBUG_UART),1) diff --git a/include/openthread-config-android.h b/include/openthread-config-android.h index 533b0fbc5..c2135caee 100644 --- a/include/openthread-config-android.h +++ b/include/openthread-config-android.h @@ -78,7 +78,7 @@ #define HAVE__BOOL 1 /* Define to the sub-directory in which libtool stores uninstalled libraries. - */ + */ #define LT_OBJDIR ".libs/" /* Define to 1 if your C compiler doesn't accept -c and -o together. */ @@ -160,8 +160,8 @@ /* Define to 1 if you want to enable Service */ #define OPENTHREAD_ENABLE_SERVICE 1 -/* Define to 1 to enable the UDP proxy feature. */ -#define OPENTHREAD_ENABLE_UDP_PROXY 1 +/* Define to 1 to enable the UDP forward feature. */ +#define OPENTHREAD_ENABLE_UDP_FORWARD 1 /* OpenThread examples */ #define OPENTHREAD_EXAMPLES none diff --git a/include/openthread/udp.h b/include/openthread/udp.h index 5a865cf8e..6f0506c12 100644 --- a/include/openthread/udp.h +++ b/include/openthread/udp.h @@ -209,12 +209,12 @@ otError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo */ /** - * @addtogroup api-udp-proxy + * @addtogroup api-udp-forward * * @brief - * This module includes functions for UDP proxy feature. + * This module includes functions for UDP forward feature. * - * The functions in this module are available when udp-proxy feature (`OPENTHREAD_ENABLE_UDP_PROXY`) is enabled. + * The functions in this module are available when udp-forward feature (`OPENTHREAD_ENABLE_UDP_FORWARD`) is enabled. * * @{ * @@ -230,21 +230,21 @@ otError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo * @param[in] aContext A pointer to application-specific context. * */ -typedef void (*otUdpProxySender)(otMessage * aMessage, - uint16_t aPeerPort, - otIp6Address *aPeerAddr, - uint16_t aSockPort, - void * aContext); +typedef void (*otUdpForwarder)(otMessage * aMessage, + uint16_t aPeerPort, + otIp6Address *aPeerAddr, + uint16_t aSockPort, + void * aContext); /** - * Set UDP proxy callback to deliever UDP packets to host. + * Set UDP forward callback to deliever UDP packets to host. * * @param[in] aInstance A pointer to an OpenThread instance. - * @param[in] aSender A pointer to a function called to deliver UDP packet to host. + * @param[in] aForwarder A pointer to a function called to forward UDP packet to host. * @param[in] aContext A pointer to application-specific context. * */ -void otUdpProxySetSender(otInstance *aInstance, otUdpProxySender aSender, void *aContext); +void otUdpForwardSetForwarder(otInstance *aInstance, otUdpForwarder aForwarder, void *aContext); /** * Handle a UDP packet received from host. @@ -258,11 +258,11 @@ void otUdpProxySetSender(otInstance *aInstance, otUdpProxySender aSender, void * * @warning No matter the call success or fail, the message is freed. * */ -void otUdpProxyReceive(otInstance * aInstance, - otMessage * aMessage, - uint16_t aPeerPort, - const otIp6Address *aPeerAddr, - uint16_t aSockPort); +void otUdpForwardReceive(otInstance * aInstance, + otMessage * aMessage, + uint16_t aPeerPort, + const otIp6Address *aPeerAddr, + uint16_t aSockPort); /** * This function gets the existing UDP Sockets. diff --git a/src/core/api/udp_api.cpp b/src/core/api/udp_api.cpp index 1a1ef9bd7..b1e2a54e6 100644 --- a/src/core/api/udp_api.cpp +++ b/src/core/api/udp_api.cpp @@ -95,20 +95,20 @@ otError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo return socket.SendTo(*static_cast(aMessage), *static_cast(aMessageInfo)); } -#if OPENTHREAD_ENABLE_UDP_PROXY -void otUdpProxySetSender(otInstance *aInstance, otUdpProxySender aSender, void *aContext) +#if OPENTHREAD_ENABLE_UDP_FORWARD +void otUdpForwardSetForwarder(otInstance *aInstance, otUdpForwarder aForwarder, void *aContext) { Instance &instance = *static_cast(aInstance); Ip6::Ip6 &ip6 = instance.Get(); - ip6.GetUdp().SetProxySender(aSender, aContext); + ip6.GetUdp().SetUdpForwarder(aForwarder, aContext); } -void otUdpProxyReceive(otInstance * aInstance, - otMessage * aMessage, - uint16_t aPeerPort, - const otIp6Address *aPeerAddr, - uint16_t aSockPort) +void otUdpForwardReceive(otInstance * aInstance, + otMessage * aMessage, + uint16_t aPeerPort, + const otIp6Address *aPeerAddr, + uint16_t aSockPort) { Ip6::MessageInfo messageInfo; Instance & instance = *static_cast(aInstance); @@ -126,7 +126,7 @@ void otUdpProxyReceive(otInstance * aInstance, static_cast(aMessage)->Free(); } -#endif // OPENTHREAD_ENABLE_UDP_PROXY +#endif // OPENTHREAD_ENABLE_UDP_FORWARD #if OPENTHREAD_ENABLE_PLATFORM_UDP otUdpSocket *otUdpGetSockets(otInstance *aInstance) diff --git a/src/core/meshcop/border_agent.cpp b/src/core/meshcop/border_agent.cpp index 7ea0a8ea1..000acff45 100644 --- a/src/core/meshcop/border_agent.cpp +++ b/src/core/meshcop/border_agent.cpp @@ -214,7 +214,7 @@ void BorderAgent::HandleCoapResponse(void * aContext, netif.GetMle().GetCommissionerAloc(borderAgent.mCommissionerAloc.GetAddress(), sessionIdTlv.GetCommissionerSessionId()); netif.AddUnicastAddress(borderAgent.mCommissionerAloc); - netif.GetIp6().GetUdp().AddReceiver(borderAgent.mProxyReceiver); + netif.GetIp6().GetUdp().AddReceiver(borderAgent.mUdpReceiver); } } @@ -311,7 +311,7 @@ BorderAgent::BorderAgent(Instance &aInstance) , mPendingGet(OT_URI_PATH_PENDING_GET, BorderAgent::HandleRequest<&BorderAgent::mPendingGet>, this) , mPendingSet(OT_URI_PATH_PENDING_SET, BorderAgent::HandleRequest<&BorderAgent::mPendingSet>, this) , mProxyTransmit(OT_URI_PATH_PROXY_TX, BorderAgent::HandleRequest<&BorderAgent::mProxyTransmit>, this) - , mProxyReceiver(BorderAgent::HandleProxyReceive, this) + , mUdpReceiver(BorderAgent::HandleUdpReceive, this) , mTimer(aInstance, HandleTimeout, this) , mState(OT_BORDER_AGENT_STATE_STOPPED) { @@ -364,7 +364,7 @@ exit: } } -bool BorderAgent::HandleProxyReceive(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo) +bool BorderAgent::HandleUdpReceive(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo) { Coap::Header header; otError error; @@ -633,7 +633,7 @@ void BorderAgent::HandleConnected(bool aConnected) Coap::CoapSecure &coaps = netif.GetCoapSecure(); otLogInfoMeshCoP("Commissioner disconnected"); - netif.GetIp6().GetUdp().RemoveReceiver(mProxyReceiver); + netif.GetIp6().GetUdp().RemoveReceiver(mUdpReceiver); netif.RemoveUnicastAddress(mCommissionerAloc); coaps.Stop(); SetState(OT_BORDER_AGENT_STATE_STARTED); diff --git a/src/core/meshcop/border_agent.hpp b/src/core/meshcop/border_agent.hpp index 8b63e53cf..be73e12ea 100644 --- a/src/core/meshcop/border_agent.hpp +++ b/src/core/meshcop/border_agent.hpp @@ -124,12 +124,12 @@ private: void HandleRelayTransmit(const Coap::Header &aHeader, const Message &aMessage); void HandleRelayReceive(const Coap::Header &aHeader, const Message &aMessage); void HandleProxyTransmit(const Coap::Header &aHeader, const Message &aMessage); - static bool HandleProxyReceive(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo) + static bool HandleUdpReceive(void *aContext, const otMessage *aMessage, const otMessageInfo *aMessageInfo) { - return static_cast(aContext)->HandleProxyReceive( + return static_cast(aContext)->HandleUdpReceive( *static_cast(aMessage), *static_cast(aMessageInfo)); } - bool HandleProxyReceive(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo); + bool HandleUdpReceive(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo); void SetState(otBorderAgentState aState); @@ -154,7 +154,7 @@ private: Coap::Resource mPendingSet; Coap::Resource mProxyTransmit; - Ip6::UdpReceiver mProxyReceiver; ///< The UDP receiver to handle proxy packets to Commissioner + Ip6::UdpReceiver mUdpReceiver; ///< The UDP receiver to receive packets from external commissioner Ip6::NetifUnicastAddress mCommissionerAloc; TimerMilli mTimer; diff --git a/src/core/net/udp6.cpp b/src/core/net/udp6.cpp index bd8e9efd1..ddb67f9b8 100644 --- a/src/core/net/udp6.cpp +++ b/src/core/net/udp6.cpp @@ -308,12 +308,12 @@ otError Udp::SendDatagram(Message &aMessage, MessageInfo &aMessageInfo, IpProto { otError error = OT_ERROR_NONE; -#if OPENTHREAD_ENABLE_UDP_PROXY +#if OPENTHREAD_ENABLE_UDP_FORWARD if (aMessageInfo.GetInterfaceId() == OT_NETIF_INTERFACE_ID_HOST) { - VerifyOrExit(mProxySender != NULL, error = OT_ERROR_NO_ROUTE); - mProxySender(&aMessage, aMessageInfo.mPeerPort, &aMessageInfo.GetPeerAddr(), aMessageInfo.mSockPort, - mProxySenderContext); + VerifyOrExit(mUdpForwarder != NULL, error = OT_ERROR_NO_ROUTE); + mUdpForwarder(&aMessage, aMessageInfo.mPeerPort, &aMessageInfo.GetPeerAddr(), aMessageInfo.mSockPort, + mUdpForwarderContext); // message is consumed by the callback } else diff --git a/src/core/net/udp6.hpp b/src/core/net/udp6.hpp index 5475dc884..470d038e7 100644 --- a/src/core/net/udp6.hpp +++ b/src/core/net/udp6.hpp @@ -326,20 +326,20 @@ public: otUdpSocket *GetUdpSockets(void) { return mSockets; } #endif -#if OPENTHREAD_ENABLE_UDP_PROXY +#if OPENTHREAD_ENABLE_UDP_FORWARD /** - * This method sets the proxy sender. + * This method sets the forward sender. * - * @param[in] aSender A function pointer to send the proxy UDP packet. + * @param[in] aForwarder A function pointer to forward UDP packets. * @param[in] aContext A pointer to arbitrary context information. * */ - void SetProxySender(otUdpProxySender aSender, void *aContext) + void SetUdpForwarder(otUdpForwarder aForwarder, void *aContext) { - mProxySender = aSender; - mProxySenderContext = aContext; + mUdpForwarder = aForwarder; + mUdpForwarderContext = aContext; } -#endif // OPENTHREAD_ENABLE_UDP_PROXY +#endif // OPENTHREAD_ENABLE_UDP_FORWARD private: enum @@ -351,9 +351,9 @@ private: uint16_t mEphemeralPort; UdpReceiver *mReceivers; UdpSocket * mSockets; -#if OPENTHREAD_ENABLE_UDP_PROXY - void * mProxySenderContext; - otUdpProxySender mProxySender; +#if OPENTHREAD_ENABLE_UDP_FORWARD + void * mUdpForwarderContext; + otUdpForwarder mUdpForwarder; #endif }; diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 2844a5032..c6bad5da9 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -270,8 +270,8 @@ NcpBase::NcpBase(Instance *aInstance) otSetStateChangedCallback(mInstance, &NcpBase::HandleStateChanged, this); otIp6SetReceiveCallback(mInstance, &NcpBase::HandleDatagramFromStack, this); otIp6SetReceiveFilterEnabled(mInstance, true); -#if OPENTHREAD_ENABLE_UDP_PROXY - otUdpProxySetSender(mInstance, &NcpBase::HandleUdpProxyStream, this); +#if OPENTHREAD_ENABLE_UDP_FORWARD + otUdpForwardSetForwarder(mInstance, &NcpBase::HandleUdpForwardStream, this); #endif otLinkSetPcapCallback(mInstance, &NcpBase::HandleRawFrame, static_cast(this)); otIcmp6SetEchoMode(mInstance, OT_ICMP6_ECHO_HANDLER_DISABLED); @@ -1848,8 +1848,8 @@ template <> otError NcpBase::HandlePropertyGet(void) SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_JOINER)); #endif -#if OPENTHREAD_ENABLE_UDP_PROXY - SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_UDP_PROXY)); +#if OPENTHREAD_ENABLE_UDP_FORWARD + SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_UDP_FORWARD)); #endif #endif // OPENTHREAD_MTD || OPENTHREAD_FTD diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index 98230d059..c0c1b8246 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -316,14 +316,14 @@ protected: bool aAllowEmptyValues = false); #endif -#if OPENTHREAD_ENABLE_UDP_PROXY - static void HandleUdpProxyStream(otMessage * aMessage, - uint16_t aPeerPort, - otIp6Address *aPeerAddr, - uint16_t aSockPort, - void * aContext); - void HandleUdpProxyStream(otMessage *aMessage, uint16_t aPeerPort, otIp6Address &aPeerAddr, uint16_t aPort); -#endif // OPENTHREAD_ENABLE_UDP_PROXY +#if OPENTHREAD_ENABLE_UDP_FORWARD + static void HandleUdpForwardStream(otMessage * aMessage, + uint16_t aPeerPort, + otIp6Address *aPeerAddr, + uint16_t aSockPort, + void * aContext); + void HandleUdpForwardStream(otMessage *aMessage, uint16_t aPeerPort, otIp6Address &aPeerAddr, uint16_t aPort); +#endif // OPENTHREAD_ENABLE_UDP_FORWARD #endif // OPENTHREAD_MTD || OPENTHREAD_FTD otError CommandHandler_NOOP(uint8_t aHeader); diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index 25bfdb77f..d1a28ebc5 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -854,9 +854,9 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) handler = &NcpBase::HandlePropertySet; break; #endif -#if OPENTHREAD_ENABLE_UDP_PROXY - case SPINEL_PROP_THREAD_UDP_PROXY_STREAM: - handler = &NcpBase::HandlePropertySet; +#if OPENTHREAD_ENABLE_UDP_FORWARD + case SPINEL_PROP_THREAD_UDP_FORWARD_STREAM: + handler = &NcpBase::HandlePropertySet; break; #endif case SPINEL_PROP_THREAD_ACTIVE_DATASET: diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index cb3234167..815b6c0ee 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -2842,8 +2842,8 @@ exit: return error; } -#if OPENTHREAD_ENABLE_UDP_PROXY -template <> otError NcpBase::HandlePropertySet(void) +#if OPENTHREAD_ENABLE_UDP_FORWARD +template <> otError NcpBase::HandlePropertySet(void) { const uint8_t * framePtr = NULL; uint16_t frameLen = 0; @@ -2864,9 +2864,9 @@ template <> otError NcpBase::HandlePropertySet(frameLen))); - otUdpProxyReceive(mInstance, message, peerPort, peerAddr, sockPort); + otUdpForwardReceive(mInstance, message, peerPort, peerAddr, sockPort); - // `otUdpProxyReceive()` takes ownership of `message` (in both success + // `otUdpForwardReceive()` takes ownership of `message` (in both success // or failure cases). `message` is set to NULL so it is not freed at // exit. message = NULL; @@ -2880,21 +2880,21 @@ exit: return error; } -void NcpBase::HandleUdpProxyStream(otMessage * aMessage, - uint16_t aPeerPort, - otIp6Address *aPeerAddr, - uint16_t aSockPort, - void * aContext) +void NcpBase::HandleUdpForwardStream(otMessage * aMessage, + uint16_t aPeerPort, + otIp6Address *aPeerAddr, + uint16_t aSockPort, + void * aContext) { - static_cast(aContext)->HandleUdpProxyStream(aMessage, aPeerPort, *aPeerAddr, aSockPort); + static_cast(aContext)->HandleUdpForwardStream(aMessage, aPeerPort, *aPeerAddr, aSockPort); } -void NcpBase::HandleUdpProxyStream(otMessage *aMessage, uint16_t aPeerPort, otIp6Address &aPeerAddr, uint16_t aPort) +void NcpBase::HandleUdpForwardStream(otMessage *aMessage, uint16_t aPeerPort, otIp6Address &aPeerAddr, uint16_t aPort) { uint16_t length = otMessageGetLength(aMessage); uint8_t header = SPINEL_HEADER_FLAG | SPINEL_HEADER_IID_0; - SuccessOrExit(mEncoder.BeginFrame(header, SPINEL_CMD_PROP_VALUE_IS, SPINEL_PROP_THREAD_UDP_PROXY_STREAM)); + SuccessOrExit(mEncoder.BeginFrame(header, SPINEL_CMD_PROP_VALUE_IS, SPINEL_PROP_THREAD_UDP_FORWARD_STREAM)); SuccessOrExit(mEncoder.WriteUint16(length)); SuccessOrExit(mEncoder.WriteMessage(aMessage)); @@ -2916,7 +2916,7 @@ exit: otMessageFree(aMessage); } } -#endif // OPENTHREAD_ENABLE_UDP_PROXY +#endif // OPENTHREAD_ENABLE_UDP_FORWARD // ---------------------------------------------------------------------------- // MARK: Property/Status Changed diff --git a/src/ncp/spinel.c b/src/ncp/spinel.c index 86ce2541c..534dc18d7 100644 --- a/src/ncp/spinel.c +++ b/src/ncp/spinel.c @@ -1602,8 +1602,8 @@ const char *spinel_prop_key_to_cstr(spinel_prop_key_t prop_key) ret = "THREAD_TMF_PROXY_STREAM"; break; - case SPINEL_PROP_THREAD_UDP_PROXY_STREAM: - ret = "THREAD_UDP_PROXY_STREAM"; + case SPINEL_PROP_THREAD_UDP_FORWARD_STREAM: + ret = "THREAD_UDP_FORWARD_STREAM"; break; case SPINEL_PROP_THREAD_DISCOVERY_SCAN_JOINER_FLAG: @@ -2467,8 +2467,8 @@ const char *spinel_capability_to_cstr(unsigned int capability) ret = "THREAD_TMF_PROXY"; break; - case SPINEL_CAP_THREAD_UDP_PROXY: - ret = "THREAD_UDP_PROXY"; + case SPINEL_CAP_THREAD_UDP_FORWARD: + ret = "THREAD_UDP_FORWARD"; break; case SPINEL_CAP_THREAD_JOINER: diff --git a/src/ncp/spinel.h b/src/ncp/spinel.h index 8878d947f..710159384 100644 --- a/src/ncp/spinel.h +++ b/src/ncp/spinel.h @@ -765,7 +765,7 @@ enum SPINEL_CAP_THREAD__BEGIN = 1024, SPINEL_CAP_THREAD_COMMISSIONER = (SPINEL_CAP_THREAD__BEGIN + 0), SPINEL_CAP_THREAD_TMF_PROXY = (SPINEL_CAP_THREAD__BEGIN + 1), - SPINEL_CAP_THREAD_UDP_PROXY = (SPINEL_CAP_THREAD__BEGIN + 2), + SPINEL_CAP_THREAD_UDP_FORWARD = (SPINEL_CAP_THREAD__BEGIN + 2), SPINEL_CAP_THREAD_JOINER = (SPINEL_CAP_THREAD__BEGIN + 3), SPINEL_CAP_THREAD__END = 1152, @@ -1497,7 +1497,7 @@ typedef enum /** Format `dSS` * Required capability: `SPINEL_CAP_THREAD_TMF_PROXY` * - * This property is deprecated. Please see `SPINEL_PROP_THREAD_UDP_PROXY_STREAM`. + * This property is deprecated. Please see `SPINEL_PROP_THREAD_UDP_FORWARD_STREAM`. * */ SPINEL_PROP_THREAD_TMF_PROXY_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 18, @@ -1764,9 +1764,9 @@ typedef enum */ SPINEL_PROP_THREAD_ADDRESS_CACHE_TABLE = SPINEL_PROP_THREAD_EXT__BEGIN + 35, - /// Thread UDP proxy stream + /// Thread UDP forward stream /** Format `dS6S` - * Required capability: `SPINEL_CAP_THREAD_UDP_PROXY` + * Required capability: `SPINEL_CAP_THREAD_UDP_FORWARD` * * This property helps exchange UDP packets with host. * @@ -1776,7 +1776,7 @@ typedef enum * `S`: Local UDP port * */ - SPINEL_PROP_THREAD_UDP_PROXY_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 36, + SPINEL_PROP_THREAD_UDP_FORWARD_STREAM = SPINEL_PROP_THREAD_EXT__BEGIN + 36, /// Send MGMT_GET Thread Active Operational Dataset /** Format: `A(t(iD))` - Write only diff --git a/src/posix/Makefile-posix b/src/posix/Makefile-posix index 241995bd3..579e08bab 100644 --- a/src/posix/Makefile-posix +++ b/src/posix/Makefile-posix @@ -65,7 +65,7 @@ configure_OPTIONS = \ --enable-mac-filter \ --enable-posix-app \ --enable-service \ - --enable-udp-proxy \ + --enable-udp-forward \ --with-ncp-bus=uart \ $(NULL)