Commit 74a53a0f authored by Raymond Knopp's avatar Raymond Knopp

better handling of s1ap ue context release request, better mscgen logs


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7382 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 65f17704
......@@ -51,9 +51,11 @@
#include "msc.h"
//------------------------------------------------------------------------------
int
mme_app_send_s11_release_access_bearers_req(
struct ue_context_s * const ue_context_pP)
//------------------------------------------------------------------------------
{
uint8_t i = 0;
task_id_t to_task = TASK_UNKNOWN;
......@@ -85,16 +87,19 @@ mme_app_send_s11_release_access_bearers_req(
(to_task == TASK_S11) ? MSC_S11_MME:MSC_SP_GWAPP_MME,
NULL,0,
"0 SGW_RELEASE_ACCESS_BEARERS_REQUEST teid %u ebi %u",
SGW_RELEASE_ACCESS_BEARERS_REQUEST(message_p).teid,
release_access_bearers_request_p->teid,
release_access_bearers_request_p->list_of_rabs[0]);
itti_send_msg_to_task(to_task, INSTANCE_DEFAULT, message_p);
}
//------------------------------------------------------------------------------
int
mme_app_send_s11_create_session_req(
struct ue_context_s * const ue_context_pP)
//------------------------------------------------------------------------------
{
uint8_t i = 0;
task_id_t to_task = TASK_UNKNOWN;
......@@ -266,9 +271,11 @@ mme_app_send_s11_create_session_req(
//------------------------------------------------------------------------------
int
mme_app_handle_nas_pdn_connectivity_req(
nas_pdn_connectivity_req_t * const nas_pdn_connectivity_req_pP)
//------------------------------------------------------------------------------
{
struct ue_context_s *ue_context_p = NULL;
uint64_t imsi = 0;
......@@ -335,9 +342,11 @@ mme_app_handle_nas_pdn_connectivity_req(
// sent by NAS
//------------------------------------------------------------------------------
void
mme_app_handle_conn_est_cnf(
const nas_conn_est_cnf_t * const nas_conn_est_cnf_pP)
//------------------------------------------------------------------------------
{
struct ue_context_s *ue_context_p = NULL;
MessageDef *message_p = NULL;
......@@ -355,7 +364,7 @@ mme_app_handle_conn_est_cnf(
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",
MME_APP_ERROR("UE context doesn't exist for UE %06"PRIX32"/dec%u\n",
nas_conn_est_cnf_pP->UEid,
nas_conn_est_cnf_pP->UEid);
return;
......@@ -427,9 +436,11 @@ mme_app_handle_conn_est_cnf(
// sent by S1AP
//------------------------------------------------------------------------------
void
mme_app_handle_conn_est_ind(
const mme_app_connection_establishment_ind_t * const conn_est_ind_pP)
//------------------------------------------------------------------------------
{
struct ue_context_s *ue_context_p = NULL;
MessageDef *message_p = NULL;
......@@ -443,7 +454,7 @@ mme_app_handle_conn_est_ind(
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",
MME_APP_DEBUG("We didn't find this mme_ue_s1ap_id in list of UE: %06"PRIX32"/dec%u\n",
conn_est_ind_pP->mme_ue_s1ap_id,
conn_est_ind_pP->mme_ue_s1ap_id);
MME_APP_DEBUG("UE context doesn't exist -> create one\n");
......@@ -488,9 +499,11 @@ mme_app_handle_conn_est_ind(
//------------------------------------------------------------------------------
int
mme_app_handle_create_sess_resp(
const SgwCreateSessionResponse * const create_sess_resp_pP)
//------------------------------------------------------------------------------
{
struct ue_context_s *ue_context_p = NULL;
bearer_context_t *current_bearer_p = NULL;
......@@ -763,9 +776,11 @@ mme_app_handle_create_sess_resp(
//------------------------------------------------------------------------------
void
mme_app_handle_initial_context_setup_rsp(
const mme_app_initial_context_setup_rsp_t * const initial_ctxt_setup_rsp_pP)
//------------------------------------------------------------------------------
{
struct ue_context_s *ue_context_p = NULL;
MessageDef *message_p = NULL;
......@@ -832,3 +847,42 @@ mme_app_handle_initial_context_setup_rsp(
itti_send_msg_to_task(to_task, INSTANCE_DEFAULT, message_p);
}
//------------------------------------------------------------------------------
void mme_app_handle_release_access_bearers_resp(
const SgwReleaseAccessBearersResponse * const rel_access_bearers_rsp_pP)
//------------------------------------------------------------------------------
{
MessageDef *message_p = NULL;
struct ue_context_s *ue_context_p = NULL;
ue_context_p = mme_ue_context_exists_s11_teid(&mme_app_desc.mme_ue_contexts,
rel_access_bearers_rsp_pP->teid);
if (ue_context_p == NULL) {
MME_APP_DEBUG("We didn't find this teid in list of UE: %06"PRIX32"\n",
rel_access_bearers_rsp_pP->teid);
return;
}
message_p = itti_alloc_new_message(TASK_MME_APP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
AssertFatal(message_p != NULL, "itti_alloc_new_message Failed");
memset((void*)&message_p->ittiMsg.s1ap_ue_context_release_command,
0,
sizeof(s1ap_ue_context_release_command_t));
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).mme_ue_s1ap_id = ue_context_p->mme_ue_s1ap_id;
MSC_LOG_TX_MESSAGE(
MSC_MMEAPP_MME,
MSC_S1AP_MME,
NULL,0,
"0 S1AP_UE_CONTEXT_RELEASE_COMMAND mme_ue_s1ap_id %06"PRIX32" ",
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).mme_ue_s1ap_id);
itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
......@@ -462,7 +462,7 @@ void mme_app_handle_s1ap_ue_context_release_req(const s1ap_ue_context_release_re
MSC_LOG_EVENT(
MSC_MMEAPP_MME,
"S1AP_UE_CONTEXT_RELEASE_REQ Unknown ue %u",s1ap_ue_context_release_req->mme_ue_s1ap_id);
MME_APP_ERROR("UE context doesn't exist for UE 0x%08X/dec%u\n",
MME_APP_ERROR("UE context doesn't exist for UE 0x%06"PRIX32"/dec%u\n",
s1ap_ue_context_release_req->mme_ue_s1ap_id,
s1ap_ue_context_release_req->mme_ue_s1ap_id);
return;
......
......@@ -39,7 +39,7 @@ 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);
"NAS_AUTHENTICATION_PARAM_FAIL ue %06"PRIX32" cause %u",ue_id, cause);
message_p = itti_alloc_new_message(TASK_MME_APP, NAS_AUTHENTICATION_PARAM_FAIL);
......@@ -50,7 +50,7 @@ mme_app_itti_auth_fail(
MSC_MMEAPP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_AUTHENTICATION_PARAM_FAIL ue_id %u cause %u",
"0 NAS_AUTHENTICATION_PARAM_FAIL ue_id %06"PRIX32" cause %u",
ue_id, cause);
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
......@@ -75,7 +75,7 @@ static inline void mme_app_itti_auth_rsp(
MSC_MMEAPP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_AUTHENTICATION_PARAM_RSP ue_id %u nb_vectors %u",
"0 NAS_AUTHENTICATION_PARAM_RSP ue_id %06"PRIX32" nb_vectors %u",
ue_id, nb_vectors);
itti_send_msg_to_task(TASK_NAS_MME, INSTANCE_DEFAULT, message_p);
}
......
......@@ -87,6 +87,11 @@ void *mme_app_thread(void *args)
}
break;
case SGW_RELEASE_ACCESS_BEARERS_RESPONSE: {
mme_app_handle_release_access_bearers_resp(&received_message_p->ittiMsg.sgwReleaseAccessBearersResponse);
}
break;
#if defined(DISABLE_USE_NAS)
case NAS_ATTACH_REQ: {
......
......@@ -1359,7 +1359,7 @@ int nas_proc_establish_ind(UInt32_t ueid, tac_t tac,
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_ESTABLISH_REQ ue id %u tac %u", ueid, tac);
"0 EMMAS_ESTABLISH_REQ ue id %06"PRIX32" tac %u", ueid, tac);
/*
* Notify the EMM procedure call manager that NAS signalling
* connection establishment indication message has been received
......@@ -1402,7 +1402,7 @@ int nas_proc_dl_transfer_cnf(UInt32_t ueid)
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_DATA_IND dl_transfer_conf ue id %u", ueid);
"0 EMMAS_DATA_IND dl_transfer_conf ue id %06"PRIX32"", ueid);
/*
* Notify the EMM procedure call manager that downlink NAS message
......@@ -1445,7 +1445,7 @@ int nas_proc_dl_transfer_rej(UInt32_t ueid)
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_DATA_IND dl_transfer_reject ue id %u", ueid);
"0 EMMAS_DATA_IND dl_transfer_reject ue id %06"PRIX32"", ueid);
/*
* Notify the EMM procedure call manager that transmission
......@@ -1494,7 +1494,7 @@ int nas_proc_ul_transfer_ind(UInt32_t ueid, const Byte_t *data, UInt32_t len)
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMAS_DATA_IND ue id %u len %u", ueid, len);
"0 EMMAS_DATA_IND ue id %06"PRIX32" len %u", ueid, len);
emm_sap.primitive = EMMAS_DATA_IND;
emm_sap.u.emm_as.u.data.ueid = ueid;
......@@ -1561,7 +1561,7 @@ int nas_proc_deregister_ue(UInt32_t ue_id)
MSC_NAS_MME,
MSC_NAS_EMM_MME,
NULL,0,
"0 EMMCN_DEREGISTER_UE ue_id %u",ue_id);
"0 EMMCN_DEREGISTER_UE ue_id %06"PRIX32"",ue_id);
emm_sap.primitive = EMMCN_DEREGISTER_UE;
emm_sap.u.emm_cn.u.deregister.UEid = ue_id;
......
......@@ -205,7 +205,7 @@ int nas_itti_dl_data_req(const uint32_t ue_id, void *const data,
MSC_NAS_MME,
MSC_S1AP_MME,
NULL,0,
"0 NAS_DOWNLINK_DATA_REQ ue id %u len %u", ue_id, length);
"0 NAS_DOWNLINK_DATA_REQ ue id %06"PRIX32" len %u", ue_id, length);
return itti_send_msg_to_task(TASK_S1AP, INSTANCE_DEFAULT, message_p);
}
......
......@@ -129,7 +129,7 @@ static inline void nas_itti_pdn_connectivity_req(
MSC_NAS_MME,
MSC_MMEAPP_MME,
NULL,0,
"0 NAS_PDN_CONNECTIVITY_REQ ue id %u IMSI %X",
"0 NAS_PDN_CONNECTIVITY_REQ ue id %06"PRIX32" IMSI %X",
ueidP, NAS_PDN_CONNECTIVITY_REQ(message_p).imsi);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
......@@ -162,7 +162,7 @@ static inline void nas_itti_establish_cnf(
MSC_NAS_MME,
MSC_MMEAPP_MME,
NULL,0,
"0 NAS_CONNECTION_ESTABLISHMENT_CNF ue id %u len %u sea %x sia %x ",
"0 NAS_CONNECTION_ESTABLISHMENT_CNF ue id %06"PRIX32" len %u sea %x sia %x ",
ue_idP, lengthP, selected_encryption_algorithmP, selected_integrity_algorithmP);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
......@@ -209,7 +209,7 @@ static inline void nas_itti_auth_info_req(
MSC_NAS_MME,
MSC_MMEAPP_MME,
NULL,0,
"0 NAS_AUTHENTICATION_PARAM_REQ ue id %u IMSI %s ",
"0 NAS_AUTHENTICATION_PARAM_REQ ue id %06"PRIX32" IMSI %s ",
ue_idP, NAS_AUTHENTICATION_PARAM_REQ(message_p).imsi);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
......@@ -246,7 +246,7 @@ static inline void nas_itti_establish_rej(
MSC_NAS_MME,
MSC_MMEAPP_MME,
NULL,0,
"0 NAS_AUTHENTICATION_PARAM_REQ ue id %u IMSI %s (establish reject)",
"0 NAS_AUTHENTICATION_PARAM_REQ ue id %06"PRIX32" IMSI %s (establish reject)",
ue_idP, NAS_AUTHENTICATION_PARAM_REQ(message_p).imsi);
itti_send_msg_to_task(TASK_MME_APP, INSTANCE_DEFAULT, message_p);
......
......@@ -397,6 +397,8 @@ inline void ASN_DEBUG(const char *fmt, ...);
# define TRUE (!FALSE)
#endif
#define S1AP_UE_ID_FMT "0x%06"PRIX32
extern int asn_debug;
extern int asn1_xer_print;
......
......@@ -156,6 +156,11 @@ void *s1ap_mme_thread(void *args)
}
break;
case S1AP_UE_CONTEXT_RELEASE_COMMAND: {
s1ap_handle_ue_context_release_command(&received_message_p->ittiMsg.s1ap_ue_context_release_command);
}
break;
#if defined(DISABLE_USE_NAS)
case NAS_ATTACH_ACCEPT: {
......@@ -436,6 +441,9 @@ void s1ap_remove_ue(ue_description_t *ue_ref)
/* Remove any attached timer */
// s1ap_timer_remove_ue(ue_ref->mme_ue_s1ap_id);
STAILQ_REMOVE(&eNB_ref->ue_list_head, ue_ref, ue_description_s, ue_entries);
eNB_ref->nb_ue_associated--;
/* Freeing memory */
free(ue_ref);
ue_ref = NULL;
......
This diff is collapsed.
......@@ -63,6 +63,9 @@ int s1ap_mme_handle_path_switch_request(uint32_t assoc_id, uint32_t stream,
int s1ap_mme_handle_ue_context_release_request(uint32_t assoc_id,
uint32_t stream, struct s1ap_message_s *message_p);
int s1ap_handle_ue_context_release_command(
const s1ap_ue_context_release_command_t * const ue_context_release_command_pP);
int s1ap_mme_handle_ue_context_release_complete(uint32_t assoc_id,
uint32_t stream, struct s1ap_message_s *message_p);
......
......@@ -59,7 +59,7 @@ int s1ap_mme_itti_nas_uplink_ind(const uint32_t ue_id, uint8_t * const buffer,
MSC_S1AP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_UPLINK_DATA_IND ue_id %u len %u",
"0 NAS_UPLINK_DATA_IND ue_id "S1AP_UE_ID_FMT" len %u",
NAS_UL_DATA_IND(message_p).UEid,
NAS_UL_DATA_IND(message_p).nasMsg.length);
......@@ -80,7 +80,7 @@ int s1ap_mme_itti_nas_downlink_cnf(const uint32_t ue_id,
MSC_S1AP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_DOWNLINK_DATA_CNF ue_id %u errCode %u",
"0 NAS_DOWNLINK_DATA_CNF ue_id "S1AP_UE_ID_FMT" errCode %u",
NAS_DL_DATA_CNF(message_p).UEid,
NAS_DL_DATA_CNF(message_p).errCode);
......
......@@ -31,6 +31,7 @@
#include <string.h>
#include "intertask_interface.h"
#include "s1ap_common.h"
#include "msc.h"
#ifndef S1AP_MME_ITTI_MESSAGING_H_
......@@ -73,7 +74,7 @@ static inline void s1ap_mme_itti_mme_app_establish_ind(
MSC_S1AP_MME,
MSC_MMEAPP_MME,
NULL,0,
"0 MME_APP_CONNECTION_ESTABLISHMENT_IND ue_id %u as cause %u tac %u len %u",
"0 MME_APP_CONNECTION_ESTABLISHMENT_IND ue_id "S1AP_UE_ID_FMT" as cause %u tac %u len %u",
ue_id,
MME_APP_CONNECTION_ESTABLISHMENT_IND(message_p).nas.asCause,
MME_APP_CONNECTION_ESTABLISHMENT_IND(message_p).nas.tac,
......@@ -107,7 +108,7 @@ static inline void s1ap_mme_itti_nas_establish_ind(
MSC_S1AP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_CONNECTION_ESTABLISHMENT_IND ue_id %u as cause %u tac %u len %u",
"0 NAS_CONNECTION_ESTABLISHMENT_IND ue_id "S1AP_UE_ID_FMT" as cause %u tac %u len %u",
ue_id,
NAS_CONN_EST_IND(message_p).nas.asCause,
NAS_CONN_EST_IND(message_p).nas.tac,
......@@ -138,7 +139,7 @@ static inline void s1ap_mme_itti_nas_non_delivery_ind(
MSC_S1AP_MME,
MSC_NAS_MME,
NULL,0,
"0 NAS_DOWNLINK_DATA_REJ ue_id %u len %u",
"0 NAS_DOWNLINK_DATA_REJ ue_id "S1AP_UE_ID_FMT" len %u",
ue_id,
NAS_DL_DATA_REJ(message_p).nasMsg.length);
......
......@@ -56,6 +56,7 @@
static uint32_t mme_ue_s1ap_id = 0;
static uint8_t mme_ue_s1ap_id_has_wrapped = 0;
extern const char *s1ap_direction2String[];
int s1ap_mme_handle_initial_ue_message(uint32_t assoc_id, uint32_t stream,
......@@ -68,6 +69,14 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assoc_id, uint32_t stream,
initialUEMessage_p = &message->msg.s1ap_InitialUEMessageIEs;
MSC_LOG_RX_MESSAGE(
MSC_S1AP_MME,
MSC_S1AP_ENB,
NULL,0,
"0 initialUEMessage/%s assoc_id %u stream %u "S1AP_UE_ID_FMT" ",
s1ap_direction2String[message->direction],
assoc_id, stream, initialUEMessage_p->eNB_UE_S1AP_ID);
if ((eNB_ref = s1ap_is_eNB_assoc_id_in_list(assoc_id)) == NULL) {
S1AP_DEBUG("Unkwnon eNB on assoc_id %d\n", assoc_id);
return -1;
......@@ -76,7 +85,7 @@ int s1ap_mme_handle_initial_ue_message(uint32_t assoc_id, uint32_t stream,
// eNB UE S1AP ID is limited to 24 bits
eNB_ue_s1ap_id = (uint32_t)(initialUEMessage_p->eNB_UE_S1AP_ID & 0x00ffffff);
S1AP_DEBUG("New Initial UE message received with eNB UE S1AP ID: 0x%06x\n",
S1AP_DEBUG("New Initial UE message received with eNB UE S1AP ID: "S1AP_UE_ID_FMT"\n",
eNB_ue_s1ap_id);
ue_ref = s1ap_is_ue_eNB_id_in_list(eNB_ref, eNB_ue_s1ap_id);
......@@ -168,14 +177,15 @@ int s1ap_mme_handle_uplink_nas_transport(uint32_t assoc_id, uint32_t stream,
MSC_S1AP_MME,
MSC_S1AP_ENB,
NULL,0,
"0 UPLINK_NAS_TRANSPORT mme_ue_s1ap_id %u eNB_ue_s1ap_id %u nas len %u",
"0 uplinkNASTransport/%s mme_ue_s1ap_id "S1AP_UE_ID_FMT" eNB_ue_s1ap_id "S1AP_UE_ID_FMT" nas len %u",
s1ap_direction2String[message->direction],
uplinkNASTransport_p->mme_ue_s1ap_id,
uplinkNASTransport_p->eNB_UE_S1AP_ID,
uplinkNASTransport_p->nas_pdu.size);
if ((ue_ref = s1ap_is_ue_mme_id_in_list(uplinkNASTransport_p->mme_ue_s1ap_id))
== NULL) {
S1AP_DEBUG("No UE is attached to this mme UE s1ap id: %d\n",
S1AP_DEBUG("No UE is attached to this mme UE s1ap id: "S1AP_UE_ID_FMT"\n",
(int)uplinkNASTransport_p->mme_ue_s1ap_id);
return -1;
}
......@@ -215,7 +225,8 @@ int s1ap_mme_handle_nas_non_delivery(uint32_t assoc_id, uint32_t stream,
MSC_S1AP_MME,
MSC_S1AP_ENB,
NULL,0,
"0 NAS_NON_DELIVERY_IND mme_ue_s1ap_id %u eNB_ue_s1ap_id %u cause %u nas len %u",
"0 NASNonDeliveryIndication/%s mme_ue_s1ap_id "S1AP_UE_ID_FMT" eNB_ue_s1ap_id "S1AP_UE_ID_FMT" cause %u nas len %u",
s1ap_direction2String[message->direction],
nasNonDeliveryIndication_p->mme_ue_s1ap_id,
nasNonDeliveryIndication_p->eNB_UE_S1AP_ID,
nasNonDeliveryIndication_p->cause,
......@@ -223,7 +234,7 @@ int s1ap_mme_handle_nas_non_delivery(uint32_t assoc_id, uint32_t stream,
if ((ue_ref = s1ap_is_ue_mme_id_in_list(nasNonDeliveryIndication_p->mme_ue_s1ap_id))
== NULL) {
S1AP_DEBUG("No UE is attached to this mme UE s1ap id: %d\n",
S1AP_DEBUG("No UE is attached to this mme UE s1ap id: "S1AP_UE_ID_FMT"\n",
(int)nasNonDeliveryIndication_p->mme_ue_s1ap_id);
return -1;
}
......@@ -252,7 +263,7 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data
/* If the UE-associated logical S1-connection is not established,
* the MME shall allocate a unique MME UE S1AP ID to be used for the UE.
*/
S1AP_DEBUG("Unknown UE MME ID %08X, This case is not handled right now\n", ue_id);
S1AP_DEBUG("Unknown UE MME ID "S1AP_UE_ID_FMT", This case is not handled right now\n", ue_id);
return -1;
} else {
......@@ -284,7 +295,7 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data
return -1;
}
S1AP_DEBUG("Send S1ap_ProcedureCode_id_downlinkNASTransport ue_id = 0x%08X mme_ue_s1ap_id = 0x%08X eNB_UE_S1AP_ID = 0x%08X\n",
S1AP_DEBUG("Send S1ap_ProcedureCode_id_downlinkNASTransport ue_id = "S1AP_UE_ID_FMT" mme_ue_s1ap_id = "S1AP_UE_ID_FMT" eNB_UE_S1AP_ID = "S1AP_UE_ID_FMT"\n",
ue_id,
downlinkNasTransport->mme_ue_s1ap_id,
downlinkNasTransport->eNB_UE_S1AP_ID);
......@@ -293,7 +304,7 @@ int s1ap_generate_downlink_nas_transport(const uint32_t ue_id, void * const data
MSC_S1AP_MME,
MSC_S1AP_ENB,
NULL,0,
"0 DOWNLINK_NAS_TRANSPORT ue_id %u mme_ue_s1ap_id %u eNB_ue_s1ap_id %u nas length %u",
"0 downlinkNASTransport/initiatingMessage ue_id "S1AP_UE_ID_FMT" mme_ue_s1ap_id "S1AP_UE_ID_FMT" eNB_ue_s1ap_id"S1AP_UE_ID_FMT" nas length %u",
ue_id,
downlinkNasTransport->mme_ue_s1ap_id,
downlinkNasTransport->eNB_UE_S1AP_ID,
......@@ -331,7 +342,7 @@ int s1ap_handle_attach_accepted(nas_attach_accept_t *attach_accept_p)
initial_p = &attach_accept_p->transparent;
if ((ue_ref = s1ap_is_ue_mme_id_in_list(initial_p->mme_ue_s1ap_id)) == NULL) {
S1AP_DEBUG("This mme ue s1ap id (%08x) is not attached to any UE context\n",
S1AP_DEBUG("This mme ue s1ap id ("S1AP_UE_ID_FMT") is not attached to any UE context\n",
initial_p->mme_ue_s1ap_id);
return -1;
}
......@@ -603,7 +614,7 @@ void s1ap_handle_conn_est_cnf(const mme_app_connection_establishment_cnf_t * con
DevAssert(conn_est_cnf_pP != NULL);
if ((ue_ref = s1ap_is_ue_mme_id_in_list(conn_est_cnf_pP->nas_conn_est_cnf.UEid)) == NULL) {
S1AP_DEBUG("This mme ue s1ap id (%08x) is not attached to any UE context\n",
S1AP_DEBUG("This mme ue s1ap id ("S1AP_UE_ID_FMT") is not attached to any UE context\n",
conn_est_cnf_pP->nas_conn_est_cnf.UEid);
DevParam(conn_est_cnf_pP->nas_conn_est_cnf.UEid, 0, 0);
......@@ -739,10 +750,11 @@ void s1ap_handle_conn_est_cnf(const mme_app_connection_establishment_cnf_t * con
MSC_S1AP_MME,
MSC_S1AP_ENB,
NULL,0,
"0 INITIAL_CONTEXT_SETUP mme_ue_s1ap_id %u eNB_ue_s1ap_id %u nas length %u",
"0 InitialContextSetup/initiatingMessage mme_ue_s1ap_id "S1AP_UE_ID_FMT" eNB_ue_s1ap_id "S1AP_UE_ID_FMT" nas length %u",
initialContextSetupRequest_p->mme_ue_s1ap_id,
initialContextSetupRequest_p->eNB_UE_S1AP_ID,
nas_pdu.size);
s1ap_mme_itti_send_sctp_request(
buffer_p,
length,
......
......@@ -113,7 +113,7 @@ int s1ap_handle_timer_expiry(timer_has_expired_t *timer_has_expired)
if ((find = RB_FIND(s1ap_timer_map, &s1ap_timer_tree, &elm)) == NULL) {
S1AP_WARN("Timer id 0x%lx has not been found in tree. Maybe the timer "
"reference has been removed before receiving tiemr signal\n",
"reference has been removed before receiving timer signal\n",
timer_has_expired->timer_id);
return 0;
}
......@@ -132,7 +132,7 @@ int s1ap_timer_remove_ue(uint32_t mme_ue_s1ap_id)
{
struct s1ap_timer_map_s *find;
S1AP_DEBUG("Removing timer associated with UE 0x%08x\n",
S1AP_DEBUG("Removing timer associated with UE "S1AP_UE_ID_FMT"\n",
mme_ue_s1ap_id);
DevAssert(mme_ue_s1ap_id != 0);
......
......@@ -758,7 +758,7 @@ sgw_lite_handle_sgi_endpoint_updated(
ret = snprintf(cmd,
256,
"iptables -t mangle -I %s -d %u.%u.%u.%u -m mark --mark 0 -j GTPUAH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action add",
(spgw_config.sgw_config.local_to_eNB) ? "INPUT":"POSTROUTING",
(spgw_config.sgw_config.local_to_eNB) ? "FORWARD":"POSTROUTING",
eps_bearer_entry_p->paa.ipv4_address[0],
eps_bearer_entry_p->paa.ipv4_address[1],
eps_bearer_entry_p->paa.ipv4_address[2],
......@@ -789,7 +789,7 @@ sgw_lite_handle_sgi_endpoint_updated(
ret = snprintf(cmd,
256,
"iptables -t mangle -I %s -d %u.%u.%u.%u -m mark --mark %u -j GTPUAH --own-ip %u.%u.%u.%u --own-tun %u --peer-ip %u.%u.%u.%u --peer-tun %u --action add",
(spgw_config.sgw_config.local_to_eNB) ? "INPUT":"POSTROUTING",
(spgw_config.sgw_config.local_to_eNB) ? "FORWARD":"POSTROUTING",
eps_bearer_entry_p->paa.ipv4_address[0],
eps_bearer_entry_p->paa.ipv4_address[1],
eps_bearer_entry_p->paa.ipv4_address[2],
......
......@@ -138,28 +138,33 @@ int sgw_lite_init(char* config_file_name_pP)
{
SPGW_APP_DEBUG("Initializing SPGW-APP task interface\n");
#if defined (ENABLE_USE_GTPU_IN_KERNEL)
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -P INPUT ACCEPT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F INPUT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F INPUT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -P OUTPUT ACCEPT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F OUTPUT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F OUTPUT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -P FORWARD ACCEPT", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F FORWARD", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t nat -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -F FORWARD", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t nat -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t mangle -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t filter -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t raw -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("ip route flush cache", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t raw -F", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t nat -Z", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t mangle -Z", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t filter -Z", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("iptables -t raw -Z", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("ip route flush cache", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod xt_GTPUAH xt_GTPURH > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_raw > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_mangle > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_nat > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod iptable_filter > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod ip_tables > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod xt_state xt_mark xt_GTPUAH xt_GTPURH xt_tcpudp xt_connmark ipt_LOG ipt_MASQUERADE > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod xt_state xt_mark xt_tcpudp xt_connmark ipt_LOG ipt_MASQUERADE > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod x_tables > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("rmmod nf_conntrack_netlink nfnetlink nf_nat nf_conntrack_ipv4 nf_conntrack > /dev/null 2>&1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe ip_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe iptable_filter", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe iptable_mangle", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe iptable_nat", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
......@@ -167,10 +172,9 @@ int sgw_lite_init(char* config_file_name_pP)
spgw_system("modprobe ipt_MASQUERADE", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe ipt_LOG", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe nf_conntrack", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe nf_conntrack_ipv4", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe nf_conntrack_ipv4", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe nf_nat", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.netfilter.ip_conntrack_max=16000", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("modprobe x_tables", SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.ip_forward=1", SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.conf.all.accept_local=1",SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
spgw_system("sysctl -w net.ipv4.conf.all.log_martians=1",SPGW_WARN_ON_ERROR, __FILE__, __LINE__);
......
......@@ -296,14 +296,14 @@ int spgw_config_process(spgw_config_t* config_pP)
ret = -1;
}
}
if (snprintf(system_cmd, 256,
/* if (snprintf(system_cmd, 256,
"iptables -I INPUT -t mangle -i %s ! --protocol sctp -j CONNMARK --restore-mark",
config_pP->pgw_config.ipv4.pgw_interface_name_for_SGI) > 0) {
ret += spgw_system(system_cmd, SPGW_ABORT_ON_ERROR, __FILE__, __LINE__);
} else {
SPGW_APP_ERROR("Restore mark\n");
ret = -1;
}
}*/
if (snprintf(system_cmd, 256,
"iptables -I PREROUTING -t mangle -i %s ! --protocol sctp -j CONNMARK --restore-mark",
config_pP->pgw_config.ipv4.pgw_interface_name_for_SGI) > 0) {
......
......@@ -19,9 +19,9 @@ import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--diag_rlc_um", "-u", type=str,help="Try to find RLC protocol diagnostics", default="no")
parser.add_argument("--dir", "-d", type=str,help="Directory where msc logs can be found", default="/tmp")
parser.add_argument("--profile", "-p", type=str,help="E_UTRAN, EPC", default="EPC")
args = parser.parse_args()
MSCGEN_OUTPUT_TYPE = "png"
MAX_MESSAGES_PER_PAGE = 36
......@@ -80,22 +80,10 @@ g_diag_rlc_sn = {}
g_sequence_generator = 0
def sequence_number_generator():
global g_sequence_generator
l_seq = g_sequence_generator
g_sequence_generator = g_sequence_generator + 1
return l_seq
def file_is_empty(fpath):
return False if os.path.isfile(fpath) and os.path.getsize(fpath) > 0 else True
def parse_oai_log_files():
global g_entities_dic
global g_entities
global g_messages
global g_final_display_order_list
#open TXT file that contain OAI filtered traces for mscgen
filenames = [
g_filenames = []
if "E_UTRAN" == args.profile.strip():
g_filenames = [
args.dir+'/openair.msc.ip_ue.log',
args.dir+'/openair.msc.ip_enb.log',
args.dir+'/openair.msc.nas_ue.log',
......@@ -109,6 +97,14 @@ def parse_oai_log_files():
args.dir+'/openair.msc.rlc_enb.log',
args.dir+'/openair.msc.pdcp_enb.log',
args.dir+'/openair.msc.rrc_enb.log',
args.dir+'/openair.msc.s1ap_enb.log',
args.dir+'/openair.msc.gtpu_enb.log',
args.dir+'/openair.msc.mme_app.log',
args.dir+'/openair.msc.nas_mme.log',
args.dir+'/openair.msc.gtpu_sgw.log',
args.dir+'/openair.msc.s1ap_mme.log']
elif "EPC" == args.profile.strip():
g_filenames = [
args.dir+'/openair.msc.s1ap_enb.log',
args.dir+'/openair.msc.gtpu_enb.log',
args.dir+'/openair.msc.mme_app.log',
......@@ -122,9 +118,25 @@ def parse_oai_log_files():
args.dir+'/openair.msc.s1ap_mme.log',
args.dir+'/openair.msc.hss.log']
def sequence_number_generator():
global g_sequence_generator
l_seq = g_sequence_generator
g_sequence_generator = g_sequence_generator + 1
return l_seq
def file_is_empty(fpath):
return False if os.path.isfile(fpath) and os.path.getsize(fpath) > 0 else True
def parse_oai_log_files():
global g_entities_dic
global g_entities
global g_messages
global g_final_display_order_list
#open TXT file that contain OAI filtered traces for mscgen
# we may insert diagnostic events
event_id_offset = 0
for filename in filenames:
for filename in g_filenames:
if file_is_empty(filename):
continue
try:
......@@ -136,7 +148,7 @@ def parse_oai_log_files():
lines = fcontent.splitlines()
for line in lines:
if line.strip() != "" and not line.strip().startswith('#'):
#print ("INPUT LINE: %s " % line)
print ("INPUT LINE: %s " % line)
partition = line.split(' ',3)
event_id = int(partition[0]) + event_id_offset
event_type = partition[1]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment