Saving QCI into ESM context. Different QCIs should be working now.

master
Pedro Alvarez 7 years ago
parent 66db3deeb4
commit 0a6540d8bf

@ -269,8 +269,8 @@ struct gtpc_create_session_response
struct gtpc_f_teid_ie s12_sgw_f_teid;
bool s2b_u_pgw_f_teid_present;
struct gtpc_f_teid_ie s2b_u_pgw_f_teid;
//bearer_level_qos_present
//bearer_level_qos
bool bearer_level_qos_present;
struct gtpc_bearer_qos_ie bearer_level_qos;
//charging_id_present
//charging_id
//bearer_flags_present

@ -161,7 +161,6 @@ typedef struct{
ue_emm_ctx_t emm_ctx;
eps_sec_ctx_t sec_ctx;
ue_ecm_ctx_t ecm_ctx;
erab_ctx_t erabs_ctx[MAX_ERABS_PER_UE];
} ue_ctx_t;
}//namespace

@ -92,7 +92,7 @@ mme_gtpc::get_new_ctrl_teid()
return m_next_ctrl_teid++; //FIXME Use a Id pool?
}
void
mme_gtpc::send_create_session_request(uint64_t imsi, uint8_t qci)
mme_gtpc::send_create_session_request(uint64_t imsi)
{
m_mme_gtpc_log->info("Sending Create Session Request.\n");
m_mme_gtpc_log->console("Sending Create Session Request.\n");
@ -130,7 +130,6 @@ mme_gtpc::send_create_session_request(uint64_t imsi, uint8_t qci)
//Bearer QoS
cs_req->eps_bearer_context_created.ebi = 5;
cs_req->eps_bearer_context_created.bearer_qos.qci=qci;
//Check whether this UE is already registed
std::map<uint64_t, struct gtpc_ctx>::iterator it = m_imsi_to_gtpc_ctx.find(imsi);
@ -251,7 +250,7 @@ mme_gtpc::handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu)
erab_ctx_t *erab_ctx = &ecm_ctx->erabs_ctx[default_bearer];
erab_ctx->pdn_addr_alloc= cs_resp->paa;
erab_ctx->sgw_s1u_fteid = cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid;
m_mme_gtpc_log->console("QCI %d\n", erab_ctx->qci);
m_s1ap->m_s1ap_ctx_mngmt_proc->send_initial_context_setup_request(emm_ctx, ecm_ctx, erab_ctx);
return;
}

