Changing the logging a bit.

master
Pedro Alvarez 7 years ago
parent c049069346
commit eba3837ab4

@ -143,29 +143,10 @@ hss::gen_auth_info_answer_milenage(uint64_t imsi, uint8_t *k_asme, uint8_t *autn
autn[8+i]=mac[i];
}
m_hss_log->debug_hex(sqn, 6, "User SQN : ");
m_hss_log->debug_hex(autn, 8, "User AUTN: ");
m_hss_log->debug_hex(xres, 8, "User XRES: ");
//std::stringstream ss;
std::cout<<"SQN: ";
for(int i=0;i<6;i++)
{
std::cout << std::hex <<(uint16_t)sqn[i];
}
std::cout<<std::endl;
std::cout<<"AUTN: ";
for(int i=0;i<8;i++)
{
std::cout << std::hex <<(uint16_t)autn[i];
}
std::cout<<std::endl;
std::cout<<"XRES: ";
for(int i=0;i<16;i++)
{
std::cout << std::hex <<(uint16_t)xres[i];
}
std::cout<<std::endl;
//std::string autn_str = ss.str();
//m_hss_log->console("AUTN: %s", autn_str.c_str());
return true;
}
@ -179,10 +160,12 @@ hss::get_k_amf_op(uint64_t imsi, uint8_t *k, uint8_t *amf, uint8_t *op )
if(imsi != 1010123456789)
{
m_hss_log->info("User not found. IMSI: %015lu\n",imsi);
m_hss_log->console("User not found. IMSI: %015lu\n",imsi);
return false;
}
m_hss_log->info("Found User %015lu\n",imsi);
m_hss_log->console("Found User %015lu\n",imsi);
memcpy(k,k_tmp,16);
memcpy(amf,amf_tmp,2);

@ -305,10 +305,10 @@ s1ap::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSAGE_STRUCT *ini
ssize_t n_sent = sctp_send(m_s1mme,reply_msg->msg, reply_msg->N_bytes, enb_sri, 0);
if(n_sent == -1)
{
m_s1ap_log->console("Failed to send NAS Attach Request");
m_s1ap_log->error("Failed to send NAS Attach Request");
return false;
}
m_s1ap_log->console("Sent NAS Athentication Request\n");
m_s1ap_log->info("DL NAS: Sent Athentication Request\n");
m_pool->deallocate(reply_msg);
//TODO Start T3460 Timer!
return true;
@ -333,10 +333,10 @@ s1ap::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT
if(it == m_active_ues.end())
{
//TODO UE not registered, send error message.
m_s1ap_log->console("Could not find UE. MME-UE S1AP id: %lu\n",mme_ue_s1ap_id);
m_s1ap_log->warning("Could not find UE. MME-UE S1AP id: %lu\n",mme_ue_s1ap_id);
return false;
}
m_s1ap_log->console("Found UE. MME-UE S1AP id: %lu",mme_ue_s1ap_id);
m_s1ap_log->debug("Found UE. MME-UE S1AP id: %lu",mme_ue_s1ap_id);
//Get NAS message type
uint8_t pd, msg_type;
@ -366,11 +366,11 @@ s1ap::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRANSPORT_STRUCT
ssize_t n_sent = sctp_send(m_s1mme,reply_msg->msg, reply_msg->N_bytes, enb_sri, 0);
if(n_sent == -1)
{
m_s1ap_log->console("Failed to send NAS Attach Request");
m_s1ap_log->error("Failed to send NAS Attach Request");
return false;
}
m_s1ap_log->console("Sent Security Mode Command\n");
m_s1ap_log->info("DL NAS: Sent Security Mode Command\n");
m_s1ap_log->console("DL NAS: Sent Security Mode Command\n");
m_pool->deallocate(nas_msg);
m_pool->deallocate(reply_msg);
@ -414,6 +414,7 @@ s1ap::handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, srslte:
return false;
}
m_s1ap_log->console("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_log->info("UE Authentication Accepted. IMSI: %lu\n", ue_ctx->imsi);
//Send Security Mode Command
m_s1ap_nas_transport.pack_security_mode_command(reply_msg, ue_ctx);
@ -446,7 +447,9 @@ s1ap::handle_nas_security_mode_complete(srslte::byte_buffer_t *nas_msg, srslte::
m_s1ap_log->warning("IMEI-SV present but not handled");
}
m_s1ap_log->info("Received Security Mode Command Complete. IMSI: %lu\n", ue_ctx->imsi);
m_s1ap_log->console("Received Security Mode Command Complete. IMSI: %lu\n", ue_ctx->imsi);
return true;
}

@ -122,7 +122,6 @@ s1ap_nas_transport::pack_authentication_request(srslte::byte_buffer_t *reply_msg
dw_nas->eNB_UE_S1AP_ID.ENB_UE_S1AP_ID = enb_ue_s1ap_id;
dw_nas->HandoverRestrictionList_present=false;
dw_nas->SubscriberProfileIDforRFP_present=false;
m_s1ap_log->console("Dw NAS id %d\n", enb_ue_s1ap_id);
//Pack NAS PDU
LIBLTE_MME_AUTHENTICATION_REQUEST_MSG_STRUCT auth_req;
@ -134,6 +133,7 @@ s1ap_nas_transport::pack_authentication_request(srslte::byte_buffer_t *reply_msg
LIBLTE_ERROR_ENUM err = liblte_mme_pack_authentication_request_msg(&auth_req, (LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
if(err != LIBLTE_SUCCESS)
{
m_s1ap_log->error("Error packing Athentication Request\n");
m_s1ap_log->console("Error packing Athentication Request\n");
return false;
}
@ -146,6 +146,7 @@ s1ap_nas_transport::pack_authentication_request(srslte::byte_buffer_t *reply_msg
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
if(err != LIBLTE_SUCCESS)
{
m_s1ap_log->error("Error packing Athentication Request\n");
m_s1ap_log->console("Error packing Athentication Request\n");
return false;
}

Loading…
Cancel
Save