restructure handle_initial_ue_message

master
David Rupprecht 6 years ago
parent 0dfa6426dd
commit 894471e326

@ -101,73 +101,72 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
bool rtn = true; bool rtn = true;
liblte_mme_parse_msg_header((LIBLTE_BYTE_MSG_STRUCT *) nas_msg, &pd, &msg_type); liblte_mme_parse_msg_header((LIBLTE_BYTE_MSG_STRUCT *)nas_msg, &pd, &msg_type);
switch(msg_type) switch (msg_type)
{ {
case LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST: case LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST:
m_s1ap_log->info("Received Attach Request \n"); m_s1ap_log->info("Received Attach Request \n");
m_s1ap_log->console("Received Attach Request \n"); m_s1ap_log->console("Received Attach Request \n");
handle_nas_attach_request(enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri); handle_nas_attach_request(enb_ue_s1ap_id, nas_msg, reply_buffer, reply_flag, enb_sri);
break; break;
case LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST: case LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST:
m_s1ap_log->info("Received Service Request \n"); m_s1ap_log->info("Received Service Request \n");
m_s1ap_log->console("Received Service Request \n"); m_s1ap_log->console("Received Service Request \n");
if(!init_ue->S_TMSI_present) if (!init_ue->S_TMSI_present)
{ {
m_s1ap_log->error("Service request -- S-TMSI not present\n"); m_s1ap_log->error("Service request -- S-TMSI not present\n");
m_s1ap_log->console("Service request -- S-TMSI not present\n" ); m_s1ap_log->console("Service request -- S-TMSI not present\n");
rtn = false; rtn = false;
break; break;
} }
m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer; m_tmsi = (uint32_t *)&init_ue->S_TMSI.m_TMSI.buffer;
m_s1ap_log->info("Service request -- S-TMSI 0x%x\n", ntohl(*m_tmsi)); m_s1ap_log->info("Service request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->console("Service request -- S-TMSI 0x%x\n", ntohl(*m_tmsi) ); m_s1ap_log->console("Service request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->info("Service request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id); m_s1ap_log->info("Service request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
m_s1ap_log->console("Service request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id); m_s1ap_log->console("Service request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
handle_nas_service_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri); handle_nas_service_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer, reply_flag, enb_sri);
rtn = true; rtn = true;
break; break;
case LIBLTE_MME_MSG_TYPE_DETACH_REQUEST: case LIBLTE_MME_MSG_TYPE_DETACH_REQUEST:
m_s1ap_log->console("Received Initial UE message -- Detach Request\n"); m_s1ap_log->console("Received Initial UE message -- Detach Request\n");
m_s1ap_log->info("Received Initial UE message -- Detach Request\n"); m_s1ap_log->info("Received Initial UE message -- Detach Request\n");
if(!init_ue->S_TMSI_present) if (!init_ue->S_TMSI_present)
{ {
m_s1ap_log->error("Detach request -- S-TMSI not present\n"); m_s1ap_log->error("Detach request -- S-TMSI not present\n");
m_s1ap_log->console("Detach request -- S-TMSI not present\n" ); m_s1ap_log->console("Detach request -- S-TMSI not present\n");
rtn = false; rtn = false;
break; break;
} }
m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer; m_tmsi = (uint32_t *)&init_ue->S_TMSI.m_TMSI.buffer;
m_s1ap_log->info("Detach Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi)); m_s1ap_log->info("Detach Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->console("Detach Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi) ); m_s1ap_log->console("Detach Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->info("Detach Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id); m_s1ap_log->info("Detach Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
m_s1ap_log->console("Detach Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id); m_s1ap_log->console("Detach Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
handle_nas_detach_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri); handle_nas_detach_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer, reply_flag, enb_sri);
rtn = true; rtn = true;
break; break;
case LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REQUEST: case LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REQUEST:
m_s1ap_log->console("Received Initial UE message -- Tracking Area Update Request\n"); m_s1ap_log->console("Received Initial UE message -- Tracking Area Update Request\n");
m_s1ap_log->info("Received Initial UE message -- Tracking Area Update Request\n"); m_s1ap_log->info("Received Initial UE message -- Tracking Area Update Request\n");
if(!init_ue->S_TMSI_present) if (!init_ue->S_TMSI_present)
{ {
m_s1ap_log->error("Tracking Area Update Request -- S-TMSI not present\n"); m_s1ap_log->error("Tracking Area Update Request -- S-TMSI not present\n");
m_s1ap_log->console("Tracking Area Update Request -- S-TMSI not present\n" ); m_s1ap_log->console("Tracking Area Update Request -- S-TMSI not present\n");
rtn = false; rtn = false;
break; break;
} }
m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer; m_tmsi = (uint32_t *)&init_ue->S_TMSI.m_TMSI.buffer;
m_s1ap_log->info("Tracking Area Update Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi)); m_s1ap_log->info("Tracking Area Update Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->console("Tracking Area Update Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi) ); m_s1ap_log->console("Tracking Area Update Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->info("Tracking Area Update Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id); m_s1ap_log->info("Tracking Area Update Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
m_s1ap_log->console("Tracking Area Update Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id); m_s1ap_log->console("Tracking Area Update Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
handle_nas_tracking_area_update_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri); handle_nas_tracking_area_update_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer, reply_flag, enb_sri);
rtn = true; rtn = true;
break; break;
default: default:
m_s1ap_log->info("Unhandled Initial UE Message 0x%x\n",msg_type); m_s1ap_log->info("Unhandled Initial UE Message 0x%x\n", msg_type);
m_s1ap_log->console("Unhandled Initial UE Message 0x%x \n", msg_type); m_s1ap_log->console("Unhandled Initial UE Message 0x%x \n", msg_type);
break; break;
} }

Loading…
Cancel
Save