Quick hack to keep the IP in service request.

master
Pedro Alvarez 7 years ago
parent d301d7599f
commit ea0585a772

@ -157,6 +157,7 @@ mme_gtpc::handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu, bool pac
} }
uint32_t mme_s1ap_id = id_it->second; uint32_t mme_s1ap_id = id_it->second;
m_mme_gtpc_log->info("MME GTPC Ctrl TEID %d, MME UE S1AP Id %d\n", cs_resp_pdu->header.teid, mme_s1ap_id);
//Get S-GW Control F-TEID //Get S-GW Control F-TEID
srslte::gtpc_f_teid_ie sgw_ctrl_fteid; srslte::gtpc_f_teid_ie sgw_ctrl_fteid;
sgw_ctrl_fteid.teid = cs_resp_pdu->header.teid; sgw_ctrl_fteid.teid = cs_resp_pdu->header.teid;
@ -168,9 +169,11 @@ mme_gtpc::handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu, bool pac
return; return;
} }
m_mme_gtpc_log->console("Create Session Response -- SPGW control TEID %d\n", sgw_ctrl_fteid.teid); m_mme_gtpc_log->console("Create Session Response -- SPGW control TEID %d\n", sgw_ctrl_fteid.teid);
m_mme_gtpc_log->info("Create Session Response -- SPGW control TEID %d\n", sgw_ctrl_fteid.teid);
in_addr s1u_addr; in_addr s1u_addr;
s1u_addr.s_addr = cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid.ipv4; s1u_addr.s_addr = cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid.ipv4;
m_mme_gtpc_log->console("Create Session Response -- SPGW S1-U Address: %s\n", inet_ntoa(s1u_addr)); m_mme_gtpc_log->console("Create Session Response -- SPGW S1-U Address: %s\n", inet_ntoa(s1u_addr));
m_mme_gtpc_log->info("Create Session Response -- SPGW S1-U Address: %s\n", inet_ntoa(s1u_addr));
//Check UE Ipv4 address was allocated //Check UE Ipv4 address was allocated
if(cs_resp->paa_present != true) if(cs_resp->paa_present != true)

@ -203,7 +203,7 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(ue_emm_ctx_t *emm_ctx,
bool bool
s1ap_ctx_mngmt_proc::handle_initial_context_setup_response(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *in_ctxt_resp) s1ap_ctx_mngmt_proc::handle_initial_context_setup_response(LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT *in_ctxt_resp)
{ {
static bool send_modify = false;
uint32_t mme_ue_s1ap_id = in_ctxt_resp->MME_UE_S1AP_ID.MME_UE_S1AP_ID; uint32_t mme_ue_s1ap_id = in_ctxt_resp->MME_UE_S1AP_ID.MME_UE_S1AP_ID;
ue_ecm_ctx_t *ue_ecm_ctx = m_s1ap->find_ue_ecm_ctx_from_mme_ue_s1ap_id(mme_ue_s1ap_id); ue_ecm_ctx_t *ue_ecm_ctx = m_s1ap->find_ue_ecm_ctx_from_mme_ue_s1ap_id(mme_ue_s1ap_id);
if (ue_ecm_ctx == NULL) if (ue_ecm_ctx == NULL)
@ -244,6 +244,11 @@ s1ap_ctx_mngmt_proc::handle_initial_context_setup_response(LIBLTE_S1AP_MESSAGE_I
m_s1ap_log->console("E-RAB Context -- eNB TEID 0x%x; eNB GTP-U Address %s\n", erab_ctx->enb_fteid.teid, enb_addr_str); m_s1ap_log->console("E-RAB Context -- eNB TEID 0x%x; eNB GTP-U Address %s\n", erab_ctx->enb_fteid.teid, enb_addr_str);
} }
if(send_modify)
{
m_mme_gtpc->send_modify_bearer_request(&ue_ecm_ctx->erabs_ctx[5]);
}
send_modify = true;
return true; return true;
} }

@ -687,6 +687,7 @@ s1ap_nas_transport::handle_nas_service_request(uint32_t m_tmsi,
m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n",ue_emm_ctx->security_ctxt.ul_nas_count); m_s1ap_log->info("Generating KeNB with UL NAS COUNT: %d\n",ue_emm_ctx->security_ctxt.ul_nas_count);
m_mme_gtpc->send_create_session_request(ue_ecm_ctx.imsi, ue_ecm_ctx.mme_ue_s1ap_id,false); m_mme_gtpc->send_create_session_request(ue_ecm_ctx.imsi, ue_ecm_ctx.mme_ue_s1ap_id,false);
m_s1ap_log->console("UE ESM Ctr TEID %d\n", ue_ecm_ctx.erabs_ctx[5].sgw_ctrl_fteid.teid);
// m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(ue_); // m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(ue_);
} }
} }

@ -338,7 +338,7 @@ spgw::handle_sgi_pdu(srslte::byte_buffer_t *msg)
dest_addr.s_addr = dest_ip; dest_addr.s_addr = dest_ip;
//m_spgw_log->console("IP version: %d\n", version); //m_spgw_log->console("IP version: %d\n", version);
//m_spgw_log->console("Received packet to IP: %s\n", inet_ntoa(dest_addr)); m_spgw_log->console("Received packet to IP: %s\n", inet_ntoa(dest_addr));
pthread_mutex_lock(&m_mutex); pthread_mutex_lock(&m_mutex);
gtp_fteid_it = m_ip_to_teid.find(dest_ip); gtp_fteid_it = m_ip_to_teid.find(dest_ip);
@ -351,7 +351,7 @@ spgw::handle_sgi_pdu(srslte::byte_buffer_t *msg)
if(ip_found == false) if(ip_found == false)
{ {
//m_spgw_log->console("IP Packet is not for any UE\n"); m_spgw_log->console("IP Packet is not for any UE\n");
return; return;
} }
struct sockaddr_in enb_addr; struct sockaddr_in enb_addr;
@ -449,8 +449,8 @@ spgw::handle_create_session_request(struct srslte::gtpc_create_session_request *
//Setup uplink user TEID //Setup uplink user TEID
uint64_t spgw_uplink_user_teid = get_new_user_teid(); uint64_t spgw_uplink_user_teid = get_new_user_teid();
//Allocate UE IP //Allocate UE IP
in_addr_t ue_ip = get_new_ue_ipv4(); //in_addr_t ue_ip = get_new_ue_ipv4();
in_addr_t ue_ip = inet_addr("172.16.0.2");
uint8_t default_bearer_id = 5; uint8_t default_bearer_id = 5;
//Save the UE IP to User TEID map //Save the UE IP to User TEID map

Loading…
Cancel
Save