|
|
|
@ -114,14 +114,19 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
|
|
|
|
|
m_pool->deallocate(nas_msg);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
handle_nas_attach_request(enb_ue_s1ap_id, attach_req,pdn_con_req,reply_buffer,reply_flag, enb_sri);
|
|
|
|
|
handle_nas_attach_request(enb_ue_s1ap_id, attach_req, pdn_con_req, reply_buffer, reply_flag, enb_sri);
|
|
|
|
|
}
|
|
|
|
|
else if(msg_type == LIBLTE_MME_SECURITY_HDR_TYPE_SERVICE_REQUEST)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->info("Received Service Request \n");
|
|
|
|
|
m_s1ap_log->console("Received Service Request \n");
|
|
|
|
|
liblte_mme_unpack_service_request_msg((LIBLTE_BYTE_MSG_STRUCT*) nas_msg, &service_req);
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->info("Service Request not implemented. Sending Service Reject.");
|
|
|
|
|
m_s1ap_log->console("Service Request not implemented. Sending Service Reject.");
|
|
|
|
|
/* Force UE to re-attach */
|
|
|
|
|
pack_service_reject(reply_buffer, LIBLTE_MME_EMM_CAUSE_IMPLICITLY_DETACHED, enb_ue_s1ap_id);
|
|
|
|
|
*reply_flag = true;
|
|
|
|
|
}
|
|
|
|
|
m_pool->deallocate(nas_msg);
|
|
|
|
|
|
|
|
|
@ -201,7 +206,7 @@ s1ap_nas_transport::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRA
|
|
|
|
|
if(*reply_flag == true)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->info("DL NAS: Sent Downlink NAS message\n");
|
|
|
|
|
m_s1ap_log->console("DL NAS: Sent Downlink NAs Message\n");
|
|
|
|
|
m_s1ap_log->console("DL NAS: Sent Downlink NAS Message\n");
|
|
|
|
|
}
|
|
|
|
|
m_pool->deallocate(nas_msg);
|
|
|
|
|
|
|
|
|
@ -288,6 +293,10 @@ s1ap_nas_transport::handle_nas_imsi_attach_request(uint32_t enb_ue_s1ap_id,
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->console("Attach request -- IMSI: %015lu\n", ue_ctx.imsi);
|
|
|
|
|
m_s1ap_log->info("Attach request -- IMSI: %015lu\n", ue_ctx.imsi);
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->console("Attach request -- Attach type: %d\n", attach_req.eps_attach_type);
|
|
|
|
|
m_s1ap_log->info("Attach request -- Attach type: %d\n", attach_req.eps_attach_type);
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->console("Attach request -- eNB-UE S1AP Id: %d, MME-UE S1AP Id: %d\n", ue_ctx.enb_ue_s1ap_id, ue_ctx.mme_ue_s1ap_id);
|
|
|
|
|
m_s1ap_log->console("Attach Request -- UE Network Capabilities EEA: %d%d%d%d%d%d%d%d\n",
|
|
|
|
|
attach_req.ue_network_cap.eea[0],
|
|
|
|
@ -311,7 +320,10 @@ s1ap_nas_transport::handle_nas_imsi_attach_request(uint32_t enb_ue_s1ap_id,
|
|
|
|
|
m_s1ap_log->console("PDN Connectivity Request -- EPS Bearer Identity requested: %d\n", pdn_con_req.eps_bearer_id);
|
|
|
|
|
m_s1ap_log->console("PDN Connectivity Request -- Procedure Transaction Id: %d\n", pdn_con_req.proc_transaction_id);
|
|
|
|
|
m_s1ap_log->console("PDN Connectivity Request -- ESM Information Transfer requested: %s\n", pdn_con_req.esm_info_transfer_flag_present ? "true" : "false");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Save attach request type
|
|
|
|
|
ue_ctx.attach_type = attach_req.eps_attach_type;
|
|
|
|
|
|
|
|
|
|
//Get Authentication Vectors from HSS
|
|
|
|
|
if(!m_hss->gen_auth_info_answer(ue_ctx.imsi, ue_ctx.security_ctxt.k_asme, autn, rand, ue_ctx.security_ctxt.xres))
|
|
|
|
|
{
|
|
|
|
@ -326,8 +338,8 @@ s1ap_nas_transport::handle_nas_imsi_attach_request(uint32_t enb_ue_s1ap_id,
|
|
|
|
|
|
|
|
|
|
//Send reply to eNB
|
|
|
|
|
*reply_flag = true;
|
|
|
|
|
m_s1ap_log->info("Downlink NAS: Sending Athentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Downlink NAS: Sending Athentication Request\n");
|
|
|
|
|
m_s1ap_log->info("Downlink NAS: Sending Authentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Downlink NAS: Sending Authentication Request\n");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -358,7 +370,10 @@ s1ap_nas_transport::handle_nas_guti_attach_request(uint32_t enb_ue_s1ap_id,
|
|
|
|
|
memcpy(&ue_ctx.ms_network_cap, &attach_req.ms_network_cap, sizeof(LIBLTE_MME_MS_NETWORK_CAPABILITY_STRUCT));
|
|
|
|
|
}
|
|
|
|
|
uint8_t eps_bearer_id = pdn_con_req.eps_bearer_id; //TODO: Unused
|
|
|
|
|
ue_ctx.procedure_transaction_id = pdn_con_req.proc_transaction_id;
|
|
|
|
|
ue_ctx.procedure_transaction_id = pdn_con_req.proc_transaction_id;
|
|
|
|
|
|
|
|
|
|
//Save attach request type
|
|
|
|
|
ue_ctx.attach_type = attach_req.eps_attach_type;
|
|
|
|
|
|
|
|
|
|
//Save whether ESM information transfer is necessary
|
|
|
|
|
ue_ctx.eit = pdn_con_req.esm_info_transfer_flag_present;
|
|
|
|
@ -412,6 +427,8 @@ s1ap_nas_transport::handle_nas_guti_attach_request(uint32_t enb_ue_s1ap_id,
|
|
|
|
|
ue_ctx_t *ue_ctx_ptr = m_s1ap->find_ue_ctx(it->second);
|
|
|
|
|
if(ue_ctx_ptr!=NULL)
|
|
|
|
|
{
|
|
|
|
|
//Save attach request type
|
|
|
|
|
ue_ctx_ptr->attach_type = attach_req.eps_attach_type;
|
|
|
|
|
m_s1ap_log->console("Found UE context. IMSI: %015lu\n",ue_ctx_ptr->imsi);
|
|
|
|
|
m_mme_gtpc->send_create_session_request(ue_ctx_ptr->imsi, ue_ctx_ptr->mme_ue_s1ap_id);
|
|
|
|
|
*reply_flag = false; //No reply needed
|
|
|
|
@ -467,7 +484,7 @@ s1ap_nas_transport::handle_nas_authentication_response(srslte::byte_buffer_t *na
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->console("UE Authentication Rejected.\n");
|
|
|
|
|
m_s1ap_log->warning("UE Authentication Rejected.\n");
|
|
|
|
|
//Send back Athentication Reject
|
|
|
|
|
//Send back Authentication Reject
|
|
|
|
|
pack_authentication_reject(reply_buffer, ue_ctx->enb_ue_s1ap_id, ue_ctx->mme_ue_s1ap_id);
|
|
|
|
|
*reply_flag = true;
|
|
|
|
|
m_s1ap_log->console("Downlink NAS: Sending Authentication Reject.\n");
|
|
|
|
@ -511,6 +528,7 @@ s1ap_nas_transport::handle_nas_security_mode_complete(srslte::byte_buffer_t *nas
|
|
|
|
|
{
|
|
|
|
|
pack_esm_information_request(reply_buffer, ue_ctx);
|
|
|
|
|
m_s1ap_log->console("Sending ESM information request\n");
|
|
|
|
|
m_s1ap_log->info("Sending ESM information request\n");
|
|
|
|
|
*reply_flag = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -532,7 +550,7 @@ s1ap_nas_transport::handle_nas_attach_complete(srslte::byte_buffer_t *nas_msg, u
|
|
|
|
|
srslte::byte_buffer_t *esm_msg = m_pool->allocate();
|
|
|
|
|
LIBLTE_MME_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT_MSG_STRUCT act_bearer;
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->info_hex(nas_msg->msg, nas_msg->N_bytes, "NAS Attach complte");
|
|
|
|
|
m_s1ap_log->info_hex(nas_msg->msg, nas_msg->N_bytes, "NAS Attach complete");
|
|
|
|
|
|
|
|
|
|
//Get NAS authentication response
|
|
|
|
|
LIBLTE_ERROR_ENUM err = liblte_mme_unpack_attach_complete_msg((LIBLTE_BYTE_MSG_STRUCT *) nas_msg, &attach_comp);
|
|
|
|
@ -548,7 +566,7 @@ s1ap_nas_transport::handle_nas_attach_complete(srslte::byte_buffer_t *nas_msg, u
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_s1ap_log->console("Unpacked Attached Complete Message\n");
|
|
|
|
|
m_s1ap_log->console("Unpacked Activavate Default EPS Bearer message. EPS Bearer id %d\n",act_bearer.eps_bearer_id);
|
|
|
|
|
m_s1ap_log->console("Unpacked Activate Default EPS Bearer message. EPS Bearer id %d\n",act_bearer.eps_bearer_id);
|
|
|
|
|
//ue_ctx->erabs_ctx[act_bearer->eps_bearer_id].enb_fteid;
|
|
|
|
|
if(act_bearer.eps_bearer_id < 5 || act_bearer.eps_bearer_id > 15)
|
|
|
|
|
{
|
|
|
|
@ -576,6 +594,11 @@ s1ap_nas_transport::handle_esm_information_response(srslte::byte_buffer_t *nas_m
|
|
|
|
|
m_s1ap_log->info("ESM Info: APN %s\n",esm_info_resp.eps_bearer_id);
|
|
|
|
|
m_s1ap_log->console("ESM Info: APN %s\n",esm_info_resp.eps_bearer_id);
|
|
|
|
|
}
|
|
|
|
|
if(esm_info_resp.protocol_cnfg_opts_present)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->info("ESM Info: %d Protocol Configuration Options %s\n",esm_info_resp.protocol_cnfg_opts.N_opts);
|
|
|
|
|
m_s1ap_log->console("ESM Info: %d Protocol Configuration Options %s\n",esm_info_resp.protocol_cnfg_opts.N_opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//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.
|
|
|
|
@ -794,8 +817,8 @@ s1ap_nas_transport::pack_authentication_request(srslte::byte_buffer_t *reply_msg
|
|
|
|
|
LIBLTE_ERROR_ENUM err = liblte_mme_pack_authentication_request_msg(&auth_req, (LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Athentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Athentication Request\n");
|
|
|
|
|
m_s1ap_log->error("Error packing Authentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Authentication Request\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -807,8 +830,8 @@ s1ap_nas_transport::pack_authentication_request(srslte::byte_buffer_t *reply_msg
|
|
|
|
|
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Athentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Athentication Request\n");
|
|
|
|
|
m_s1ap_log->error("Error packing Authentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Authentication Request\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -845,8 +868,8 @@ s1ap_nas_transport::pack_authentication_reject(srslte::byte_buffer_t *reply_msg,
|
|
|
|
|
LIBLTE_ERROR_ENUM err = liblte_mme_pack_authentication_reject_msg(&auth_rej, (LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->error("Error packing Authentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Authentication Reject\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -858,8 +881,8 @@ s1ap_nas_transport::pack_authentication_reject(srslte::byte_buffer_t *reply_msg,
|
|
|
|
|
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Authentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Authentication Reject\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -948,7 +971,7 @@ s1ap_nas_transport::pack_security_mode_command(srslte::byte_buffer_t *reply_msg,
|
|
|
|
|
LIBLTE_ERROR_ENUM err = liblte_mme_pack_security_mode_command_msg(&sm_cmd,sec_hdr_type, ue_ctx->security_ctxt.dl_nas_count,(LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->console("Error packing Athentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Authentication Request\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -982,7 +1005,7 @@ s1ap_nas_transport::pack_security_mode_command(srslte::byte_buffer_t *reply_msg,
|
|
|
|
|
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->console("Error packing Athentication Request\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Authentication Request\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
m_s1ap_log->debug_hex(reply_msg->msg, reply_msg->N_bytes, "Security Mode Command: ");
|
|
|
|
@ -1015,7 +1038,7 @@ s1ap_nas_transport::pack_esm_information_request(srslte::byte_buffer_t *reply_ms
|
|
|
|
|
dw_nas->SubscriberProfileIDforRFP_present=false;
|
|
|
|
|
|
|
|
|
|
LIBLTE_MME_ESM_INFORMATION_REQUEST_MSG_STRUCT esm_info_req;
|
|
|
|
|
esm_info_req.eps_bearer_id=0;
|
|
|
|
|
esm_info_req.eps_bearer_id = 0;
|
|
|
|
|
esm_info_req.proc_transaction_id = ue_ctx->procedure_transaction_id;
|
|
|
|
|
uint8_t sec_hdr_type=2;
|
|
|
|
|
|
|
|
|
@ -1048,8 +1071,8 @@ s1ap_nas_transport::pack_esm_information_request(srslte::byte_buffer_t *reply_ms
|
|
|
|
|
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Authentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Authentication Reject\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1087,7 +1110,7 @@ s1ap_nas_transport::pack_attach_accept(ue_ctx_t *ue_ctx, LIBLTE_S1AP_E_RABTOBESE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Attach accept
|
|
|
|
|
attach_accept.eps_attach_result = LIBLTE_MME_EPS_ATTACH_RESULT_EPS_ONLY;
|
|
|
|
|
attach_accept.eps_attach_result = ue_ctx->attach_type;
|
|
|
|
|
//Mandatory
|
|
|
|
|
//FIXME: Set t3412 from config
|
|
|
|
|
attach_accept.t3412.unit = LIBLTE_MME_GPRS_TIMER_UNIT_1_MINUTE; // GPRS 1 minute unit
|
|
|
|
@ -1140,8 +1163,7 @@ s1ap_nas_transport::pack_attach_accept(ue_ctx_t *ue_ctx, LIBLTE_S1AP_E_RABTOBESE
|
|
|
|
|
act_def_eps_bearer_context_req.eps_qos.mbr_dl_ext = 250; //FIXME check
|
|
|
|
|
//set apn
|
|
|
|
|
//act_def_eps_bearer_context_req.apn
|
|
|
|
|
std::string apn("test123");
|
|
|
|
|
act_def_eps_bearer_context_req.apn.apn = apn; //FIXME
|
|
|
|
|
act_def_eps_bearer_context_req.apn.apn = m_s1ap->m_s1ap_args.mme_apn;
|
|
|
|
|
act_def_eps_bearer_context_req.proc_transaction_id = ue_ctx->procedure_transaction_id; //FIXME
|
|
|
|
|
|
|
|
|
|
//Set DNS server
|
|
|
|
@ -1161,6 +1183,7 @@ s1ap_nas_transport::pack_attach_accept(ue_ctx_t *ue_ctx, LIBLTE_S1AP_E_RABTOBESE
|
|
|
|
|
act_def_eps_bearer_context_req.packet_flow_id_present = false;
|
|
|
|
|
act_def_eps_bearer_context_req.apn_ambr_present = false;
|
|
|
|
|
act_def_eps_bearer_context_req.esm_cause_present = false;
|
|
|
|
|
act_def_eps_bearer_context_req.connectivity_type_present = false;
|
|
|
|
|
|
|
|
|
|
uint8_t sec_hdr_type =2;
|
|
|
|
|
ue_ctx->security_ctxt.dl_nas_count++;
|
|
|
|
@ -1230,8 +1253,8 @@ s1ap_nas_transport::pack_identity_request(srslte::byte_buffer_t *reply_msg, uint
|
|
|
|
|
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Athentication Reject\n");
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Authentication Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Authentication Reject\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1308,6 +1331,59 @@ s1ap_nas_transport::pack_emm_information(srslte::byte_buffer_t *reply_msg, uint3
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
s1ap_nas_transport::pack_service_reject(srslte::byte_buffer_t *reply_msg, uint8_t emm_cause, uint32_t enb_ue_s1ap_id)
|
|
|
|
|
{
|
|
|
|
|
srslte::byte_buffer_t *nas_buffer = m_pool->allocate();
|
|
|
|
|
|
|
|
|
|
//Setup initiating message
|
|
|
|
|
LIBLTE_S1AP_S1AP_PDU_STRUCT tx_pdu;
|
|
|
|
|
bzero(&tx_pdu, sizeof(LIBLTE_S1AP_S1AP_PDU_STRUCT));
|
|
|
|
|
|
|
|
|
|
tx_pdu.ext = false;
|
|
|
|
|
tx_pdu.choice_type = LIBLTE_S1AP_S1AP_PDU_CHOICE_INITIATINGMESSAGE;
|
|
|
|
|
|
|
|
|
|
LIBLTE_S1AP_INITIATINGMESSAGE_STRUCT *init = &tx_pdu.choice.initiatingMessage;
|
|
|
|
|
init->procedureCode = LIBLTE_S1AP_PROC_ID_DOWNLINKNASTRANSPORT;
|
|
|
|
|
init->choice_type = LIBLTE_S1AP_INITIATINGMESSAGE_CHOICE_DOWNLINKNASTRANSPORT;
|
|
|
|
|
|
|
|
|
|
//Setup Dw NAS structure
|
|
|
|
|
LIBLTE_S1AP_MESSAGE_DOWNLINKNASTRANSPORT_STRUCT *dw_nas = &init->choice.DownlinkNASTransport;
|
|
|
|
|
dw_nas->ext=false;
|
|
|
|
|
dw_nas->MME_UE_S1AP_ID.MME_UE_S1AP_ID = m_s1ap->get_next_mme_ue_s1ap_id();
|
|
|
|
|
dw_nas->eNB_UE_S1AP_ID.ENB_UE_S1AP_ID = enb_ue_s1ap_id;
|
|
|
|
|
dw_nas->HandoverRestrictionList_present=false;
|
|
|
|
|
dw_nas->SubscriberProfileIDforRFP_present=false;
|
|
|
|
|
LIBLTE_MME_SERVICE_REJECT_MSG_STRUCT service_rej;
|
|
|
|
|
service_rej.t3442_present = true;
|
|
|
|
|
service_rej.t3442.unit = LIBLTE_MME_GPRS_TIMER_DEACTIVATED;
|
|
|
|
|
service_rej.t3442.value = 0;
|
|
|
|
|
service_rej.t3446_present = true;
|
|
|
|
|
service_rej.t3446 = 0;
|
|
|
|
|
service_rej.emm_cause = emm_cause;
|
|
|
|
|
|
|
|
|
|
LIBLTE_ERROR_ENUM err = liblte_mme_pack_service_reject_msg(&service_rej, LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS, 0, (LIBLTE_BYTE_MSG_STRUCT *) nas_buffer);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Service Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Service Reject\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Copy NAS PDU to Downlink NAS Trasport message buffer
|
|
|
|
|
memcpy(dw_nas->NAS_PDU.buffer, nas_buffer->msg, nas_buffer->N_bytes);
|
|
|
|
|
dw_nas->NAS_PDU.n_octets = nas_buffer->N_bytes;
|
|
|
|
|
|
|
|
|
|
//Pack Downlink NAS Transport Message
|
|
|
|
|
err = liblte_s1ap_pack_s1ap_pdu(&tx_pdu, (LIBLTE_BYTE_MSG_STRUCT *) reply_msg);
|
|
|
|
|
if(err != LIBLTE_SUCCESS)
|
|
|
|
|
{
|
|
|
|
|
m_s1ap_log->error("Error packing Dw NAS Transport: Service Reject\n");
|
|
|
|
|
m_s1ap_log->console("Error packing Downlink NAS Transport: Service Reject\n");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
/*Helper functions*/
|
|
|
|
|
void
|
|
|
|
|
s1ap_nas_transport::log_unhandled_attach_request_ies(const LIBLTE_MME_ATTACH_REQUEST_MSG_STRUCT *attach_req)
|
|
|
|
|