@ -114,13 +114,13 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(ue_emm_ctx_t *emm_ctx,
in_ctxt_req->E_RABToBeSetupListCtxtSUReq.len = 1;
erab_ctx_req->e_RAB_ID.E_RAB_ID = erab_ctx->erab_id;
//Setup E-RAB QoS parameters
erab_ctx_req->e_RABlevelQoSParameters.qCI.QCI = 9;
erab_ctx_req->e_RABlevelQoSParameters.qCI.QCI = erab_ctx->qci;
erab_ctx_req->e_RABlevelQoSParameters.allocationRetentionPriority.priorityLevel.PriorityLevel = 15 ;//Lowest
erab_ctx_req->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionCapability = LIBLTE_S1AP_PRE_EMPTIONCAPABILITY_SHALL_NOT_TRIGGER_PRE_EMPTION;
erab_ctx_req->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability = LIBLTE_S1AP_PRE_EMPTIONVULNERABILITY_PRE_EMPTABLE;
erab_ctx_req->e_RABlevelQoSParameters.gbrQosInformation_present=false;
//Set E-RAB S-GW F-TEID
//if (cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid_present == false){
// m_s1ap_log->error("Did not receive S1-U TEID in create session response\n");
@ -188,8 +188,6 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(ue_emm_ctx_t *emm_ctx,
//Change E-RAB state to Context Setup Requested and save S-GW control F-TEID
ecm_ctx->erabs_ctx[erab_ctx_req->e_RAB_ID.E_RAB_ID].state = ERAB_CTX_REQUESTED;
//ecm_ctx->erabs_ctx[erab_ctx_req->e_RAB_ID.E_RAB_ID].sgw_ctrl_fteid.teid = sgw_ctrl_fteid.teid;
//ecm_ctx->erabs_ctx[erab_ctx_req->e_RAB_ID.E_RAB_ID].sgw_ctrl_fteid.ipv4 = sgw_ctrl_fteid.ipv4;
struct in_addr addr;
addr.s_addr = htonl(sgw_s1u_ip);
@ -199,6 +197,7 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(ue_emm_ctx_t *emm_ctx,
m_s1ap_log->console("Initial Context Setup Request -- E-RAB id %d\n",erab_ctx_req->e_RAB_ID.E_RAB_ID);
m_s1ap_log->console("Initial Context Setup Request -- S1-U TEID 0x%x. IP %s \n", sgw_s1u_teid,inet_ntoa(addr));
m_s1ap_log->console("Initial Context Setup Request -- S1-U TEID 0x%x. IP %s \n", sgw_s1u_teid,inet_ntoa(addr));
m_s1ap_log->console("Initial Context Setup Request -- QCI %d \n", erab_ctx_req->e_RABlevelQoSParameters.qCI.QCI);
m_pool->deallocate(reply_buffer);
m_pool->deallocate(nas_buffer);

@ -709,6 +709,11 @@ s1ap_nas_transport::handle_nas_guti_attach_request( uint32_t enb_ue_s1ap_id,
}
else
{
//Get subscriber info from HSS
uint8_t default_bearer=5;
m_hss->gen_update_loc_answer(emm_ctx->imsi,&ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_s1ap_log->debug("Getting subscription information -- QCI %d\n", ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_s1ap_log->console("Getting subscription information -- QCI %d\n", ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_mme_gtpc->send_create_session_request(emm_ctx->imsi);
*reply_flag = false; //No reply needed
}
@ -1082,12 +1087,13 @@ s1ap_nas_transport::handle_nas_security_mode_complete(srslte::byte_buffer_t *nas
else
{
//Get subscriber info from HSS
uint8_t qci;
m_hss->gen_update_loc_answer(emm_ctx->imsi,&qci);
m_s1ap_log->console("QCI %d\n", qci);
uint8_t default_bearer=5;
m_hss->gen_update_loc_answer(emm_ctx->imsi,&ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_s1ap_log->debug("Getting subscription information -- QCI %d\n", ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_s1ap_log->console("Getting subscription information -- QCI %d\n", ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
//FIXME The packging of GTP-C messages is not ready.
//This means that GTP-U tunnels are created with function calls, as opposed to GTP-C.
m_mme_gtpc->send_create_session_request(emm_ctx->imsi,qci);
m_mme_gtpc->send_create_session_request(emm_ctx->imsi);
*reply_flag = false; //No reply needed
}
return true;
@ -1166,6 +1172,12 @@ s1ap_nas_transport::handle_esm_information_response(srslte::byte_buffer_t *nas_m
m_s1ap_log->console("ESM Info: %d Protocol Configuration Options\n",esm_info_resp.protocol_cnfg_opts.N_opts);
}
//Get subscriber info from HSS
uint8_t default_bearer=5;
m_hss->gen_update_loc_answer(ue_ctx->emm_ctx.imsi,&ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_s1ap_log->debug("Getting subscription information -- QCI %d\n", ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
m_s1ap_log->console("Getting subscription information -- QCI %d\n", ue_ctx->ecm_ctx.erabs_ctx[default_bearer].qci);
//FIXME The packging of GTP-C messages is not ready.
//This means that GTP-U tunnels are created with function calls, as opposed to GTP-C.
m_mme_gtpc->send_create_session_request(ue_ctx->emm_ctx.imsi);

@ -538,9 +538,6 @@ spgw::handle_create_session_request(struct srslte::gtpc_create_session_request *
cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid_present=true;
cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid = tunnel_ctx->up_user_fteid;
//Bearer QoS
cs_resp->eps_bearer_context_created.bearer_qos.qci = cs_req->eps_bearer_context_created.bearer_qos.qci;
//Fill in the PAA
cs_resp->paa_present = true;
cs_resp->paa.pdn_type = srslte::GTPC_PDN_TYPE_IPV4;

Loading…
Cancel
Save