Adding release access bearer request to SPGW. Compiling now.

master
Pedro Alvarez 7 years ago
parent 2cc4959667
commit 2b84e78389

@ -76,6 +76,7 @@ public:
void handle_create_session_request(struct srslte::gtpc_create_session_request *cs_req, struct srslte::gtpc_pdu *cs_resp_pdu,bool pack_attach);
void handle_modify_bearer_request(struct srslte::gtpc_pdu *mb_req_pdu, struct srslte::gtpc_pdu *mb_resp_pdu);
void handle_delete_session_request(struct srslte::gtpc_pdu *del_req_pdu, struct srslte::gtpc_pdu *del_resp_pdu);
void handle_release_access_bearers_request(struct srslte::gtpc_pdu *rel_req_pdu, struct srslte::gtpc_pdu *rel_resp_pdu);
void handle_sgi_pdu(srslte::byte_buffer_t *msg);
void handle_s1u_pdu(srslte::byte_buffer_t *msg);

@ -362,7 +362,7 @@ mme_gtpc::send_release_access_bearers_request(uint64_t imsi)
m_mme_gtpc_log->info("GTP-C Release Access Berarers Request -- S-GW Control TEID %d\n", sgw_ctrl_fteid->teid );
srslte::gtpc_pdu rel_resp_pdu;
m_spgw->handle_release_access_bearers_response(&del_req_pdu, &rel_resp_pdu);
m_spgw->handle_release_access_bearers_request(&rel_req_pdu, &rel_resp_pdu);
//The GTP-C connection will not be torn down, just the user plane bearers.
return;

@ -510,18 +510,18 @@ s1ap::activate_eps_bearer(uint64_t imsi, uint8_t ebi)
return;
}
uint32_t mme_ue_s1ap_id = emm_ctx_it->second->mme_ue_s1ap_id;
std::map<uint32_t,ue_ecm_ctx_t*>::iterator ecm_ctx_it = m_mme_ue_s1ap_id_to_ue_ecm_ctx.find(mme_s1ap_id);
std::map<uint32_t,ue_ecm_ctx_t*>::iterator ecm_ctx_it = m_mme_ue_s1ap_id_to_ue_ecm_ctx.find(mme_ue_s1ap_id);
if(ecm_ctx_it == m_mme_ue_s1ap_id_to_ue_ecm_ctx.end())
{
m_s1ap_log->error("Could not find UE ECM context\n");
return;
}
ue_ecm_ctx_t * ecm_ctx = ue_ctx_it->second;
ue_ecm_ctx_t * ecm_ctx = ecm_ctx_it->second;
if (ecm_ctx->erabs_ctx[ebi].state != ERAB_CTX_SETUP)
{
m_s1ap_log->error("EPS Bearer could not be activated. MME S1AP Id %d, EPS Bearer id %d, state %d\n",mme_s1ap_id,ebi,ue_ctx->erabs_ctx[ebi].state);
m_s1ap_log->console("EPS Bearer could not be activated. MME S1AP Id %d, EPS Bearer id %d\n",mme_s1ap_id,ebi,ue_ctx->erabs_ctx[ebi].state);
m_s1ap_log->error("EPS Bearer could not be activated. MME S1AP Id %d, EPS Bearer id %d, state %d\n",mme_ue_s1ap_id,ebi,ecm_ctx->erabs_ctx[ebi].state);
m_s1ap_log->console("EPS Bearer could not be activated. MME S1AP Id %d, EPS Bearer id %d\n",mme_ue_s1ap_id,ebi,ecm_ctx->erabs_ctx[ebi].state);
return;
}

@ -571,7 +571,7 @@ spgw::handle_delete_session_request(struct srslte::gtpc_pdu *del_req_pdu, struct
//Delete data tunnel
pthread_mutex_lock(&m_mutex);
std::map<in_addr_t,srslte::gtpc_f_teid_ie>::iterator data_it = m_ip_to_teid.find(tunnel_ctx->ue_ipv4);
std::map<in_addr_t,srslte::gtp_fteid_t>::iterator data_it = m_ip_to_teid.find(tunnel_ctx->ue_ipv4);
if(data_it != m_ip_to_teid.end())
{
m_ip_to_teid.erase(data_it);
@ -583,4 +583,31 @@ spgw::handle_delete_session_request(struct srslte::gtpc_pdu *del_req_pdu, struct
return;
}
void
spgw::handle_release_access_bearers_request(struct srslte::gtpc_pdu *rel_req_pdu, struct srslte::gtpc_pdu *rel_resp_pdu)
{
//Find tunel ctxt
uint32_t ctrl_teid = rel_req_pdu->header.teid;
std::map<uint32_t,spgw_tunnel_ctx_t*>::iterator tunnel_it = m_teid_to_tunnel_ctx.find(ctrl_teid);
if(tunnel_it == m_teid_to_tunnel_ctx.end())
{
m_spgw_log->warning("Could not find TEID %d to release bearers from\n",ctrl_teid);
return;
}
spgw_tunnel_ctx_t *tunnel_ctx = tunnel_it->second;
in_addr_t ue_ipv4 = tunnel_ctx->ue_ipv4;
//Delete data tunnel
pthread_mutex_lock(&m_mutex);
std::map<in_addr_t,srslte::gtpc_f_teid_ie>::iterator data_it = m_ip_to_teid.find(tunnel_ctx->ue_ipv4);
if(data_it != m_ip_to_teid.end())
{
m_ip_to_teid.erase(data_it);
}
pthread_mutex_unlock(&m_mutex);
//Do NOT delete control tunnel
return;
}
} //namespace srsepc

Loading…
Cancel
Save