replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / routing / src / routingmanager.c
index 5f1aff6..9f87d2f 100644 (file)
@@ -46,7 +46,7 @@
 /**
  * Unique gateway ID generated before hosting a gateway resource.
  */
-uint32_t g_GatewayID = 0;
+static uint32_t g_GatewayID = 0;
 
 /**
  * Used for assigning unique ID.to endpoint's connected to this gateway
@@ -1131,7 +1131,7 @@ rewriteandexit:
         }
         else if (isEMPTYPacket)
         {
-            OC_LOG(DEBUG, TAG, "The message to be Forwarded is a EMPTY message");
+            OIC_LOG(DEBUG, TAG, "The message to be Forwarded is a EMPTY message");
             CAResponseInfo_t responseMessage = {.result = CA_EMPTY};
             if (ACK == routeOption.msgType)
             {
@@ -1143,11 +1143,12 @@ rewriteandexit:
             }
 
             responseMessage.info.messageId = info->messageId;
+            responseMessage.info.dataType = CA_RESPONSE_DATA;
 
             CAResult_t caRes = CASendResponse(&nextHop, &responseMessage);
             if (CA_STATUS_OK != caRes)
             {
-                OC_LOG_V(ERROR, RM_TAG, "Failed to forward response to next hop [%d][%s]",
+                OIC_LOG_V(ERROR, RM_TAG, "Failed to forward response to next hop [%d][%s]",
                          caRes, nextHop.addr);
                 // Since a response is always unicast, return error here.
                 return OC_STACK_ERROR;
@@ -1170,6 +1171,7 @@ rewriteandexit:
             if(isRequest)
             {
                 CARequestInfo_t *msg = message;
+                msg->info.dataType = CA_REQUEST_DATA;
                 CAResult_t caRes = CASendRequest(&nextHop, msg);
                 if (CA_STATUS_OK != caRes)
                 {
@@ -1189,6 +1191,7 @@ rewriteandexit:
             else
             {
                 CAResponseInfo_t *msg = message;
+                msg->info.dataType = CA_RESPONSE_DATA;
                 CAResult_t caRes = CASendResponse(&nextHop, msg);
                 if (CA_STATUS_OK != caRes)
                 {
@@ -1206,7 +1209,7 @@ rewriteandexit:
         {
             if (isRequest)
             {
-                OC_LOG(DEBUG, TAG, "POST message with type ACK in Route Option");
+                OIC_LOG(DEBUG, TAG, "POST message with type ACK in Route Option");
                 if (NULL != isEmptyMsg)
                 {
                     *isEmptyMsg = true;
@@ -1214,7 +1217,7 @@ rewriteandexit:
             }
             else
             {
-                OC_LOG(DEBUG, TAG, "Response for EMPTY message is received");
+                OIC_LOG(DEBUG, TAG, "Response for EMPTY message is received");
                 CAResponseInfo_t *msg = message;
                 if (ACK == (MSGType)routeOption.msgType)
                 {
@@ -1241,7 +1244,7 @@ OCStackResult RMHandleRequest(CARequestInfo_t *message, const CAEndpoint_t *send
 {
     if (!g_isRMInitialized)
     {
-        OIC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(INFO, TAG, "RM not initialized");
         *selfDestination = true;
         return OC_STACK_OK;
     }
@@ -1254,7 +1257,7 @@ OCStackResult RMHandleResponse(CAResponseInfo_t *message, const CAEndpoint_t *se
 {
     if (!g_isRMInitialized)
     {
-        OIC_LOG(ERROR, TAG, "RM not initialized");
+        OIC_LOG(INFO, TAG, "RM not initialized");
         *selfDestination = true;
         return OC_STACK_OK;
     }