diff --git a/srsepc/src/hss/hss.cc b/srsepc/src/hss/hss.cc index 6bbf86097..844a3a92b 100644 --- a/srsepc/src/hss/hss.cc +++ b/srsepc/src/hss/hss.cc @@ -614,7 +614,7 @@ hss::increment_ue_sqn(uint64_t imsi) } increment_sqn(ue_ctx->sqn,ue_ctx->sqn); - m_hss_log->debug("Incremented SQN (IMSI: %" PRIu64 ")" PRIu64 "\n", imsi); + m_hss_log->debug("Incremented SQN -- IMSI: %" PRIu64 "\n", imsi); m_hss_log->debug_hex(ue_ctx->sqn, 6, "SQN: "); } diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index 599564c6f..15a6b35f9 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -257,6 +257,9 @@ parse_args(all_args_t *args, int argc, char* argv[]) { if(!vm.count("log.hss_hex_limit")) { args->log_args.hss_hex_limit = args->log_args.all_hex_limit; } + if(!vm.count("log.nas_hex_limit")) { + args->log_args.nas_hex_limit = args->log_args.all_hex_limit; + } } // Check user database diff --git a/srsepc/src/mme/nas.cc b/srsepc/src/mme/nas.cc index 77d251239..bd0d5be51 100644 --- a/srsepc/src/mme/nas.cc +++ b/srsepc/src/mme/nas.cc @@ -145,30 +145,20 @@ nas::handle_attach_request( uint32_t enb_ue_s1ap_id, { //Get attach type from attach request if (attach_req.eps_mobile_id.type_of_id == LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI) { - nas_log->console("Attach Request -- IMSI-style attach request\n"); - nas_log->info("Attach Request -- IMSI-style attach request\n"); nas::handle_imsi_attach_request_unknown_ue(enb_ue_s1ap_id, enb_sri, attach_req, pdn_con_req, args, s1ap, gtpc, hss, nas_log); } else if (attach_req.eps_mobile_id.type_of_id == LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI) { - nas_log->console("Attach Request -- GUTI-style attach request\n"); - nas_log->info("Attach Request -- GUTI-style attach request\n"); nas::handle_guti_attach_request_unknown_ue(enb_ue_s1ap_id, enb_sri, attach_req, pdn_con_req, args, s1ap, gtpc, hss, nas_log); } else { - nas_log->error("Unhandled Mobile Id type in attach request\n"); return false; } } else { nas_log->info("Attach Request -- Found previously attached UE.\n"); nas_log->console("Attach Request -- Found previously attach UE.\n"); if (attach_req.eps_mobile_id.type_of_id == LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI) { - nas_log->console("Attach Request -- IMSI-style attach request\n"); - nas_log->info("Attach Request -- IMSI-style attach request\n"); nas::handle_imsi_attach_request_known_ue(nas_ctx, enb_ue_s1ap_id, enb_sri, attach_req, pdn_con_req, nas_rx, args, s1ap, gtpc, hss, nas_log); } else if (attach_req.eps_mobile_id.type_of_id == LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI) { - nas_log->console("Attach Request -- GUTI-style attach request\n"); - nas_log->info("Attach Request -- GUTI-style attach request\n"); nas::handle_guti_attach_request_known_ue(nas_ctx, enb_ue_s1ap_id, enb_sri, attach_req, pdn_con_req, nas_rx, args, s1ap, gtpc, hss, nas_log); } else { - nas_log->error("Unhandled Mobile Id type in attach request\n"); return false; } } @@ -201,9 +191,10 @@ nas::handle_imsi_attach_request_unknown_ue( uint32_t enb_ue_s1ap_id, nas_ctx = new nas; nas_ctx->init(args,s1ap,gtpc,hss,nas_log); - //Save IMSI, MME UE S1AP Id and make sure UE is EMM_DEREGISTERED + //Save IMSI, eNB UE S1AP Id, MME UE S1AP Id and make sure UE is EMM_DEREGISTERED nas_ctx->m_emm_ctx.imsi = imsi; nas_ctx->m_emm_ctx.state = EMM_STATE_DEREGISTERED; + nas_ctx->m_ecm_ctx.enb_ue_s1ap_id = enb_ue_s1ap_id; nas_ctx->m_ecm_ctx.mme_ue_s1ap_id = s1ap->get_next_mme_ue_s1ap_id(); //Save UE network capabilities @@ -221,7 +212,6 @@ nas::handle_imsi_attach_request_unknown_ue( uint32_t enb_ue_s1ap_id, nas_ctx->m_sec_ctx.dl_nas_count = 0; //Set eNB information - nas_ctx->m_ecm_ctx.enb_ue_s1ap_id = enb_ue_s1ap_id; memcpy(&nas_ctx->m_ecm_ctx.enb_sri, enb_sri, sizeof(struct sctp_sndrcvinfo)); //Save whether secure ESM information transfer is necessary @@ -654,7 +644,7 @@ nas::handle_attach_complete(srslte::byte_buffer_t *nas_rx) m_s1ap->send_downlink_nas_transport(m_ecm_ctx.enb_ue_s1ap_id, m_ecm_ctx.mme_ue_s1ap_id, nas_tx, m_ecm_ctx.enb_sri); m_pool->deallocate(nas_tx); - m_nas_log->console("Sending EMM Information"); + m_nas_log->console("Sending EMM Information\n"); m_nas_log->info("Sending EMM Information\n"); } m_emm_ctx.state = EMM_STATE_REGISTERED; @@ -1100,8 +1090,9 @@ nas::pack_attach_accept(srslte::byte_buffer_t *nas_buffer) ); memcpy(&nas_buffer->msg[1],mac,4); - m_nas_log->info("Packed Attach Accept\n"); + //Log attach accept info + m_nas_log->info("Packed Attach Accept\n"); return true; } diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 51c76e17d..f51d1a48d 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -587,10 +587,10 @@ s1ap::find_imsi_from_m_tmsi(uint32_t m_tmsi) { std::map::iterator it = m_tmsi_to_imsi.find(m_tmsi); if (it != m_tmsi_to_imsi.end()) { - m_s1ap_log->debug("Found IMSI %015lu from M-TMSI 0x%x", it->second, m_tmsi); + m_s1ap_log->debug("Found IMSI %015lu from M-TMSI 0x%x\n", it->second, m_tmsi); return it->second; } else { - m_s1ap_log->debug("Could not find IMSI from M-TMSI 0x%x", m_tmsi); + m_s1ap_log->debug("Could not find IMSI from M-TMSI 0x%x\n", m_tmsi); return 0; } } diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index e17d15e27..09e884545 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -105,6 +105,10 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA nas_init.apn = m_s1ap->m_s1ap_args.mme_apn; nas_init.dns = m_s1ap->m_s1ap_args.dns_addr; + if(init_ue->S_TMSI_present){ + m_tmsi = ntohl(*((uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer)); + } + switch (msg_type) { case LIBLTE_MME_MSG_TYPE_ATTACH_REQUEST: