Starting to split EMM and ECM context.

master
Pedro Alvarez 7 years ago
parent 336af1ed93
commit a0d727166f

@ -127,6 +127,25 @@ typedef struct{
srslte::gtpc_f_teid_ie sgw_ctrl_fteid; srslte::gtpc_f_teid_ie sgw_ctrl_fteid;
} erab_ctx_t; } erab_ctx_t;
typedef struct{
uint64_t imsi;
LIBLTE_MME_EPS_MOBILE_ID_GUTI_STRUCT guti;
emm_state_t emm_state;
eps_security_ctx_t security_ctxt;
uint8_t procedure_transaction_id;
} ue_emm_ctx_t;
typedef struct{
uint32_t enb_ue_s1ap_id;
uint32_t mme_ue_s1ap_id;
uint16_t enb_id;
struct sctp_sndrcvinfo enb_sri;
ecm_state_t ecm_state;
bool eit;
erab_ctx_t erabs_ctx[MAX_ERABS_PER_UE];
} ue_esm_ctx_t;
typedef struct{ typedef struct{
uint64_t imsi; uint64_t imsi;
uint32_t enb_ue_s1ap_id; uint32_t enb_ue_s1ap_id;

@ -399,26 +399,9 @@ s1ap::find_ue_ctx_from_mme_ue_s1ap_id(uint32_t mme_ue_s1ap_id)
return find_ue_ctx_from_imsi(imsi_it->second); return find_ue_ctx_from_imsi(imsi_it->second);
} }
} }
void
s1ap::delete_ues_in_enb(uint16_t enb_id)
{
//delete UEs ctx
std::map<uint16_t,std::set<uint32_t> >::iterator ues_in_enb = m_enb_id_to_ue_ids.find(enb_id);
std::set<uint32_t>::iterator ue_id = ues_in_enb->second.begin();
while(ue_id != ues_in_enb->second.end() )
{
std::map<uint32_t, ue_ctx_t*>::iterator ue_ctx = m_active_ues.find(*ue_id);
m_s1ap_log->info("Deleting UE context. UE IMSI: %lu\n", ue_ctx->second->imsi);
m_s1ap_log->console("Deleting UE context. UE IMSI: %lu\n", ue_ctx->second->imsi);
delete ue_ctx->second; //delete UE context
m_active_ues.erase(ue_ctx); //remove from general MME map
ues_in_enb->second.erase(ue_id++); //erase from the eNB's UE set
}
}
bool bool
s1ap::delete_ue_ctx(ue_ctx_t *ue_ctx) s1ap::delete_ue_esm_ctx(uint32_t mme_ue_s1ap_id)
{ {
uint32_t mme_ue_s1ap_id = ue_ctx->mme_ue_s1ap_id; uint32_t mme_ue_s1ap_id = ue_ctx->mme_ue_s1ap_id;
std::map<uint32_t, ue_ctx_t*>::iterator ue_ctx_it = m_active_ues.find(mme_ue_s1ap_id); std::map<uint32_t, ue_ctx_t*>::iterator ue_ctx_it = m_active_ues.find(mme_ue_s1ap_id);
@ -451,6 +434,42 @@ s1ap::delete_ue_ctx(ue_ctx_t *ue_ctx)
return true; return true;
} }
void
s1ap::delete_ues_esm_ctx_in_enb(uint16_t enb_id)
{
//delete UEs ctx
std::map<uint16_t,std::set<uint32_t> >::iterator ues_in_enb = m_enb_id_to_ue_ids.find(enb_id);
std::set<uint32_t>::iterator ue_id = ues_in_enb->second.begin();
while(ue_id != ues_in_enb->second.end() )
{
std::map<uint32_t, ue_ctx_t*>::iterator ue_ctx = m_active_ues.find(*ue_id);
m_s1ap_log->info("Deleting UE context. UE IMSI: %lu\n", ue_ctx->second->imsi);
m_s1ap_log->console("Deleting UE context. UE IMSI: %lu\n", ue_ctx->second->imsi);
delete ue_ctx->second; //delete UE context
m_active_ues.erase(ue_ctx); //remove from general MME map
ues_in_enb->second.erase(ue_id++); //erase from the eNB's UE set
}
}
void
s1ap::delete_ues_in_enb(uint16_t enb_id)
{
//delete UEs ctx
std::map<uint16_t,std::set<uint32_t> >::iterator ues_in_enb = m_enb_id_to_ue_ids.find(enb_id);
std::set<uint32_t>::iterator ue_id = ues_in_enb->second.begin();
while(ue_id != ues_in_enb->second.end() )
{
std::map<uint32_t, ue_ctx_t*>::iterator ue_ctx = m_active_ues.find(*ue_id);
m_s1ap_log->info("Deleting UE context. UE IMSI: %lu\n", ue_ctx->second->imsi);
m_s1ap_log->console("Deleting UE context. UE IMSI: %lu\n", ue_ctx->second->imsi);
delete ue_ctx->second; //delete UE context
m_active_ues.erase(ue_ctx); //remove from general MME map
ues_in_enb->second.erase(ue_id++); //erase from the eNB's UE set
}
}

Loading…
Cancel
Save