MME2 changes - Propped commits from openmme/paging branch. Added scripts
for code gen

Change-Id: Ie55032217232214ac8544ca76ea34335205329e4
diff --git a/src/mme-app/msgHandlers/gtpMsgHandler.cpp b/src/mme-app/msgHandlers/gtpMsgHandler.cpp
new file mode 100644
index 0000000..3888803
--- /dev/null
+++ b/src/mme-app/msgHandlers/gtpMsgHandler.cpp
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2019, Infosys Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <msgHandlers/gtpMsgHandler.h>
+
+#include <contextManager/subsDataGroupManager.h>
+#include <event.h>
+#include <ipcTypes.h>
+#include <log.h>
+
+using namespace SM;
+using namespace mme;
+
+GtpMsgHandler::~GtpMsgHandler() {
+
+}
+
+GtpMsgHandler::GtpMsgHandler() {
+
+
+}
+
+GtpMsgHandler* GtpMsgHandler::Instance()
+{
+	static GtpMsgHandler msgHandler;
+	return &msgHandler;
+}
+
+void GtpMsgHandler::handleGtpMessage_v(cmn::utils::MsgBuffer* msgBuf)
+{
+	if (msgBuf == NULL)
+		return;
+
+	const gtp_incoming_msg_data_t* msgData_p = (gtp_incoming_msg_data_t*)(msgBuf->getDataPointer());
+
+	switch (msgData_p->msg_type)
+	{
+		case msg_type_t::create_session_response:
+			log_msg(LOG_DEBUG,"Create Session Response msg rxed\n");
+			handleCreateSessionResponseMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::modify_bearer_response:
+			handleModifyBearerResponseMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::delete_session_response:
+			handleDeleteSessionResponseMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+			
+		case msg_type_t::release_bearer_response:
+			handleReleaseBearerResponseMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+		
+		case msg_type_t::downlink_data_notification:
+			handleDdnMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		default:
+			log_msg(LOG_INFO, "Unhandled Gtp Message %d \n", msgData_p->msg_type);
+			delete msgBuf;
+	}
+
+}
+
+void GtpMsgHandler::handleCreateSessionResponseMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "handleCreateSessionResponseMsg_v");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleCreateSessionResponseMsg_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire CS resp from SGW event, insert cb to procedure queue
+	SM::Event evt(Event_e::CS_RESP_FROM_SGW, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void GtpMsgHandler::handleModifyBearerResponseMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "handleModifyBearerResponseMsg_v");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleModifyBearerResponseMsg_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire MB rep from SGW event, insert cb to procedure queue
+	SM::Event evt(Event_e::MB_RESP_FROM_SGW, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void GtpMsgHandler::handleDeleteSessionResponseMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "handleDeleteSessionResponseMsg_v");
+	
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleDeleteSessionResponse_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	SM::Event evt(Event_e::DEL_SESSION_RESP_FROM_SGW, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void GtpMsgHandler::handleReleaseBearerResponseMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "handleReleaseBearerResponseMsg_v");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleReleaseBearerResponse_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+	
+	// Fire rel bearer response from sgw event, insert cb to procedure queue
+	SM::Event evt(Event_e::REL_AB_RESP_FROM_SGW, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void GtpMsgHandler::handleDdnMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO,"Inside handle DDN\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleReleaseBearerResponse_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire ddn from sgw event, insert cb to procedure queue
+	SM::Event evt(Event_e::DDN_FROM_SGW, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
diff --git a/src/mme-app/msgHandlers/s1MsgHandler.cpp b/src/mme-app/msgHandlers/s1MsgHandler.cpp
new file mode 100644
index 0000000..b13a528
--- /dev/null
+++ b/src/mme-app/msgHandlers/s1MsgHandler.cpp
@@ -0,0 +1,349 @@
+/*
+ * Copyright (c) 2019, Infosys Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <msgHandlers/s1MsgHandler.h>
+
+#include <event.h>
+#include <ipcTypes.h>
+#include <log.h>
+#include <utils/mmeCommonUtils.h>
+#include <contextManager/subsDataGroupManager.h>
+
+using namespace SM;
+using namespace mme;
+
+S1MsgHandler::S1MsgHandler()
+{
+
+}
+
+S1MsgHandler::~S1MsgHandler()
+{
+
+}
+
+S1MsgHandler* S1MsgHandler::Instance()
+{
+	static S1MsgHandler msgHandler;
+	return &msgHandler;
+}
+
+void S1MsgHandler::handleS1Message_v(const cmn::utils::MsgBuffer* buf)
+{
+	log_msg(LOG_INFO, "S1 - handleS1Message_v\n");
+
+	if (buf == NULL)
+		return;
+
+	cmn::utils::MsgBuffer* msgBuf = const_cast<cmn::utils::MsgBuffer *>(buf);
+
+	const s1_incoming_msg_data_t* msgData_p = (s1_incoming_msg_data_t*)(msgBuf->getDataPointer());
+
+	switch (msgData_p->msg_type)
+	{
+		case msg_type_t::attach_request:
+			handleInitUeAttachRequestMsg_v(msgBuf);
+			break;
+
+		case msg_type_t::id_response:
+			handleIdentityResponseMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::auth_response:
+			handleAuthResponseMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::sec_mode_complete:
+			handleSecurityModeResponse_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::esm_info_response:
+			handleEsmInfoResponse_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::init_ctxt_response:
+			handleInitCtxtResponse_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::attach_complete:
+			handleAttachComplete_v(msgBuf, msgData_p->ue_idx);
+			break;
+                
+		case msg_type_t::detach_request:
+			handleDetachRequest_v(msgBuf, msgData_p->ue_idx);
+			break;
+					
+		case msg_type_t::s1_release_request:
+			handleS1ReleaseRequestMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+			
+		case msg_type_t::s1_release_complete:
+			handleS1ReleaseComplete_v(msgBuf, msgData_p->ue_idx);
+			break;
+		
+		case msg_type_t::detach_accept_from_ue:
+			handleDetachAcceptFromUE_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case  msg_type_t::service_request:
+            		handleServiceRequest_v(msgBuf, msgData_p->ue_idx);
+            		break;
+					
+		case msg_type_t::tau_request:
+			handleTauRequestMsg_v(msgBuf, msgData_p->ue_idx);
+			break;
+		
+		default:
+			log_msg(LOG_INFO, "Unhandled S1 Message %d \n", msgData_p->msg_type);
+			delete msgBuf;
+	}
+}
+
+void S1MsgHandler::handleInitUeAttachRequestMsg_v(const cmn::utils::MsgBuffer* msgData_p)
+{
+	log_msg(LOG_INFO, "S1 - handleInitUeAttachRequestMsg_v\n");
+
+	SM::ControlBlock* controlBlk_p = MmeCommonUtils::findControlBlock(
+					const_cast<cmn::utils::MsgBuffer*>(msgData_p));
+	if (controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "Failed to allocate ControlBlock \n");
+
+        return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::ATTACH_REQ_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleIdentityResponseMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleIdentityResponseMsg_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleIdentityResponseMsg_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::IDENTITY_RESPONSE_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleAuthResponseMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleAuthResponseMsg_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleAuthResponseMsg_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::AUTH_RESP_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleSecurityModeResponse_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleSecurityModeResponse_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleSecurityModeResponse_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::SEC_MODE_RESP_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleEsmInfoResponse_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleEsmInfoResponse_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleEsmInfoResponse_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::ESM_INFO_RESP_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleInitCtxtResponse_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleInitCtxtResponse_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleInitCtxtResponse_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::INIT_CTXT_RESP_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleAttachComplete_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleAttachComplete_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleAttachComplete_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire attach-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::ATT_CMP_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleDetachRequest_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleDetachRequest_v\n");
+
+	SM::ControlBlock* controlBlk_p = MmeCommonUtils::findControlBlock(
+					const_cast<cmn::utils::MsgBuffer*>(msgData_p));
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleDetachRequest_v: "
+				"Failed to find UE context using idx %d\n", ueIdx);
+		return;
+	}
+
+	// Fire detach request event, insert cb to procedure queue
+	SM::Event evt(Event_e::DETACH_REQ_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleS1ReleaseRequestMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleS1ReleaseRequestMsg_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+    {
+		log_msg(LOG_ERROR, ":handleS1ReleaseRequestMsg_v: "
+                "Failed to find UE context using idx %d\n",
+                 ueIdx);
+        return;
+    }
+
+	// Fire s1 release event, insert cb to procedure queue
+	SM::Event evt(Event_e::S1_REL_REQ_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleS1ReleaseComplete_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleS1ReleaseComplete_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+    {
+		log_msg(LOG_ERROR, ":handleS1ReleaseComplete_v: "
+                "Failed to find UE context using idx %d\n",
+                 ueIdx);
+        return;
+    }
+
+	// Fire s1 release complete event, insert cb to procedure queue
+	SM::Event evt(Event_e::UE_CTXT_REL_COMP_FROM_ENB, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleDetachAcceptFromUE_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleDetachAcceptFromUE_v\n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleDetachAcceptFromUE_v: "
+				   "Failed to find UE Context using idx %d\n",
+				   ueIdx);
+		return;
+	}
+
+	//Fire NI_Detach Event, insert CB to procedure queue
+	SM::Event evt(Event_e::DETACH_ACCEPT_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleServiceRequest_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleServiceRequest_v\n");
+
+	SM::ControlBlock* controlBlk_p = MmeCommonUtils::findControlBlock(
+					const_cast<cmn::utils::MsgBuffer*>(msgData_p));
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleServiceRequest_v: "
+				   "Failed to find UE Context using idx %d\n",
+				   ueIdx);
+		return;
+	}
+
+	//Fire NI_Detach Event, insert CB to procedure queue
+	SM::Event evt(Event_e::SERVICE_REQUEST_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S1MsgHandler::handleTauRequestMsg_v(const cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "S1 - handleTauRequestMsg_v\n");
+
+	SM::ControlBlock* controlBlk_p = MmeCommonUtils::findControlBlock(
+					const_cast<cmn::utils::MsgBuffer*>(msgData_p)); 
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleTauRequestMsg_v: "
+				   "Failed to find UE Context using idx %d\n",
+				   ueIdx);
+		return;
+	}
+
+	// Fire tau-start event, insert cb to procedure queue
+	SM::Event evt(Event_e::TAU_REQUEST_FROM_UE, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
diff --git a/src/mme-app/msgHandlers/s6MsgHandler.cpp b/src/mme-app/msgHandlers/s6MsgHandler.cpp
new file mode 100644
index 0000000..6880229
--- /dev/null
+++ b/src/mme-app/msgHandlers/s6MsgHandler.cpp
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2019, Infosys Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <msgHandlers/s6MsgHandler.h>
+
+#include <contextManager/subsDataGroupManager.h>
+#include <event.h>
+#include <ipcTypes.h>
+#include <log.h>
+
+using namespace SM;
+using namespace mme;
+
+
+S6MsgHandler::~S6MsgHandler() {
+
+}
+S6MsgHandler::S6MsgHandler() {
+
+}
+
+S6MsgHandler* S6MsgHandler::Instance()
+{
+	static S6MsgHandler msgHandler;
+	return &msgHandler;
+}
+
+void S6MsgHandler::handleS6Message_v(cmn::utils::MsgBuffer* msgBuf)
+{
+	if (msgBuf == NULL)
+		return;
+
+	const s6_incoming_msg_data_t* msgData_p = (s6_incoming_msg_data_t*)(msgBuf->getDataPointer());
+	switch (msgData_p->msg_type)
+	{
+		case msg_type_t::auth_info_answer:
+			handleAuthInfoAnswer_v(msgBuf, msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::update_loc_answer:
+			handleUpdateLocationAnswer_v(msgBuf,  msgData_p->ue_idx);
+			break;
+
+		case msg_type_t::purge_answser:
+			handlePurgeAnswer_v(msgBuf,  msgData_p->ue_idx);
+			break;
+		
+		case msg_type_t::cancel_location_request:
+			handleCancelLocationRequest_v(msgBuf);
+			break;
+
+		default:
+			log_msg(LOG_INFO, "Unhandled S6 Message %d \n", msgData_p->msg_type);
+	}
+
+}
+
+void S6MsgHandler::handleAuthInfoAnswer_v(cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "Inside handleAuthInfoAnswer_v \n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleAuthInfoAnswer_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+
+	// Fire Auth Info Answer event, insert cb to procedure queue
+	SM::Event evt(Event_e::AIA_FROM_HSS, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S6MsgHandler::handleUpdateLocationAnswer_v(cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "Inside handleUpdateLocationAnswer_v \n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleUpdateLocationAnswer_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+	// Fire Update Loc Answer event, insert cb to procedure queue
+	SM::Event evt(Event_e::ULA_FROM_HSS, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+
+void S6MsgHandler::handlePurgeAnswer_v(cmn::utils::MsgBuffer* msgData_p, uint32_t ueIdx)
+{
+	log_msg(LOG_INFO, "Inside handlePurgeAnswer_v \n");
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ueIdx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handlePurgeAnswer_v: "
+							"Failed to find UE context using idx %d\n",
+							ueIdx);
+		return;
+	}
+	// Fire attach-start event, insert cb to procedure queue
+	//SM::Event evt(Event_e::DETACH_PUR_RESP_FROM_HSS);
+	//controlBlk_p->addEventToProcQ(evt);
+	//
+}
+
+void S6MsgHandler::handleCancelLocationRequest_v(cmn::utils::MsgBuffer* msgData_p)
+{
+	log_msg(LOG_INFO, "Inside handleCancelLocationRequest \n");
+        
+	const char *buf = static_cast<const char*>(msgData_p->getDataPointer());
+	const s6_incoming_msg_data_t* msgInfo_p = (s6_incoming_msg_data_t*)(buf);
+
+	DigitRegister15 IMSI;
+	IMSI.setImsiDigits(const_cast<uint8_t*> (msgInfo_p->msg_data.clr_Q_msg_m.imsi));
+      
+	int ue_idx =  SubsDataGroupManager::Instance()->findCBWithimsi(IMSI);
+	log_msg(LOG_INFO, "UE_IDX found from map : %d \n", ue_idx);
+
+	if (ue_idx < 1)
+	{
+		log_msg(LOG_ERROR, "Failed to find ue index using IMSI : %d\n", ue_idx);
+		return;
+	}
+
+	SM::ControlBlock* controlBlk_p = SubsDataGroupManager::Instance()->findControlBlock(ue_idx);
+	if(controlBlk_p == NULL)
+	{
+		log_msg(LOG_ERROR, "handleCancelLocationRequest_v: "
+				   "Failed to find UE Context using IMSI in CLR\n");
+		return;
+	}
+	//Fire CLR event, insert CB to Procedure Queue
+	SM::Event evt(Event_e::CLR_FROM_HSS, (void *)msgData_p);
+	controlBlk_p->addEventToProcQ(evt);
+}
+