|
|
|
@ -106,7 +106,7 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Get Mobile ID
|
|
|
|
|
|
|
|
|
|
if(attach_req.eps_mobile_id.type_of_id == LIBLTE_MME_EPS_MOBILE_ID_TYPE_IMSI)
|
|
|
|
|
{
|
|
|
|
|
//IMSI style attach
|
|
|
|
@ -114,21 +114,28 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
|
|
|
|
|
for(int i=0;i<=14;i++){
|
|
|
|
|
imsi += attach_req.eps_mobile_id.imsi[i]*std::pow(10,14-i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if(attach_req.eps_mobile_id.type_of_id == LIBLTE_MME_EPS_MOBILE_ID_TYPE_GUTI)
|
|
|
|
|
{
|
|
|
|
|
//GUTI style attach
|
|
|
|
|
m_s1ap_log->console("Received GUTI-style attach request\n");
|
|
|
|
|
uint32_t m_tmsi = attach_req.eps_mobile_id.guti.m_tmsi;
|
|
|
|
|
std::map<uint32_t,uint32_t>::iterator it = m_s1ap->m_tmsi_to_s1ap_id.find(m_tmsi);
|
|
|
|
|
if(it == m_s1ap->m_tmsi_to_s1ap_id.end())
|
|
|
|
|
{
|
|
|
|
|
//FIXME Send Id request
|
|
|
|
|
m_s1ap_log->info("Could not find M-TMSI in attach request\n");
|
|
|
|
|
m_s1ap_log->console("Could not find M-TMSI in attach request\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
m_s1ap_log->console("Found M-TMSI: %d\n",m_tmsi);
|
|
|
|
|
ue_ctx_t *tmp = m_s1ap->find_ue_ctx(it->second);
|
|
|
|
|
if(tmp!=NULL)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->console("Found UE context. IMSI: %015lu\n",tmp->imsi);
|
|
|
|
|
imsi = tmp->imsi;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_s1ap_log->console("Attach request from IMSI: %015lu\n", imsi);
|
|
|
|
|
m_s1ap_log->info("Attach request from IMSI: %015lu\n", imsi);
|
|
|
|
|
|
|
|
|
@ -774,7 +781,8 @@ s1ap_nas_transport::pack_attach_accept(ue_ctx_t *ue_ctx, LIBLTE_S1AP_E_RABTOBESE
|
|
|
|
|
attach_accept.guti.guti.mnc = m_s1ap->m_s1ap_args.mnc;
|
|
|
|
|
attach_accept.guti.guti.mme_group_id = 0x0001;
|
|
|
|
|
attach_accept.guti.guti.mme_code = 0x1a;
|
|
|
|
|
attach_accept.guti.guti.m_tmsi = m_s1ap->allocate_m_tmsi();
|
|
|
|
|
attach_accept.guti.guti.m_tmsi = m_s1ap->allocate_m_tmsi(ue_ctx->mme_ue_s1ap_id);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
typedef struct{
|
|
|
|
|
uint32 m_tmsi;
|
|
|
|
|