Starting to add UEs to the eNB context again.

master
Pedro Alvarez 7 years ago
parent a6fbdb62cd
commit 300b9e7757

@ -78,6 +78,7 @@ public:
uint32_t get_next_mme_ue_s1ap_id(); uint32_t get_next_mme_ue_s1ap_id();
enb_ctx_t* find_enb_ctx(uint16_t enb_id); enb_ctx_t* find_enb_ctx(uint16_t enb_id);
void add_new_enb_ctx(const enb_ctx_t &enb_ctx, const struct sctp_sndrcvinfo* enb_sri); void add_new_enb_ctx(const enb_ctx_t &enb_ctx, const struct sctp_sndrcvinfo* enb_sri);
void get_enb_ctx(uint16_t sctp_stream);
bool add_ue_ctx_to_imsi_map(ue_ctx_t *ue_ctx); bool add_ue_ctx_to_imsi_map(ue_ctx_t *ue_ctx);
bool add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx_t *ue_ctx); bool add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx_t *ue_ctx);
@ -90,20 +91,6 @@ public:
void release_ues_ecm_ctx_in_enb(uint16_t enb_id); void release_ues_ecm_ctx_in_enb(uint16_t enb_id);
bool delete_ue_ctx(uint64_t imsi); bool delete_ue_ctx(uint64_t imsi);
//ue_ctx_t* find_ue_ctx(uint32_t mme_ue_s1ap_id);
//void add_new_ue_ctx(const ue_ctx_t &ue_ctx);
//void add_new_ue_emm_ctx(const ue_emm_ctx_t &ue_emm_ctx);
//void add_new_ue_ecm_ctx(const ue_ecm_ctx_t &ue_ecm_ctx);
//ue_emm_ctx_t* find_ue_emm_ctx_from_imsi(uint64_t imsi);
//ue_ecm_ctx_t* find_ue_ecm_ctx_from_mme_ue_s1ap_id(uint32_t mme_ue_s1ap_id);
//bool delete_ue_emm_ctx(uint64_t imsi);
//bool delete_ue_ecm_ctx(uint32_t mme_ue_s1ap_id);
//void delete_ues_ecm_ctx_in_enb(uint16_t enb_id);
//void store_tmp_ue_emm_ctx(const ue_emm_ctx_t &ue_ecm_ctx);
//bool get_tmp_ue_emm_ctx(uint32_t mme_ue_s1ap_id, ue_emm_ctx_t* ue_emm_ptr);
uint32_t allocate_m_tmsi(uint64_t imsi); uint32_t allocate_m_tmsi(uint64_t imsi);
s1ap_args_t m_s1ap_args; s1ap_args_t m_s1ap_args;
@ -130,14 +117,9 @@ private:
std::map<int32_t, uint16_t> m_sctp_to_enb_id; std::map<int32_t, uint16_t> m_sctp_to_enb_id;
std::map<uint16_t,std::set<uint32_t> > m_enb_id_to_ue_ids; std::map<uint16_t,std::set<uint32_t> > m_enb_id_to_ue_ids;
std::map<uint64_t, ue_ctx_t*> m_imsi_to_ue_ctx; std::map<uint64_t, ue_ctx_t*> m_imsi_to_ue_ctx;
std::map<uint32_t, ue_ctx_t*> m_mme_ue_s1ap_id_to_ue_ctx; std::map<uint32_t, ue_ctx_t*> m_mme_ue_s1ap_id_to_ue_ctx;
//std::map<uint64_t, ue_emm_ctx_t*> m_imsi_to_ue_emm_ctx;
//std::map<uint32_t, ue_ecm_ctx_t*> m_mme_ue_s1ap_id_to_ue_ecm_ctx;
//std::map<int32_t,ue_emm_ctx_t*> m_mme_ue_s1ap_id_to_tmp_ue_emm_ctx;
uint32_t m_next_mme_ue_s1ap_id; uint32_t m_next_mme_ue_s1ap_id;
uint32_t m_next_m_tmsi; uint32_t m_next_m_tmsi;

@ -498,6 +498,7 @@ s1ap_nas_transport::handle_nas_imsi_attach_request(uint32_t enb_ue_s1ap_id,
memcpy(new_ctx,&ue_ctx,sizeof(ue_ctx_t)); memcpy(new_ctx,&ue_ctx,sizeof(ue_ctx_t));
m_s1ap->add_ue_ctx_to_imsi_map(new_ctx); m_s1ap->add_ue_ctx_to_imsi_map(new_ctx);
m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(new_ctx); m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(new_ctx);
m_s1ap->add_ue_to_enb_set(enb_id,mme_ue_s1ap_id);
//Pack NAS Authentication Request in Downlink NAS Transport msg //Pack NAS Authentication Request in Downlink NAS Transport msg
pack_authentication_request(reply_buffer, ecm_ctx->enb_ue_s1ap_id, ecm_ctx->mme_ue_s1ap_id, autn, rand); pack_authentication_request(reply_buffer, ecm_ctx->enb_ue_s1ap_id, ecm_ctx->mme_ue_s1ap_id, autn, rand);
@ -611,6 +612,7 @@ s1ap_nas_transport::handle_nas_guti_attach_request( uint32_t enb_ue_s1ap_id,
ue_ctx_t *new_ctx = new ue_ctx_t; ue_ctx_t *new_ctx = new ue_ctx_t;
memcpy(new_ctx,&ue_ctx,sizeof(ue_ctx_t)); memcpy(new_ctx,&ue_ctx,sizeof(ue_ctx_t));
m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(new_ctx); m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(new_ctx);
m_s1ap->add_ue_to_enb_set(enb_id,mme_ue_s1ap_id);
pack_identity_request(reply_buffer, ecm_ctx->enb_ue_s1ap_id, ecm_ctx->mme_ue_s1ap_id); pack_identity_request(reply_buffer, ecm_ctx->enb_ue_s1ap_id, ecm_ctx->mme_ue_s1ap_id);
*reply_flag = true; *reply_flag = true;
@ -660,6 +662,7 @@ s1ap_nas_transport::handle_nas_guti_attach_request( uint32_t enb_ue_s1ap_id,
//Store context based on MME UE S1AP id //Store context based on MME UE S1AP id
m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx); m_s1ap->add_ue_ctx_to_mme_ue_s1ap_id_map(ue_ctx);
m_s1ap->add_ue_to_enb_set(enb_id,mme_ue_s1ap_id);
//Re-generate K_eNB //Re-generate K_eNB
liblte_security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb); liblte_security_generate_k_enb(emm_ctx->security_ctxt.k_asme, emm_ctx->security_ctxt.ul_nas_count, emm_ctx->security_ctxt.k_enb);

Loading…
Cancel
Save