diff --git a/examples/drivers/windows/otLwf/datapath.c b/examples/drivers/windows/otLwf/datapath.c index 63146a8ee..82ab6c690 100644 --- a/examples/drivers/windows/otLwf/datapath.c +++ b/examples/drivers/windows/otLwf/datapath.c @@ -420,7 +420,7 @@ N.B.: It is important to check the ReceiveFlags in NDIS_TEST_RECEIVE_CANNOT_PEND // delivery to TCPIP. void otLwfReceiveIp6DatagramCallback( - _In_ otMessage aMessage, + _In_ otMessage *aMessage, _In_ void *aContext ) { diff --git a/examples/drivers/windows/otLwf/thread.h b/examples/drivers/windows/otLwf/thread.h index 965349c55..d2594318a 100644 --- a/examples/drivers/windows/otLwf/thread.h +++ b/examples/drivers/windows/otLwf/thread.h @@ -146,7 +146,7 @@ otLwfEventProcessingIndicateEnergyScanResult( // void otLwfStateChangedCallback(uint32_t aFlags, _In_ void *aContext); -void otLwfReceiveIp6DatagramCallback(_In_ otMessage aMessage, _In_ void *aContext); +void otLwfReceiveIp6DatagramCallback(_In_ otMessage *aMessage, _In_ void *aContext); void otLwfActiveScanCallback(_In_ otActiveScanResult *aResult, _In_ void *aContext); void otLwfEnergyScanCallback(_In_ otEnergyScanResult *aResult, _In_ void *aContext); void otLwfDiscoverCallback(_In_ otActiveScanResult *aResult, _In_ void *aContext); diff --git a/include/openthread/coap.h b/include/openthread/coap.h index 57bf9c606..8afb34de7 100644 --- a/include/openthread/coap.h +++ b/include/openthread/coap.h @@ -154,7 +154,7 @@ typedef struct otCoapHeader * @retval kThreadError_ResponseTimeout No response or acknowledgment received during timeout period. * */ -typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); /** @@ -166,7 +166,7 @@ typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otM * @param[in] aMessageInfo A pointer to the message info for @p aMessage. * */ -typedef void (*otCoapRequestHandler)(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +typedef void (*otCoapRequestHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); /** @@ -372,7 +372,7 @@ const otCoapOption *otCoapHeaderGetNextOption(otCoapHeader *aHeader); * @returns A pointer to the message or NULL if failed to allocate message. * */ -otMessage otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader); +otMessage *otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader); /** * This function sends a CoAP request. @@ -390,7 +390,7 @@ otMessage otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader); * @retval kThreadError_NoBufs Failed to allocate retransmission data. * */ -ThreadError otCoapSendRequest(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo, +ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext); /** @@ -456,7 +456,7 @@ void otCoapServerRemoveResource(otInstance *aInstance, otCoapResource *aResource * @retval kThreadError_NoBufs Insufficient buffers available to send the CoAP response. * */ -ThreadError otCoapSendResponse(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo); +ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo); #endif // OPENTHREAD_ENABLE_APPLICATION_COAP /** diff --git a/include/openthread/icmp6.h b/include/openthread/icmp6.h index f6edab143..0517cfc26 100644 --- a/include/openthread/icmp6.h +++ b/include/openthread/icmp6.h @@ -96,7 +96,7 @@ ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandl * May be zero. * */ -ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage aMessage, +ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, uint16_t aIdentifier); /** diff --git a/include/openthread/ip6.h b/include/openthread/ip6.h index cf910da1a..97d8fe0f3 100644 --- a/include/openthread/ip6.h +++ b/include/openthread/ip6.h @@ -241,7 +241,7 @@ ThreadError otIp6CreateSemanticallyOpaqueIid(otInstance *aInstance, otNetifAddre * * @sa otFreeMessage */ -otMessage otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled); +otMessage *otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled); /** * This function pointer is called when an IPv6 datagram is received. @@ -250,7 +250,7 @@ otMessage otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled); * @param[in] aContext A pointer to application-specific context. * */ -typedef void (*otIp6ReceiveCallback)(otMessage aMessage, void *aContext); +typedef void (*otIp6ReceiveCallback)(otMessage *aMessage, void *aContext); /** * This function registers a callback to provide received IPv6 datagrams. @@ -303,7 +303,7 @@ void otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled); * @param[in] aMessage A pointer to the message buffer containing the IPv6 datagram. * */ -ThreadError otIp6Send(otInstance *aInstance, otMessage aMessage); +ThreadError otIp6Send(otInstance *aInstance, otMessage *aMessage); /** * This function adds a port to the allowed unsecured port list. diff --git a/include/openthread/message.h b/include/openthread/message.h index c09d67b8d..367f4b379 100644 --- a/include/openthread/message.h +++ b/include/openthread/message.h @@ -66,7 +66,7 @@ extern "C" { * @sa otMessageRead * @sa otMessageWrite */ -ThreadError otMessageFree(otMessage aMessage); +ThreadError otMessageFree(otMessage *aMessage); /** * Get the message length in bytes. @@ -84,7 +84,7 @@ ThreadError otMessageFree(otMessage aMessage); * @sa otMessageWrite * @sa otMessageSetLength */ -uint16_t otMessageGetLength(otMessage aMessage); +uint16_t otMessageGetLength(otMessage *aMessage); /** * Set the message length in bytes. @@ -103,7 +103,7 @@ uint16_t otMessageGetLength(otMessage aMessage); * @sa otMessageRead * @sa otMessageWrite */ -ThreadError otMessageSetLength(otMessage aMessage, uint16_t aLength); +ThreadError otMessageSetLength(otMessage *aMessage, uint16_t aLength); /** * Get the message offset in bytes. @@ -120,7 +120,7 @@ ThreadError otMessageSetLength(otMessage aMessage, uint16_t aLength); * @sa otMessageRead * @sa otMessageWrite */ -uint16_t otMessageGetOffset(otMessage aMessage); +uint16_t otMessageGetOffset(otMessage *aMessage); /** * Set the message offset in bytes. @@ -139,7 +139,7 @@ uint16_t otMessageGetOffset(otMessage aMessage); * @sa otMessageRead * @sa otMessageWrite */ -ThreadError otMessageSetOffset(otMessage aMessage, uint16_t aOffset); +ThreadError otMessageSetOffset(otMessage *aMessage, uint16_t aOffset); /** * This function indicates whether or not link security is enabled for the message. @@ -150,7 +150,7 @@ ThreadError otMessageSetOffset(otMessage aMessage, uint16_t aOffset); * @retval FALSE If link security is not enabled. * */ -bool otMessageIsLinkSecurityEnabled(otMessage aMessage); +bool otMessageIsLinkSecurityEnabled(otMessage *aMessage); /** * This function sets/forces the message to be forwarded using direct transmission. @@ -161,7 +161,7 @@ bool otMessageIsLinkSecurityEnabled(otMessage aMessage); * follow the normal procedure. * */ -void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled); +void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled); /** * Append bytes to a message. @@ -181,7 +181,7 @@ void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled); * @sa otMessageRead * @sa otMessageWrite */ -ThreadError otMessageAppend(otMessage aMessage, const void *aBuf, uint16_t aLength); +ThreadError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength); /** * Read bytes from a message. @@ -201,7 +201,7 @@ ThreadError otMessageAppend(otMessage aMessage, const void *aBuf, uint16_t aLeng * @sa otMessageSetOffset * @sa otMessageWrite */ -int otMessageRead(otMessage aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength); +int otMessageRead(otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength); /** * Write bytes to a message. @@ -221,7 +221,7 @@ int otMessageRead(otMessage aMessage, uint16_t aOffset, void *aBuf, uint16_t aLe * @sa otMessageSetOffset * @sa otMessageRead */ -int otMessageWrite(otMessage aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength); +int otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength); /** * This structure represents an OpenThread message queue. @@ -254,7 +254,7 @@ void otMessageQueueInit(otMessageQueue *aQueue); * @retval kThreadError_Already The message is already enqueued in a queue. * */ -ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage aMessage); +ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage); /** * This function removes a message from the given message queue. @@ -266,7 +266,7 @@ ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage aMessage); * @retval kThreadError_NotFound The message is not enqueued in this queue. * */ -ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage aMessage); +ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage); /** * This function returns a pointer to the message at the head of the queue. @@ -276,7 +276,7 @@ ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage aMessage); * @returns A pointer to the message at the head of queue or NULL if queue is empty. * */ -otMessage otMessageQueueGetHead(otMessageQueue *aQueue); +otMessage *otMessageQueueGetHead(otMessageQueue *aQueue); /** * This function returns a pointer to the next message in the queue by iterating forward (from head to tail). @@ -288,7 +288,7 @@ otMessage otMessageQueueGetHead(otMessageQueue *aQueue); * NULL is returned if `aMessage` is not in the queue `aQueue`. * */ -otMessage otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage aMessage); +otMessage *otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage *aMessage); /** * Get the Message Buffer information. diff --git a/include/openthread/platform/messagepool.h b/include/openthread/platform/messagepool.h index 158990cec..f0fae800b 100644 --- a/include/openthread/platform/messagepool.h +++ b/include/openthread/platform/messagepool.h @@ -39,6 +39,8 @@ #include "openthread/types.h" +#include "openthread/message.h" + /** * @defgroup messagepool MessagePool * @ingroup platform @@ -50,15 +52,6 @@ * */ -/** - * This structure contains a pointer to the next Message buffer. - * - */ -struct BufferHeader -{ - struct BufferHeader *mNext; ///< A pointer to the next Message buffer. -}; - #ifdef __cplusplus extern "C" { #endif @@ -78,7 +71,7 @@ void otPlatMessagePoolInit(uint16_t aMinNumFreeBuffers, size_t aBufferSize); * @returns A pointer to the Buffer or NULL if no Buffers are available. * */ -struct BufferHeader *otPlatMessagePoolNew(void); +otMessage *otPlatMessagePoolNew(void); /** * This function is used to free a Buffer back to the platform managed buffer pool. @@ -86,7 +79,7 @@ struct BufferHeader *otPlatMessagePoolNew(void); * @param[in] aBuffer The Buffer to free. * */ -void otPlatMessagePoolFree(struct BufferHeader *aBuffer); +void otPlatMessagePoolFree(otMessage *aBuffer); /** * Get the number of free buffers. diff --git a/include/openthread/thread.h b/include/openthread/thread.h index 3800af6bd..b5bacfad8 100644 --- a/include/openthread/thread.h +++ b/include/openthread/thread.h @@ -848,7 +848,7 @@ OTAPI ThreadError OTCALL otThreadGetParentAverageRssi(otInstance *aInstance, int * @param[in] aContext A pointer to application-specific context. * */ -typedef void (*otReceiveDiagnosticGetCallback)(otMessage aMessage, const otMessageInfo *aMessageInfo, +typedef void (*otReceiveDiagnosticGetCallback)(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext); /** diff --git a/include/openthread/types.h b/include/openthread/types.h index bc7246267..d58380e6d 100644 --- a/include/openthread/types.h +++ b/include/openthread/types.h @@ -347,7 +347,10 @@ typedef struct otMessageInfo /** * This type points to an OpenThread message buffer. */ -typedef void *otMessage; +typedef struct otMessage +{ + struct otMessage *mNext; ///< A pointer to the next Message buffer. +} otMessage; /** * @addtogroup commands Commands @@ -1040,7 +1043,7 @@ typedef struct otIcmp6Header otIcmp6Header; * @param[in] aIcmpHeader A pointer to the received ICMPv6 header. * */ -typedef void (*otIcmp6ReceiveCallback)(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo, +typedef void (*otIcmp6ReceiveCallback)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader); /** diff --git a/include/openthread/udp.h b/include/openthread/udp.h index afd96ca77..5aa65c92c 100644 --- a/include/openthread/udp.h +++ b/include/openthread/udp.h @@ -56,7 +56,7 @@ extern "C" { * This callback allows OpenThread to inform the application of a received UDP message. * */ -typedef void (*otUdpReceive)(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); +typedef void (*otUdpReceive)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); /** * This structure represents a UDP socket. @@ -83,7 +83,7 @@ typedef struct otUdpSocket * @sa otFreeMessage * */ -otMessage otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled); +otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled); /** * Open a UDP/IPv6 socket. @@ -149,7 +149,7 @@ ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName); * @sa otUdpSend * */ -ThreadError otUdpSend(otUdpSocket *aSocket, otMessage aMessage, const otMessageInfo *aMessageInfo); +ThreadError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo); /** * @} diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 8f478878c..122e57d8b 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1339,7 +1339,7 @@ exit: } #ifndef OTDLL -void Interpreter::s_HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo, +void Interpreter::s_HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader) { static_cast(aContext)->HandleIcmpReceive(*static_cast(aMessage), @@ -1439,7 +1439,7 @@ void Interpreter::HandlePingTimer() ThreadError error = kThreadError_None; uint32_t timestamp = HostSwap32(Timer::GetNow()); - otMessage message; + otMessage *message; const otMessageInfo *messageInfo = static_cast(&sMessageInfo); VerifyOrExit((message = otIp6NewMessage(mInstance, true)) != NULL, error = kThreadError_NoBufs); @@ -2851,7 +2851,7 @@ exit: } #ifndef OTDLL -void Interpreter::s_HandleDiagnosticGetResponse(otMessage aMessage, const otMessageInfo *aMessageInfo, +void Interpreter::s_HandleDiagnosticGetResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext) { static_cast(aContext)->HandleDiagnosticGetResponse(*static_cast(aMessage), diff --git a/src/cli/cli.hpp b/src/cli/cli.hpp index 60f9d5e2f..cf3864944 100644 --- a/src/cli/cli.hpp +++ b/src/cli/cli.hpp @@ -238,7 +238,7 @@ private: #endif #ifndef OTDLL - static void s_HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo, + static void s_HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader); static void s_HandlePingTimer(void *aContext); #endif @@ -251,7 +251,7 @@ private: void *aContext); static void OTCALL s_HandlePanIdConflict(uint16_t aPanId, uint32_t aChannelMask, void *aContext); #ifndef OTDLL - static void OTCALL s_HandleDiagnosticGetResponse(otMessage aMessage, const otMessageInfo *aMessageInfo, + static void OTCALL s_HandleDiagnosticGetResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext); #endif static void OTCALL s_HandleJoinerCallback(ThreadError aError, void *aContext); diff --git a/src/cli/cli_udp.cpp b/src/cli/cli_udp.cpp index 001fb4d8c..3c3eb3244 100644 --- a/src/cli/cli_udp.cpp +++ b/src/cli/cli_udp.cpp @@ -65,12 +65,12 @@ exit: return error; } -void Udp::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo) +void Udp::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleUdpReceive(aMessage, aMessageInfo); } -void Udp::HandleUdpReceive(otMessage aMessage, const otMessageInfo *aMessageInfo) +void Udp::HandleUdpReceive(otMessage *aMessage, const otMessageInfo *aMessageInfo) { uint16_t payloadLength = otMessageGetLength(aMessage) - otMessageGetOffset(aMessage); char buf[512]; @@ -99,7 +99,7 @@ exit: int Udp::Output(const char *aBuf, uint16_t aBufLength) { ThreadError error = kThreadError_None; - otMessage message; + otMessage *message; VerifyOrExit((message = otUdpNewMessage(mInstance, true)) != NULL, error = kThreadError_NoBufs); SuccessOrExit(error = otMessageSetLength(message, aBufLength)); diff --git a/src/cli/cli_udp.hpp b/src/cli/cli_udp.hpp index 4bcbf46fc..976ffd5e5 100644 --- a/src/cli/cli_udp.hpp +++ b/src/cli/cli_udp.hpp @@ -93,8 +93,8 @@ private: kMaxLineLength = 128, }; - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); - void HandleUdpReceive(otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); + void HandleUdpReceive(otMessage *aMessage, const otMessageInfo *aMessageInfo); otUdpSocket mSocket; otMessageInfo mPeer; diff --git a/src/core/api/coap_api.cpp b/src/core/api/coap_api.cpp index 005e465e1..c459208ef 100644 --- a/src/core/api/coap_api.cpp +++ b/src/core/api/coap_api.cpp @@ -126,12 +126,12 @@ const otCoapOption *otCoapHeaderGetNextOption(otCoapHeader *aHeader) return static_cast(static_cast(aHeader)->GetNextOption()); } -otMessage otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader) +otMessage *otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader) { return aInstance->mThreadNetif.GetCoapClient().NewMessage(*(static_cast(aHeader))); } -ThreadError otCoapSendRequest(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo, +ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext) { return aInstance->mThreadNetif.GetCoapClient().SendMessage( @@ -165,7 +165,7 @@ void otCoapServerRemoveResource(otInstance *aInstance, otCoapResource *aResource aInstance->mApplicationCoapServer.RemoveResource(*static_cast(aResource)); } -ThreadError otCoapSendResponse(otInstance *aInstance, otMessage aMessage, const otMessageInfo *aMessageInfo) +ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo) { return aInstance->mApplicationCoapServer.SendMessage( *static_cast(aMessage), *static_cast(aMessageInfo)); diff --git a/src/core/api/icmp6_api.cpp b/src/core/api/icmp6_api.cpp index 4dde16c73..6cba28d83 100644 --- a/src/core/api/icmp6_api.cpp +++ b/src/core/api/icmp6_api.cpp @@ -56,7 +56,7 @@ ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandl return aInstance->mIp6.mIcmp.RegisterHandler(*static_cast(aHandler)); } -ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage aMessage, +ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, uint16_t aIdentifier) { return aInstance->mIp6.mIcmp.SendEchoRequest(*static_cast(aMessage), diff --git a/src/core/api/ip6_api.cpp b/src/core/api/ip6_api.cpp index b4adf73c0..df2d5d88e 100644 --- a/src/core/api/ip6_api.cpp +++ b/src/core/api/ip6_api.cpp @@ -158,7 +158,7 @@ void otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled) aInstance->mIp6.SetReceiveIp6FilterEnabled(aEnabled); } -ThreadError otIp6Send(otInstance *aInstance, otMessage aMessage) +ThreadError otIp6Send(otInstance *aInstance, otMessage *aMessage) { ThreadError error; @@ -172,7 +172,7 @@ ThreadError otIp6Send(otInstance *aInstance, otMessage aMessage) return error; } -otMessage otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled) +otMessage *otIp6NewMessage(otInstance *aInstance, bool aLinkSecurityEnabled) { Message *message = aInstance->mIp6.mMessagePool.New(Message::kTypeIp6, 0); diff --git a/src/core/api/message_api.cpp b/src/core/api/message_api.cpp index c0da88a05..bcb754a55 100644 --- a/src/core/api/message_api.cpp +++ b/src/core/api/message_api.cpp @@ -41,42 +41,42 @@ using namespace Thread; extern "C" { #endif -ThreadError otMessageFree(otMessage aMessage) +ThreadError otMessageFree(otMessage *aMessage) { return static_cast(aMessage)->Free(); } -uint16_t otMessageGetLength(otMessage aMessage) +uint16_t otMessageGetLength(otMessage *aMessage) { Message *message = static_cast(aMessage); return message->GetLength(); } -ThreadError otMessageSetLength(otMessage aMessage, uint16_t aLength) +ThreadError otMessageSetLength(otMessage *aMessage, uint16_t aLength) { Message *message = static_cast(aMessage); return message->SetLength(aLength); } -uint16_t otMessageGetOffset(otMessage aMessage) +uint16_t otMessageGetOffset(otMessage *aMessage) { Message *message = static_cast(aMessage); return message->GetOffset(); } -ThreadError otMessageSetOffset(otMessage aMessage, uint16_t aOffset) +ThreadError otMessageSetOffset(otMessage *aMessage, uint16_t aOffset) { Message *message = static_cast(aMessage); return message->SetOffset(aOffset); } -bool otMessageIsLinkSecurityEnabled(otMessage aMessage) +bool otMessageIsLinkSecurityEnabled(otMessage *aMessage) { Message *message = static_cast(aMessage); return message->IsLinkSecurityEnabled(); } -void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled) +void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled) { Message *message = static_cast(aMessage); @@ -90,19 +90,19 @@ void otMessageSetDirectTransmission(otMessage aMessage, bool aEnabled) } } -ThreadError otMessageAppend(otMessage aMessage, const void *aBuf, uint16_t aLength) +ThreadError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength) { Message *message = static_cast(aMessage); return message->Append(aBuf, aLength); } -int otMessageRead(otMessage aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength) +int otMessageRead(otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength) { Message *message = static_cast(aMessage); return message->Read(aOffset, aLength, aBuf); } -int otMessageWrite(otMessage aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength) +int otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength) { Message *message = static_cast(aMessage); return message->Write(aOffset, aLength, aBuf); @@ -113,30 +113,30 @@ void otMessageQueueInit(otMessageQueue *aQueue) aQueue->mData = NULL; } -ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage aMessage) +ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage) { Message *message = static_cast(aMessage); MessageQueue *queue = static_cast(aQueue); return queue->Enqueue(*message); } -ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage aMessage) +ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage) { Message *message = static_cast(aMessage); MessageQueue *queue = static_cast(aQueue); return queue->Dequeue(*message); } -otMessage otMessageQueueGetHead(otMessageQueue *aQueue) +otMessage *otMessageQueueGetHead(otMessageQueue *aQueue) { MessageQueue *queue = static_cast(aQueue); return queue->GetHead(); } -otMessage otMessageQueueGetNext(otMessageQueue *aQueue, otMessage aMessage) +otMessage *otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage *aMessage) { Message *next; - Message *message = static_cast(aMessage); + const Message *message = static_cast(aMessage); MessageQueue *queue = static_cast(aQueue); VerifyOrExit(message != NULL, next = NULL); diff --git a/src/core/api/udp_api.cpp b/src/core/api/udp_api.cpp index ade0c7046..c45614109 100644 --- a/src/core/api/udp_api.cpp +++ b/src/core/api/udp_api.cpp @@ -41,7 +41,7 @@ using namespace Thread; extern "C" { #endif -otMessage otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled) +otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled) { Message *message = aInstance->mIp6.mUdp.NewMessage(0); @@ -91,7 +91,7 @@ ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName) return socket->Bind(*static_cast(aSockName)); } -ThreadError otUdpSend(otUdpSocket *aSocket, otMessage aMessage, const otMessageInfo *aMessageInfo) +ThreadError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo) { Ip6::UdpSocket *socket = static_cast(aSocket); return socket->SendTo(*static_cast(aMessage), diff --git a/src/core/coap/coap_base.cpp b/src/core/coap/coap_base.cpp index 2316dc2e2..65073916b 100644 --- a/src/core/coap/coap_base.cpp +++ b/src/core/coap/coap_base.cpp @@ -80,7 +80,7 @@ ThreadError CoapBase::Stop(void) return mSocket.Close(); } -void CoapBase::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo) +void CoapBase::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->mReceiver(aContext, *static_cast(aMessage), *static_cast(aMessageInfo)); diff --git a/src/core/coap/coap_base.hpp b/src/core/coap/coap_base.hpp index a9a33d651..098454aad 100644 --- a/src/core/coap/coap_base.hpp +++ b/src/core/coap/coap_base.hpp @@ -134,7 +134,7 @@ protected: ReceiverFunction mReceiver; private: - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); }; } // namespace Coap diff --git a/src/core/common/message.hpp b/src/core/common/message.hpp index d6904b2ff..d9081539b 100644 --- a/src/core/common/message.hpp +++ b/src/core/common/message.hpp @@ -121,7 +121,7 @@ struct MessageInfo * This class represents a Message buffer. * */ -class Buffer : public ::BufferHeader +class Buffer : public ::otMessage { friend class Message; @@ -138,7 +138,7 @@ public: * This method sets the pointer to the next message buffer. * */ - void SetNextBuffer(class Buffer *buf) { mNext = static_cast(buf); } + void SetNextBuffer(class Buffer *buf) { mNext = static_cast(buf); } private: /** @@ -175,7 +175,7 @@ private: enum { - kBufferDataSize = kBufferSize - sizeof(struct BufferHeader), + kBufferDataSize = kBufferSize - sizeof(struct otMessage), kHeadBufferDataSize = kBufferDataSize - sizeof(struct MessageInfo), }; @@ -194,7 +194,7 @@ private: * This class represents a message. * */ -class Message: private Buffer +class Message: public Buffer { friend class MessagePool; friend class MessageQueue; diff --git a/src/core/meshcop/commissioner.cpp b/src/core/meshcop/commissioner.cpp index 20bfb8cde..7d8944987 100644 --- a/src/core/meshcop/commissioner.cpp +++ b/src/core/meshcop/commissioner.cpp @@ -359,7 +359,7 @@ exit: return error; } -void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleMgmtCommissisonerGetResponse( @@ -461,7 +461,7 @@ exit: return error; } -void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleMgmtCommissisonerSetResponse( @@ -526,7 +526,7 @@ exit: return error; } -void Commissioner::HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleLeaderPetitionResponse( @@ -626,7 +626,7 @@ exit: return error; } -void Commissioner::HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleLeaderKeepAliveResponse( @@ -660,7 +660,7 @@ exit: otLogFuncExit(); } -void Commissioner::HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleRelayReceive( @@ -748,7 +748,7 @@ exit: otLogFuncExit(); } -void Commissioner::HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleDatasetChanged( @@ -773,7 +773,7 @@ exit: otLogFuncExit(); } -void Commissioner::HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Commissioner::HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleJoinerFinalize( diff --git a/src/core/meshcop/commissioner.hpp b/src/core/meshcop/commissioner.hpp index 72134fa65..8836b466b 100644 --- a/src/core/meshcop/commissioner.hpp +++ b/src/core/meshcop/commissioner.hpp @@ -208,32 +208,32 @@ private: static void HandleTimer(void *aContext); void HandleTimer(void); - static void HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleMgmtCommissionerSetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); void HandleMgmtCommissisonerSetResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError aResult); - static void HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleMgmtCommissionerGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); void HandleMgmtCommissisonerGetResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError aResult); - static void HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleLeaderPetitionResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); void HandleLeaderPetitionResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError aResult); - static void HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleLeaderKeepAliveResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); void HandleLeaderKeepAliveResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError aResult); - static void HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleRelayReceive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleRelayReceive(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleDatasetChanged(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleDatasetChanged(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleJoinerFinalize(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleJoinerFinalize(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/meshcop/dataset_manager.cpp b/src/core/meshcop/dataset_manager.cpp index 1fa8da227..3b61f2808 100644 --- a/src/core/meshcop/dataset_manager.cpp +++ b/src/core/meshcop/dataset_manager.cpp @@ -942,7 +942,7 @@ exit: return error; } -void ActiveDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void ActiveDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleGet( @@ -1154,7 +1154,7 @@ void PendingDatasetBase::HandleNetworkUpdate(uint8_t &aFlags) DatasetManager::HandleNetworkUpdate(aFlags); } -void PendingDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void PendingDatasetBase::HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleGet( diff --git a/src/core/meshcop/dataset_manager.hpp b/src/core/meshcop/dataset_manager.hpp index e6cd6e8b7..ebd6d2a19 100644 --- a/src/core/meshcop/dataset_manager.hpp +++ b/src/core/meshcop/dataset_manager.hpp @@ -91,7 +91,7 @@ protected: ThreadNetif &mNetif; private: - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo); static void HandleTimer(void *aContext); @@ -124,7 +124,7 @@ public: ThreadError Set(const Timestamp &aTimestamp, const Message &aMessage, uint16_t aOffset, uint8_t aLength); private: - static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleGet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); @@ -164,7 +164,7 @@ protected: uint32_t mNetworkTime; private: - static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleGet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/meshcop/dataset_manager_ftd.cpp b/src/core/meshcop/dataset_manager_ftd.cpp index a1eb63c63..973c0ab9e 100644 --- a/src/core/meshcop/dataset_manager_ftd.cpp +++ b/src/core/meshcop/dataset_manager_ftd.cpp @@ -189,7 +189,7 @@ void ActiveDataset::StopLeader(void) mNetif.GetCoapServer().RemoveResource(mResourceSet); } -void ActiveDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void ActiveDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleSet( @@ -227,7 +227,7 @@ void PendingDataset::StopLeader(void) mNetif.GetCoapServer().RemoveResource(mResourceSet); } -void PendingDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void PendingDataset::HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleSet( diff --git a/src/core/meshcop/dataset_manager_ftd.hpp b/src/core/meshcop/dataset_manager_ftd.hpp index d198a9fc0..7e437077e 100644 --- a/src/core/meshcop/dataset_manager_ftd.hpp +++ b/src/core/meshcop/dataset_manager_ftd.hpp @@ -57,7 +57,7 @@ public: void StopLeader(void); private: - static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleSet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); @@ -76,7 +76,7 @@ public: void StopLeader(void); private: - static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleSet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/meshcop/energy_scan_client.cpp b/src/core/meshcop/energy_scan_client.cpp index aec01fe36..419d72dd7 100644 --- a/src/core/meshcop/energy_scan_client.cpp +++ b/src/core/meshcop/energy_scan_client.cpp @@ -121,7 +121,7 @@ exit: return error; } -void EnergyScanClient::HandleReport(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void EnergyScanClient::HandleReport(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleReport( diff --git a/src/core/meshcop/energy_scan_client.hpp b/src/core/meshcop/energy_scan_client.hpp index ffefeb6c1..2b0232faa 100644 --- a/src/core/meshcop/energy_scan_client.hpp +++ b/src/core/meshcop/energy_scan_client.hpp @@ -79,7 +79,7 @@ public: const Ip6::Address &aAddress, otCommissionerEnergyReportCallback aCallback, void *aContext); private: - static void HandleReport(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleReport(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleReport(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index 5c3f5b9d5..f66b0de08 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -328,7 +328,7 @@ exit: otLogFuncExit(); } -void Joiner::HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Joiner::HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleJoinerFinalizeResponse( @@ -363,7 +363,7 @@ exit: otLogFuncExit(); } -void Joiner::HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Joiner::HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleJoinerEntrust( diff --git a/src/core/meshcop/joiner.hpp b/src/core/meshcop/joiner.hpp index ff191a1e8..ba41c11bb 100644 --- a/src/core/meshcop/joiner.hpp +++ b/src/core/meshcop/joiner.hpp @@ -110,12 +110,12 @@ private: void HandleSecureCoapClientConnect(bool aConnected); void SendJoinerFinalize(void); - static void HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleJoinerFinalizeResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); void HandleJoinerFinalizeResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError aResult); - static void HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleJoinerEntrust(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); void SendJoinerEntrustResponse(const Coap::Header &aRequestHeader, const Ip6::MessageInfo &aRequestInfo); diff --git a/src/core/meshcop/joiner_router.cpp b/src/core/meshcop/joiner_router.cpp index 55ee7f2c9..4443bc6b4 100644 --- a/src/core/meshcop/joiner_router.cpp +++ b/src/core/meshcop/joiner_router.cpp @@ -145,7 +145,7 @@ ThreadError JoinerRouter::SetJoinerUdpPort(uint16_t aJoinerUdpPort) return kThreadError_None; } -void JoinerRouter::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo) +void JoinerRouter::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleUdpReceive(*static_cast(aMessage), *static_cast(aMessageInfo)); @@ -226,7 +226,7 @@ exit: otLogFuncExitErr(error); } -void JoinerRouter::HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void JoinerRouter::HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleRelayTransmit( @@ -495,7 +495,7 @@ exit: return error; } -void JoinerRouter::HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void JoinerRouter::HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleJoinerEntrustResponse(static_cast(aHeader), diff --git a/src/core/meshcop/joiner_router_ftd.hpp b/src/core/meshcop/joiner_router_ftd.hpp index 5e542b396..c75571a3d 100644 --- a/src/core/meshcop/joiner_router_ftd.hpp +++ b/src/core/meshcop/joiner_router_ftd.hpp @@ -91,14 +91,14 @@ private: static void HandleNetifStateChanged(uint32_t aFlags, void *aContext); void HandleNetifStateChanged(uint32_t aFlags); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleRelayTransmit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleJoinerEntrustResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError result); void HandleJoinerEntrustResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError result); diff --git a/src/core/meshcop/leader.cpp b/src/core/meshcop/leader.cpp index d7a74bf49..77f8799d0 100644 --- a/src/core/meshcop/leader.cpp +++ b/src/core/meshcop/leader.cpp @@ -61,7 +61,7 @@ Leader::Leader(ThreadNetif &aThreadNetif): mNetif.GetCoapServer().AddResource(mKeepAlive); } -void Leader::HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Leader::HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandlePetition( @@ -151,7 +151,7 @@ exit: return error; } -void Leader::HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Leader::HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleKeepAlive( diff --git a/src/core/meshcop/leader_ftd.hpp b/src/core/meshcop/leader_ftd.hpp index d628b313d..e68bf7ea5 100644 --- a/src/core/meshcop/leader_ftd.hpp +++ b/src/core/meshcop/leader_ftd.hpp @@ -109,19 +109,19 @@ private: static void HandleTimer(void *aContext); void HandleTimer(void); - static void HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandlePetition(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandlePetition(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); ThreadError SendPetitionResponse(const Coap::Header &aRequestHeader, const Ip6::MessageInfo &aMessageInfo, StateTlv::State aState); - static void HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleKeepAlive(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleKeepAlive(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); ThreadError SendKeepAliveResponse(const Coap::Header &aRequestHeader, const Ip6::MessageInfo &aMessageInfo, StateTlv::State aState); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void ResignCommissioner(void); diff --git a/src/core/meshcop/panid_query_client.cpp b/src/core/meshcop/panid_query_client.cpp index 6f4737e29..052f49d0a 100644 --- a/src/core/meshcop/panid_query_client.cpp +++ b/src/core/meshcop/panid_query_client.cpp @@ -106,7 +106,7 @@ exit: return error; } -void PanIdQueryClient::HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void PanIdQueryClient::HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleConflict( diff --git a/src/core/meshcop/panid_query_client.hpp b/src/core/meshcop/panid_query_client.hpp index 9690a9626..c50777e25 100644 --- a/src/core/meshcop/panid_query_client.hpp +++ b/src/core/meshcop/panid_query_client.hpp @@ -77,7 +77,7 @@ public: otCommissionerPanIdConflictCallback aCallback, void *aContext); private: - static void HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleConflict(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleConflict(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/net/dhcp6_client.cpp b/src/core/net/dhcp6_client.cpp index 05ff10af8..ec7a27931 100644 --- a/src/core/net/dhcp6_client.cpp +++ b/src/core/net/dhcp6_client.cpp @@ -509,7 +509,7 @@ ThreadError Dhcp6Client::AppendRapidCommit(Message &aMessage) return aMessage.Append(&option, sizeof(option)); } -void Dhcp6Client::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo) +void Dhcp6Client::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { Dhcp6Client *obj = static_cast(aContext); obj->HandleUdpReceive(*static_cast(aMessage), *static_cast(aMessageInfo)); diff --git a/src/core/net/dhcp6_client.hpp b/src/core/net/dhcp6_client.hpp index 28f508c5a..f8cd044f3 100644 --- a/src/core/net/dhcp6_client.hpp +++ b/src/core/net/dhcp6_client.hpp @@ -207,7 +207,7 @@ private: ThreadError AppendElapsedTime(Message &aMessage); ThreadError AppendRapidCommit(Message &aMessage); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo); void ProcessReply(Message &aMessage); diff --git a/src/core/net/dhcp6_server.cpp b/src/core/net/dhcp6_server.cpp index e9c30f015..f25520e51 100644 --- a/src/core/net/dhcp6_server.cpp +++ b/src/core/net/dhcp6_server.cpp @@ -247,7 +247,7 @@ exit: return error; } -void Dhcp6Server::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo) +void Dhcp6Server::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { Dhcp6Server *obj = static_cast(aContext); obj->HandleUdpReceive(*static_cast(aMessage), *static_cast(aMessageInfo)); diff --git a/src/core/net/dhcp6_server.hpp b/src/core/net/dhcp6_server.hpp index e053e2f95..e84cf274a 100644 --- a/src/core/net/dhcp6_server.hpp +++ b/src/core/net/dhcp6_server.hpp @@ -134,7 +134,7 @@ private: ThreadError AddIaAddress(Message &aMessage, otIp6Prefix &aIp6Prefix, ClientIdentifier &aClient); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo); void ProcessSolicit(Message &aMessage, otIp6Address &aDst, uint8_t *aTransactionId); diff --git a/src/core/thread/address_resolver.cpp b/src/core/thread/address_resolver.cpp index fef248072..5fa80a0bf 100644 --- a/src/core/thread/address_resolver.cpp +++ b/src/core/thread/address_resolver.cpp @@ -264,7 +264,7 @@ exit: return error; } -void AddressResolver::HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void AddressResolver::HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleAddressNotification( @@ -400,7 +400,7 @@ exit: return error; } -void AddressResolver::HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void AddressResolver::HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleAddressError( @@ -483,7 +483,7 @@ exit: {} } -void AddressResolver::HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void AddressResolver::HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleAddressQuery( @@ -646,7 +646,7 @@ void AddressResolver::HandleTimer() } } -void AddressResolver::HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo, +void AddressResolver::HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader) { static_cast(aContext)->HandleIcmpReceive(*static_cast(aMessage), diff --git a/src/core/thread/address_resolver_ftd.hpp b/src/core/thread/address_resolver_ftd.hpp index d38b9480b..c252081b3 100644 --- a/src/core/thread/address_resolver_ftd.hpp +++ b/src/core/thread/address_resolver_ftd.hpp @@ -162,21 +162,21 @@ private: const ThreadLastTransactionTimeTlv *aLastTransactionTimeTlv, const Ip6::Address &aDestination); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); - static void HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleAddressError(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleAddressError(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleAddressQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleAddressQuery(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleAddressNotification(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleAddressNotification(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleIcmpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo, + static void HandleIcmpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otIcmp6Header *aIcmpHeader); void HandleIcmpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo, const Ip6::IcmpHeader &aIcmpHeader); diff --git a/src/core/thread/announce_begin_server.cpp b/src/core/thread/announce_begin_server.cpp index 0d59c4423..b130ae31b 100644 --- a/src/core/thread/announce_begin_server.cpp +++ b/src/core/thread/announce_begin_server.cpp @@ -92,7 +92,7 @@ exit: return error; } -void AnnounceBeginServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void AnnounceBeginServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleRequest( diff --git a/src/core/thread/announce_begin_server.hpp b/src/core/thread/announce_begin_server.hpp index d689bdf75..c48529411 100644 --- a/src/core/thread/announce_begin_server.hpp +++ b/src/core/thread/announce_begin_server.hpp @@ -89,7 +89,7 @@ private: kDefaultPeriod = 1000, }; - static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleRequest(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/thread/energy_scan_server.cpp b/src/core/thread/energy_scan_server.cpp index bc1579c3f..95bc9c220 100644 --- a/src/core/thread/energy_scan_server.cpp +++ b/src/core/thread/energy_scan_server.cpp @@ -64,7 +64,7 @@ EnergyScanServer::EnergyScanServer(ThreadNetif &aThreadNetif) : mNetif.GetCoapServer().AddResource(mEnergyScan); } -void EnergyScanServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void EnergyScanServer::HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleRequest( diff --git a/src/core/thread/energy_scan_server.hpp b/src/core/thread/energy_scan_server.hpp index 3bc7d96c3..a474edcac 100644 --- a/src/core/thread/energy_scan_server.hpp +++ b/src/core/thread/energy_scan_server.hpp @@ -72,7 +72,7 @@ private: kReportDelay = 500, ///< Delay before sending a report (milliseconds) }; - static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleRequest(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index d122db989..ec238113a 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -1951,7 +1951,7 @@ exit: return error; } -void Mle::HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo) +void Mle::HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleUdpReceive(*static_cast(aMessage), *static_cast(aMessageInfo)); diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index 07ad6dc5c..2091f5f9c 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -1361,7 +1361,7 @@ private: void HandleParentRequestTimer(void); static void HandleDelayedResponseTimer(void *aContext); void HandleDelayedResponseTimer(void); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo); static void HandleSendChildUpdateRequest(void *aContext); void HandleSendChildUpdateRequest(void); diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 8c7dfd7d4..beb5226bc 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -3733,7 +3733,7 @@ exit: return error; } -void MleRouter::HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void MleRouter::HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleAddressSolicitResponse(static_cast(aHeader), @@ -3849,7 +3849,7 @@ exit: {} } -void MleRouter::HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void MleRouter::HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleAddressSolicit( @@ -4012,7 +4012,7 @@ exit: } } -void MleRouter::HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void MleRouter::HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleAddressRelease( diff --git a/src/core/thread/mle_router_ftd.hpp b/src/core/thread/mle_router_ftd.hpp index 1099d7acc..e3b9a866f 100644 --- a/src/core/thread/mle_router_ftd.hpp +++ b/src/core/thread/mle_router_ftd.hpp @@ -661,14 +661,14 @@ private: ThreadError UpdateChildAddresses(const AddressRegistrationTlv &aTlv, Child &aChild); void UpdateRoutes(const RouteTlv &aTlv, uint8_t aRouterId); - static void HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleAddressSolicitResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError result); void HandleAddressSolicitResponse(Coap::Header *aHeader, Message *aMessage, const Ip6::MessageInfo *aMessageInfo, ThreadError result); - static void HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleAddressRelease(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleAddressRelease(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleAddressSolicit(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/thread/network_data_leader_ftd.cpp b/src/core/thread/network_data_leader_ftd.cpp index 32fcd42d7..a042c9403 100644 --- a/src/core/thread/network_data_leader_ftd.cpp +++ b/src/core/thread/network_data_leader_ftd.cpp @@ -138,7 +138,7 @@ exit: return; } -void Leader::HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Leader::HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleServerData( @@ -175,7 +175,7 @@ exit: return; } -void Leader::HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Leader::HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleCommissioningSet( @@ -269,7 +269,7 @@ exit: return; } -void Leader::HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void Leader::HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleCommissioningGet( diff --git a/src/core/thread/network_data_leader_ftd.hpp b/src/core/thread/network_data_leader_ftd.hpp index 5946439af..e51ef743d 100644 --- a/src/core/thread/network_data_leader_ftd.hpp +++ b/src/core/thread/network_data_leader_ftd.hpp @@ -141,7 +141,7 @@ public: ThreadError SendServerDataNotification(uint16_t aRloc16); private: - static void HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleServerData(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleServerData(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); @@ -172,11 +172,11 @@ private: bool IsStableUpdated(uint16_t aRloc16, uint8_t *aTlvs, uint8_t aTlvsLength, uint8_t *aTlvsBase, uint8_t aTlvsBaseLength); - static void HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleCommissioningSet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleCommissioningSet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleCommissioningGet(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleCommissioningGet(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/thread/network_diagnostic.cpp b/src/core/thread/network_diagnostic.cpp index 1986e05da..4bd4f437a 100644 --- a/src/core/thread/network_diagnostic.cpp +++ b/src/core/thread/network_diagnostic.cpp @@ -129,7 +129,7 @@ exit: return error; } -void NetworkDiagnostic::HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void NetworkDiagnostic::HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult) { static_cast(aContext)->HandleDiagnosticGetResponse(*static_cast(aHeader), @@ -156,7 +156,7 @@ exit: return; } -void NetworkDiagnostic::HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void NetworkDiagnostic::HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleDiagnosticGetAnswer(*static_cast(aHeader), @@ -413,7 +413,7 @@ exit: return error; } -void NetworkDiagnostic::HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void NetworkDiagnostic::HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleDiagnosticGetQuery( @@ -480,7 +480,7 @@ exit: } } -void NetworkDiagnostic::HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void NetworkDiagnostic::HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleDiagnosticGetRequest( @@ -576,7 +576,7 @@ exit: return error; } -void NetworkDiagnostic::HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void NetworkDiagnostic::HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleDiagnosticReset( diff --git a/src/core/thread/network_diagnostic.hpp b/src/core/thread/network_diagnostic.hpp index d383ccc81..1cfb215b1 100644 --- a/src/core/thread/network_diagnostic.hpp +++ b/src/core/thread/network_diagnostic.hpp @@ -112,24 +112,24 @@ private: ThreadError AppendChildTable(Message &aMessage); ThreadError FillRequestedTlvs(Message &aRequest, Message &aResponse, NetworkDiagnosticTlv &aNetworkDiagnosticTlv); - static void HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleDiagnosticGetRequest(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleDiagnosticGetRequest(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleDiagnosticGetQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleDiagnosticGetQuery(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleDiagnosticGetResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo, ThreadError aResult); void HandleDiagnosticGetResponse(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo, ThreadError aResult); - static void HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleDiagnosticGetAnswer(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleDiagnosticGetAnswer(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - static void HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage aMessage, + static void HandleDiagnosticReset(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleDiagnosticReset(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); diff --git a/src/core/thread/panid_query_server.cpp b/src/core/thread/panid_query_server.cpp index b4da895a5..3c32efcaf 100644 --- a/src/core/thread/panid_query_server.cpp +++ b/src/core/thread/panid_query_server.cpp @@ -56,7 +56,7 @@ PanIdQueryServer::PanIdQueryServer(ThreadNetif &aThreadNetif) : mNetif.GetCoapServer().AddResource(mPanIdQuery); } -void PanIdQueryServer::HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, +void PanIdQueryServer::HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { static_cast(aContext)->HandleQuery( diff --git a/src/core/thread/panid_query_server.hpp b/src/core/thread/panid_query_server.hpp index e798fdf55..77c75044e 100644 --- a/src/core/thread/panid_query_server.hpp +++ b/src/core/thread/panid_query_server.hpp @@ -71,7 +71,7 @@ private: kScanDelay = 1000, ///< SCAN_DELAY (milliseconds) }; - static void HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleQuery(void *aContext, otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleQuery(Coap::Header &aHeader, Message &aMessage, const Ip6::MessageInfo &aMessageInfo); static void HandleScanResult(void *aContext, Mac::Frame *aFrame); @@ -80,7 +80,7 @@ private: static void HandleTimer(void *aContext); void HandleTimer(void); - static void HandleUdpReceive(void *aContext, otMessage aMessage, const otMessageInfo *aMessageInfo); + static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); ThreadError SendConflict(void); diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index c6332bf7b..f3cf1117e 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -563,7 +563,7 @@ ThreadError NcpBase::OutboundFrameFeedData(const uint8_t *aDataBuffer, uint16_t return mTxFrameBuffer.InFrameFeedData(aDataBuffer, aDataBufferLength); } -ThreadError NcpBase::OutboundFrameFeedMessage(otMessage aMessage) +ThreadError NcpBase::OutboundFrameFeedMessage(otMessage *aMessage) { return mTxFrameBuffer.InFrameFeedMessage(aMessage); } @@ -577,12 +577,12 @@ ThreadError NcpBase::OutboundFrameEnd(void) // MARK: Outbound Datagram Handling // ---------------------------------------------------------------------------- -void NcpBase::HandleDatagramFromStack(otMessage aMessage, void *aContext) +void NcpBase::HandleDatagramFromStack(otMessage *aMessage, void *aContext) { static_cast(aContext)->HandleDatagramFromStack(aMessage); } -void NcpBase::HandleDatagramFromStack(otMessage aMessage) +void NcpBase::HandleDatagramFromStack(otMessage *aMessage) { ThreadError errorCode = kThreadError_None; bool isSecure = otMessageIsLinkSecurityEnabled(aMessage); @@ -1439,7 +1439,7 @@ exit: return errorCode; } -ThreadError NcpBase::SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage aMessage) +ThreadError NcpBase::SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage *aMessage) { ThreadError errorCode = kThreadError_None; @@ -4330,7 +4330,7 @@ ThreadError NcpBase::SetPropertyHandler_STREAM_NET_INSECURE(uint8_t header, spin unsigned int meta_len(0); // STREAM_NET_INSECURE packets are not secured at layer 2. - otMessage message = otIp6NewMessage(mInstance, false); + otMessage *message = otIp6NewMessage(mInstance, false); if (message == NULL) { @@ -4403,7 +4403,7 @@ ThreadError NcpBase::SetPropertyHandler_STREAM_NET(uint8_t header, spinel_prop_k unsigned int meta_len(0); // STREAM_NET requires layer 2 security. - otMessage message = otIp6NewMessage(mInstance, true); + otMessage *message = otIp6NewMessage(mInstance, true); if (message == NULL) { diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index a92895cab..50a487324 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -106,7 +106,7 @@ protected: * @retval kThreadError_NoBufs Insufficient buffer space available to add message. * */ - ThreadError OutboundFrameFeedMessage(otMessage aMessage); + ThreadError OutboundFrameFeedMessage(otMessage *aMessage); /** * This method finalizes and sends the current outbound frame @@ -144,9 +144,9 @@ private: /** * Trampoline for HandleDatagramFromStack(). */ - static void HandleDatagramFromStack(otMessage aMessage, void *aContext); + static void HandleDatagramFromStack(otMessage *aMessage, void *aContext); - void HandleDatagramFromStack(otMessage aMessage); + void HandleDatagramFromStack(otMessage *aMessage); /** * Trampoline for HandleRawFrame(). @@ -246,7 +246,7 @@ private: ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, const uint8_t *value_ptr, uint16_t value_len); - ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage message); + ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, otMessage *message); ThreadError SendPropertyUpdate(uint8_t header, uint8_t command, spinel_prop_key_t key, const char *format, ...); diff --git a/src/ncp/ncp_buffer.cpp b/src/ncp/ncp_buffer.cpp index a0e06f600..09b61e39a 100644 --- a/src/ncp/ncp_buffer.cpp +++ b/src/ncp/ncp_buffer.cpp @@ -55,7 +55,7 @@ NcpFrameBuffer::~NcpFrameBuffer() void NcpFrameBuffer::Clear(void) { - otMessage message; + otMessage *message; bool wasEmpty = IsEmpty(); // Write (InFrame) related variables @@ -243,7 +243,7 @@ void NcpFrameBuffer::InFrameEndSegment(uint16_t aHeaderFlags) // This method discards the current frame. void NcpFrameBuffer::InFrameDiscard(void) { - otMessage message; + otMessage *message; // Move the write segment head and tail pointers back to frame start. mWriteSegmentHead = mWriteSegmentTail = mWriteFrameStart; @@ -281,7 +281,7 @@ exit: return error; } -ThreadError NcpFrameBuffer::InFrameFeedMessage(otMessage aMessage) +ThreadError NcpFrameBuffer::InFrameFeedMessage(otMessage *aMessage) { ThreadError error = kThreadError_None; @@ -300,7 +300,7 @@ exit: ThreadError NcpFrameBuffer::InFrameEnd(void) { - otMessage message; + otMessage *message; bool wasEmpty = IsEmpty(); // End/Close the current segment (if any). @@ -547,7 +547,7 @@ ThreadError NcpFrameBuffer::OutFrameRemove(void) { ThreadError error = kThreadError_None; uint8_t *bufPtr; - otMessage message; + otMessage *message; uint16_t header; VerifyOrExit(!IsEmpty(), error = kThreadError_NotFound); @@ -609,7 +609,7 @@ uint16_t NcpFrameBuffer::OutFrameGetLength(void) uint16_t frameLength = 0; uint16_t header; uint8_t *bufPtr; - otMessage message = NULL; + otMessage *message = NULL; // If the frame length was calculated before, return the previously calculated length. VerifyOrExit(mReadFrameLength == kUnknownFrameLength, frameLength = mReadFrameLength); diff --git a/src/ncp/ncp_buffer.hpp b/src/ncp/ncp_buffer.hpp index 909ca553a..cb5b349f1 100644 --- a/src/ncp/ncp_buffer.hpp +++ b/src/ncp/ncp_buffer.hpp @@ -125,7 +125,7 @@ public: * @retval kThreadError_NoBufs Insufficient buffer space available to add message. * */ - ThreadError InFrameFeedMessage(otMessage aMessage); + ThreadError InFrameFeedMessage(otMessage *aMessage); /** * This method finalizes/ends the current input frame being written to the buffer. @@ -347,7 +347,7 @@ private: uint8_t * mReadSegmentTail; // Pointer to end of current segment in the frame being read. uint8_t * mReadPointer; // Pointer to next byte to read (either in segment or in msg buffer). - otMessage mReadMessage; // Current Message in the frame being read. + otMessage * mReadMessage; // Current Message in the frame being read. uint16_t mReadMessageOffset; // Offset within current message being read. uint8_t mMessageBuffer[kMessageReadBufferSize]; // Buffer to hold part of current message being read. diff --git a/tests/unit/test_message_queue.cpp b/tests/unit/test_message_queue.cpp index 93007ff5b..3196c6063 100644 --- a/tests/unit/test_message_queue.cpp +++ b/tests/unit/test_message_queue.cpp @@ -149,8 +149,8 @@ void TestMessageQueue(void) void VerifyMessageQueueContentUsingOtApi(otMessageQueue *aQueue, int aExpectedLength, ...) { va_list args; - otMessage message; - otMessage msgArg; + otMessage *message; + otMessage *msgArg; va_start(args, aExpectedLength); @@ -168,7 +168,7 @@ void VerifyMessageQueueContentUsingOtApi(otMessageQueue *aQueue, int aExpectedLe { VerifyOrQuit(aExpectedLength != 0, "MessageQueue contains more entries than expected\n"); - msgArg = va_arg(args, otMessage); + msgArg = va_arg(args, otMessage *); VerifyOrQuit(msgArg == message, "MessageQueue content does not match what is expected.\n"); aExpectedLength--; @@ -186,9 +186,9 @@ void TestMessageQueueOtApis(void) otInstance *instance; otMessageQueue queue, queue2; - otMessage msg[kNumTestMessages]; + otMessage *msg[kNumTestMessages]; ThreadError error; - otMessage message; + otMessage *message; #ifdef OPENTHREAD_MULTIPLE_INSTANCE size_t otInstanceBufferLength = 0;