Commit e6f229fa authored by gauthier's avatar gauthier

msc traces

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7240 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7c13e61e
......@@ -33,6 +33,7 @@
#include <string.h>
#include <unistd.h>
#include "msc.h"
#include "intertask_interface.h"
#include "mme_app_itti_messaging.h"
......@@ -97,6 +98,13 @@ int mme_app_request_authentication_info(const char *imsi,
memset(auth_info_req->auts, 0, sizeof(auth_info_req->auts));
}
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_S6A_MME,
NULL,0,
"0 S6A_AUTH_INFO_REQ IMSI %s visited_plmn %02X%02X%02X re_sync %u",
imsi,ptr[0],ptr[1],ptr[2],auth_info_req->re_synchronization);
return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
}
......@@ -111,9 +119,13 @@ int mme_app_handle_nas_auth_resp(const nas_auth_resp_t * const nas_auth_resp_pP)
MME_APP_DEBUG("Handling imsi %"IMSI_FORMAT"\n", imsi);
if ((ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts,
imsi)) == NULL) {
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"NAS_AUTH_RESP Unknown imsi %"IMSI_FORMAT,imsi);
AssertFatal(0, "That's embarrassing as we don't know this IMSI\n");
return -1;
}
......@@ -142,6 +154,13 @@ int mme_app_handle_nas_auth_resp(const nas_auth_resp_t * const nas_auth_resp_pP)
/* Check if we already have UE data */
s6a_ulr->skip_subscriber_data = 0;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_S6A_MME,
NULL,0,
" S6A_UPDATE_LOCATION_REQ IMSI %s RAT_EUTRAN",
imsi);
return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
}
return -1;
......@@ -160,9 +179,13 @@ mme_app_handle_authentication_info_answer(
MME_APP_DEBUG("Handling imsi %"IMSI_FORMAT"\n", imsi);
if ((ue_context = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts,
imsi)) == NULL) {
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"S6A_AUTH_INFO_ANS Unknown imsi %"IMSI_FORMAT,imsi);
return -1;
}
......@@ -203,6 +226,11 @@ mme_app_handle_authentication_info_answer(
&s6a_auth_info_ans_pP->auth_info.eutran_vector);
} else {
MME_APP_ERROR("INFORMING NAS ABOUT AUTH RESP ERROR CODE\n");
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"S6A_AUTH_INFO_ANS S6A Failure imsi %"IMSI_FORMAT,imsi);
/* Inform NAS layer with the right failure */
if (s6a_auth_info_ans_pP->result.present == S6A_RESULT_BASE) {
......
......@@ -48,6 +48,7 @@
#include "assertions.h"
#include "common_types.h"
#include "msc.h"
......@@ -213,6 +214,13 @@ mme_app_send_s11_create_session_req(
session_request_p->serving_network.mnc[2] = ue_context_pP->e_utran_cgi.plmn.MNCdigit3;
session_request_p->selection_mode = MS_O_N_P_APN_S_V;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
(to_task == TASK_S11) ? MSC_S11_MME:MSC_SP_GWAPP_MME,
NULL,0,
"0 SGW_CREATE_SESSION_REQUEST imsi %"IMSI_FORMAT,ue_context_pP->imsi);
return itti_send_msg_to_task(to_task, INSTANCE_DEFAULT, message_p);
}
......@@ -232,9 +240,13 @@ mme_app_handle_nas_pdn_connectivity_req(
MME_APP_DEBUG("Handling imsi %"IMSI_FORMAT"\n", imsi);
if ((ue_context_p = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts,
imsi)) == NULL) {
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"NAS_PDN_CONNECTIVITY_REQ Unknown imsi %"IMSI_FORMAT,imsi);
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
return -1;
}
......@@ -298,8 +310,12 @@ mme_app_handle_conn_est_cnf(
ue_context_p = mme_ue_context_exists_nas_ue_id(&mme_app_desc.mme_ue_contexts, nas_conn_est_cnf_pP->UEid);
if (ue_context_p == NULL) {
MME_APP_ERROR("UE context doesn't exist for UE 0x%08X/dec%u\n",
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"NAS_CONNECTION_ESTABLISHMENT_CNF Unknown ue %u",nas_conn_est_cnf_pP->UEid);
MME_APP_ERROR("UE context doesn't exist for UE 0x%08X/dec%u\n",
nas_conn_est_cnf_pP->UEid,
nas_conn_est_cnf_pP->UEid);
return;
......@@ -353,6 +369,18 @@ mme_app_handle_conn_est_cnf(
derive_keNB(ue_context_p->vector_in_use->kasme, nas_conn_est_cnf_pP->ul_nas_count, keNB); //156
memcpy(establishment_cnf_p->keNB, keNB, 32);
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_S1AP_MME,
NULL,0,
"0 MME_APP_CONNECTION_ESTABLISHMENT_CNF ebi %u s1u_sgw teid %u qci %u prio level %u sea 0x%x sia 0x%x",
establishment_cnf_p->eps_bearer_id,
establishment_cnf_p->bearer_s1u_sgw_fteid.teid,
establishment_cnf_p->bearer_qos_qci,
establishment_cnf_p->bearer_qos_prio_level,
establishment_cnf_p->security_capabilities_encryption_algorithms,
establishment_cnf_p->security_capabilities_integrity_algorithms);
itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
......@@ -372,6 +400,8 @@ mme_app_handle_conn_est_ind(
&mme_app_desc.mme_ue_contexts,
conn_est_ind_pP->mme_ue_s1ap_id);
if (ue_context_p == NULL) {
MME_APP_DEBUG("We didn't find this mme_ue_s1ap_id in list of UE: 0x%08x/dec%u\n",
conn_est_ind_pP->mme_ue_s1ap_id,
......@@ -406,6 +436,13 @@ mme_app_handle_conn_est_ind(
&conn_est_ind_pP->nas,
sizeof (nas_establish_ind_t));
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_CONNECTION_ESTABLISHMENT_IND");
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
......@@ -428,6 +465,7 @@ mme_app_handle_create_sess_resp(
ue_context_p = mme_ue_context_exists_s11_teid(&mme_app_desc.mme_ue_contexts,
create_sess_resp_pP->teid);
if (ue_context_p == NULL) {
MME_APP_DEBUG("We didn't find this teid in list of UE: %08x\n",
create_sess_resp_pP->teid);
......@@ -668,6 +706,16 @@ mme_app_handle_create_sess_resp(
NAS_PDN_CONNECTIVITY_RSP(message_p).ambr.br_dl = ue_context_p->subscribed_ambr.br_dl;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_PDN_CONNECTIVITY_RSP sgw_s1u_teid %u ebi %u qci %u prio %u",
current_bearer_p->s_gw_teid,
bearer_id,
current_bearer_p->qci,
current_bearer_p->prio_level);
return itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
return 0;
......@@ -689,10 +737,14 @@ mme_app_handle_initial_context_setup_rsp(
&mme_app_desc.mme_ue_contexts,
initial_ctxt_setup_rsp_pP->mme_ue_s1ap_id);
if (ue_context_p == NULL) {
MME_APP_DEBUG("We didn't find this mme_ue_s1ap_id in list of UE: %08x %d(dec)\n",
initial_ctxt_setup_rsp_pP->mme_ue_s1ap_id,
initial_ctxt_setup_rsp_pP->mme_ue_s1ap_id);
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"MME_APP_INITIAL_CONTEXT_SETUP_RSP Unknown ue %u",initial_ctxt_setup_rsp_pP->mme_ue_s1ap_id);
return;
}
......@@ -727,6 +779,16 @@ mme_app_handle_initial_context_setup_rsp(
/* S11 stack specific parameter. Not used in standalone epc mode */
SGW_MODIFY_BEARER_REQUEST(message_p).trxn = NULL;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
(to_task == TASK_S11) ? MSC_S11_MME:MSC_SP_GWAPP_MME,
NULL,0,
"0 SGW_MODIFY_BEARER_REQUEST teid %u ebi %u",
SGW_MODIFY_BEARER_REQUEST(message_p).teid,
SGW_MODIFY_BEARER_REQUEST(message_p).bearer_context_to_modify.eps_bearer_id);
itti_send_msg_to_task(to_task, INSTANCE_DEFAULT, message_p);
}
......@@ -38,11 +38,21 @@ mme_app_itti_auth_fail(
{
MessageDef *message_p;
MSC_LOG_TX_MESSAGE(MSC_MMEAPP_MME, MSC_NAS_MME,NULL,0,
"NAS_AUTHENTICATION_PARAM_FAIL ue %u cause %u",ue_id, cause);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_PARAM_FAIL);
NAS_AUTHENTICATION_PARAM_FAIL(message_p).ue_id = ue_id;
NAS_AUTHENTICATION_PARAM_FAIL(message_p).cause = cause;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_AUTHENTICATION_PARAM_FAIL ue_id %u cause %u",
ue_id, cause);
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
......@@ -61,6 +71,12 @@ static inline void mme_app_itti_auth_rsp(
NAS_AUTHENTICATION_PARAM_RSP(message_p).nb_vectors = nb_vectors;
memcpy(&NAS_AUTHENTICATION_PARAM_RSP(message_p).vector, vector, sizeof(*vector));
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_AUTHENTICATION_PARAM_RSP ue_id %u nb_vectors %u",
ue_id, nb_vectors);
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
......
......@@ -50,6 +50,7 @@
#include "assertions.h"
#include "common_types.h"
#include "msc.h"
int
......@@ -89,6 +90,12 @@ mme_app_send_s6a_update_location_req(
/* Check if we already have UE data */
s6a_ulr_p->skip_subscriber_data = 0;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_S6A_MME,
NULL,0,
"0 S6A_UPDATE_LOCATION_REQ imsi %"IMSI_FORMAT,imsi);
return itti_send_msg_to_task(TASK_S6A, INSTANCE_DEFAULT, message_p);
}
......@@ -123,8 +130,12 @@ mme_app_handle_s6a_update_location_ans(
MME_APP_DEBUG("%s Handling imsi %"IMSI_FORMAT"\n", __FUNCTION__, imsi);
if ((ue_context_p = mme_ue_context_exists_imsi(&mme_app_desc.mme_ue_contexts, imsi)) == NULL) {
MME_APP_ERROR("That's embarrassing as we don't know this IMSI\n");
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"0 S6A_UPDATE_LOCATION unknown imsi %"IMSI_FORMAT,imsi);
return -1;
}
......
......@@ -42,6 +42,7 @@
#include "mme_app_statistics.h"
#include "assertions.h"
#include "msc.h"
mme_app_desc_t mme_app_desc;
......
......@@ -79,6 +79,7 @@ Description Defines the authentication EMM procedure executed by the
# if defined(NAS_BUILT_IN_EPC)
# include "nas_itti_messaging.h"
# endif
#include "msc.h"
#endif
/****************************************************************************/
......@@ -642,6 +643,14 @@ int emm_proc_authentication(void *ctx, unsigned int ueid, int ksi,
/*
* Notify EMM that common procedure has been initiated
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REQ ue id %u (authentication)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -745,6 +754,10 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
/* USIM has detected a mismatch in SQN.
* Ask for a new vector.
*/
MSC_LOG_EVENT(
MSC_NAS_EMM_MME,
"SQN SYNCH_FAILURE ue id %u", ueid);
LOG_TRACE(DEBUG, "EMM-PROC - USIM has detected a mismatch in SQN Ask for a new vector");
nas_itti_auth_info_req(ueid, emm_ctx->imsi, 0, res->value);
......@@ -762,6 +775,13 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
/*
* Notify EMM that the authentication procedure failed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -771,6 +791,12 @@ int emm_proc_authentication_complete(unsigned int ueid, int emm_cause,
/*
* Notify EMM that the authentication procedure successfully completed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_CNF ue id %u", ueid);
LOG_TRACE(DEBUG, "EMM-PROC - Notify EMM that the authentication procedure successfully completed");
emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -1417,6 +1443,13 @@ int _authentication_request(authentication_data_t *data)
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx,
emm_ctx->security, FALSE, TRUE);
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_SECURITY_REQ ue id %u", data->ueid);
rc = emm_sap_send(&emm_sap);
if (rc != RETURNerror) {
......
......@@ -59,6 +59,7 @@ Description Defines the detach related EMM procedure executed by the
#include "emm_sap.h"
#include "esm_sap.h"
#include "msc.h"
#include <stdlib.h> // free
......@@ -548,7 +549,12 @@ int emm_proc_detach_request(unsigned int ueid, emm_proc_detach_type_t type,
* Notify ESM that all EPS bearer contexts allocated for this UE have
* to be locally deactivated
*/
esm_sap_t esm_sap;
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_ESM_MME,
NULL,0,
"0 ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ ue id %u", ueid);
esm_sap_t esm_sap;
esm_sap.primitive = ESM_EPS_BEARER_CONTEXT_DEACTIVATE_REQ;
esm_sap.ueid = ueid;
esm_sap.ctx = emm_ctx;
......@@ -560,6 +566,11 @@ int emm_proc_detach_request(unsigned int ueid, emm_proc_detach_type_t type,
/*
* Notify EMM that the UE has been implicitly detached
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_DETACH_REQ ue id %u", ueid);
emm_sap.primitive = EMMREG_DETACH_REQ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......
......@@ -55,6 +55,7 @@ Description Defines the identification EMM procedure executed by the
#include "emmData.h"
#include "emm_sap.h"
#include "msc.h"
#include <stdlib.h> // malloc, free
#include <string.h> // memcpy
......@@ -326,6 +327,12 @@ int emm_proc_identification(unsigned int ueid,
/*
* Notify EMM that common procedure has been initiated
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REQ ue id %u (identification)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -433,6 +440,12 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi,
/*
* Notify EMM that the identification procedure successfully completed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_CNF ue id %u", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -442,6 +455,12 @@ int emm_proc_identification_complete(unsigned int ueid, const imsi_t *imsi,
/*
* Notify EMM that the identification procedure failed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -545,6 +564,12 @@ int _identification_request(identification_data_t *data)
* Notify EMM-AS SAP that Identity Request message has to be sent
* to the UE
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_SECURITY_REQ ue id %u", data->ueid);
emm_sap.primitive = EMMAS_SECURITY_REQ;
emm_sap.u.emm_as.u.security.guti = NULL;
emm_sap.u.emm_as.u.security.ueid = data->ueid;
......@@ -628,6 +653,11 @@ static int _identification_abort(void *args)
* Notify EMM that the identification procedure failed
*/
if (notify_failure) {
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......
......@@ -72,6 +72,7 @@ Description Defines the security mode control EMM procedure executed by the
# include "assertions.h"
#endif
#include "secu_defs.h"
#include "msc.h"
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
......@@ -582,6 +583,11 @@ int emm_proc_security_mode_control(unsigned int ueid, int ksi,
/*
* Notify EMM that common procedure has been initiated
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REQ ue id %u (security mode control)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REQ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -656,6 +662,11 @@ int emm_proc_security_mode_complete(unsigned int ueid)
/*
* Notify EMM that the authentication procedure successfully completed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_CNF ue id %u (security mode complete)", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_CNF;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -665,6 +676,11 @@ int emm_proc_security_mode_complete(unsigned int ueid)
/*
* Notify EMM that the authentication procedure failed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u (security mode complete)", ueid);
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
emm_sap.u.emm_reg.ctx = emm_ctx;
......@@ -750,6 +766,11 @@ int emm_proc_security_mode_reject(unsigned int ueid)
/*
* Notify EMM that the authentication procedure failed
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u (security mode reject)", ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......@@ -1091,6 +1112,11 @@ int _security_request(security_data_t *data, int is_new)
/* Setup EPS NAS security data */
emm_as_set_security_data(&emm_sap.u.emm_as.u.security.sctx,
emm_ctx->security, is_new, FALSE);
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_SECURITY_REQ ue id %u", data->ueid);
rc = emm_sap_send(&emm_sap);
if (rc != RETURNerror) {
......@@ -1152,6 +1178,11 @@ static int _security_abort(void *args)
* Notify EMM that the security mode control procedure failed
*/
if (notify_failure) {
MSC_LOG_TX_MESSAGE(
MSC_NAS_EMM_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMREG_COMMON_PROC_REJ ue id %u (security abort)", data->ueid);
emm_sap_t emm_sap;
emm_sap.primitive = EMMREG_COMMON_PROC_REJ;
emm_sap.u.emm_reg.ueid = ueid;
......
......@@ -66,6 +66,7 @@ Description Defines the EMMAS Service Access Point that provides
#if (defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(NAS_BUILT_IN_UE) && defined(NAS_UE))
# include "nas_itti_messaging.h"
#endif
#include "msc.h"
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
......@@ -1892,16 +1893,31 @@ static int _emm_as_security_req(const emm_as_security_t *msg,
/* Setup the NAS security message */
if (emm_msg != NULL) switch (msg->msgType) {
case EMM_AS_MSG_TYPE_IDENT:
if (msg->guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send IDENTITY_REQUEST to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send IDENTITY_REQUEST to ue id %u ", as_msg->UEid);
}
size = emm_send_identity_request(msg,
&emm_msg->identity_request);
break;
case EMM_AS_MSG_TYPE_AUTH:
if (msg->guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REQUEST to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REQUEST to ue id %u ", as_msg->UEid);
}
size = emm_send_authentication_request(msg,
&emm_msg->authentication_request);
break;
case EMM_AS_MSG_TYPE_SMC:
if (msg->guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send SECURITY_MODE_COMMAND to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send SECURITY_MODE_COMMAND to ue id %u ", as_msg->UEid);
}
size = emm_send_security_mode_command(msg,
&emm_msg->security_mode_command);
break;
......@@ -1992,6 +2008,11 @@ static int _emm_as_security_rej(const emm_as_security_t *msg,
/* Setup the NAS security message */
if (emm_msg != NULL) switch (msg->msgType) {
case EMM_AS_MSG_TYPE_AUTH:
if (msg->guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REJECT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send AUTHENTICATION_REJECT to ue id %u ", as_msg->UEid);
}
size = emm_send_authentication_reject(
&emm_msg->authentication_reject);
break;
......@@ -2087,6 +2108,9 @@ static int _emm_as_establish_cnf(const emm_as_establish_t *msg,
LOG_TRACE(WARNING,
"EMMAS-SAP - emm_as_establish.nasMSG.length=%d",
msg->NASmsg.length);
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send ATTACH_ACCEPT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
size = emm_send_attach_accept(msg, &emm_msg->attach_accept);
break;
......@@ -2200,10 +2224,20 @@ static int _emm_as_establish_rej(const emm_as_establish_t *msg,
/* Setup the NAS information message */
if (emm_msg != NULL) switch (msg->NASinfo) {
case EMM_AS_NAS_INFO_ATTACH:
if (msg->UEid.guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send ATTACH_REJECT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send ATTACH_REJECT to ue id %u ", as_msg->UEid);
}
size = emm_send_attach_reject(msg, &emm_msg->attach_reject);
break;
case EMM_AS_NAS_INFO_TAU:
if (msg->UEid.guti) {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send TRACKING_AREA_UPDATE_REJECT to s_TMSI %u.%u ", as_msg->s_tmsi.MMEcode, as_msg->s_tmsi.m_tmsi);
} else {
MSC_LOG_EVENT(MSC_NAS_EMM_MME, "send TRACKING_AREA_UPDATE_REJECT to ue id %u ", as_msg->UEid);
}
size = emm_send_tracking_area_update_reject(msg,
&emm_msg->tracking_area_update_reject);
break;
......
......@@ -51,6 +51,7 @@ Description NAS procedure call manager
#include "esm_main.h"
#include "esm_sap.h"
#include "msc.h"
#include <stdio.h> // sprintf
......@@ -1353,6 +1354,12 @@ int nas_proc_establish_ind(UInt32_t ueid, tac_t tac,
if (len > 0) {
emm_sap_t emm_sap;
MSC_LOG_TX_MESSAGE(
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_ESTABLISH_REQ ue id %u tac %u", ueid, tac);
/*
* Notify the EMM procedure call manager that NAS signalling
* connection establishment indication message has been received
......@@ -1391,6 +1398,12 @@ int nas_proc_dl_transfer_cnf(UInt32_t ueid)
emm_sap_t emm_sap;
int rc;
MSC_LOG_TX_MESSAGE(
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_DATA_IND dl_transfer_conf ue id %u", ueid);
/*
* Notify the EMM procedure call manager that downlink NAS message
* has been successfully delivered to the NAS sublayer on the
......@@ -1428,6 +1441,12 @@ int nas_proc_dl_transfer_rej(UInt32_t ueid)
emm_sap_t emm_sap;
int rc;
MSC_LOG_TX_MESSAGE(
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_DATA_IND dl_transfer_reject ue id %u", ueid);
/*
* Notify the EMM procedure call manager that transmission
* failure of downlink NAS message indication has been received
......@@ -1471,6 +1490,12 @@ int nas_proc_ul_transfer_ind(UInt32_t ueid, const Byte_t *data, UInt32_t len)
* Notify the EMM procedure call manager that data transfer
* indication has been received from the Access-Stratum sublayer
*/
MSC_LOG_TX_MESSAGE(
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_DATA_IND ue id %u len %u", ueid, len);
emm_sap.primitive = EMMAS_DATA_IND;
emm_sap.u.emm_as.u.data.ueid = ueid;
emm_sap.u.emm_as.u.data.delivered = TRUE;
......@@ -1490,6 +1515,12 @@ int nas_proc_auth_param_res(emm_cn_auth_res_t *emm_cn_auth_res)
LOG_FUNC_IN;
MSC_LOG_TX_MESSAGE(
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMCN_AUTHENTICATION_PARAM_RES");
emm_sap.primitive = EMMCN_AUTHENTICATION_PARAM_RES;
emm_sap.u.emm_cn.u.auth_res = emm_cn_auth_res;
......@@ -1505,6 +1536,12 @@ int nas_proc_auth_param_fail(emm_cn_auth_fail_t *emm_cn_auth_fail)
LOG_FUNC_IN;
MSC_LOG_TX_MESSAGE(
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMCN_AUTHENTICATION_PARAM_FAIL");
emm_sap.primitive = EMMCN_AUTHENTICATION_PARAM_FAIL;
emm_sap.u.emm_cn.u.auth_fail = emm_cn_auth_fail;
......@@ -1520,6 +1557,12 @@ int nas_proc_deregister_ue(UInt32_t ue_id)
LOG_FUNC_IN;