Fixed NAS initialization. Attach request seems to work again now.

master
Pedro Alvarez 6 years ago
parent d76053e7ec
commit 7c53330bec

@ -135,7 +135,16 @@ class nas
{ {
public: public:
nas(); nas();
void init(s1ap_interface_nas *s1ap, gtpc_interface_nas *gtpc, hss_interface_nas *hss, srslte::log *nas_log); void init(uint16_t mcc,
uint16_t mnc,
uint8_t mme_code,
uint16_t mme_group,
std::string apn,
std::string dns,
s1ap_interface_nas *s1ap,
gtpc_interface_nas *gtpc,
hss_interface_nas *hss,
srslte::log *nas_log);
/*Initial UE messages*/ /*Initial UE messages*/
bool handle_nas_attach_request( uint32_t enb_ue_s1ap_id, bool handle_nas_attach_request( uint32_t enb_ue_s1ap_id,

@ -40,11 +40,24 @@ nas::nas() {
} }
void void
nas::init(s1ap_interface_nas *s1ap, nas::init(uint16_t mcc,
uint16_t mnc,
uint8_t mme_code,
uint16_t mme_group,
std::string apn,
std::string dns,
s1ap_interface_nas *s1ap,
gtpc_interface_nas *gtpc, gtpc_interface_nas *gtpc,
hss_interface_nas *hss, hss_interface_nas *hss,
srslte::log *nas_log) srslte::log *nas_log)
{ {
m_mcc = mcc;
m_mnc = mnc;
m_mme_code = mme_code;
m_mme_group = mme_group;
m_apn = apn;
m_dns = dns;
m_s1ap = s1ap; m_s1ap = s1ap;
m_gtpc = gtpc; m_gtpc = gtpc;
m_hss = hss; m_hss = hss;
@ -788,10 +801,6 @@ nas::pack_attach_accept(srslte::byte_buffer_t *nas_buffer)
memcpy(&nas_buffer->msg[1],mac,4); memcpy(&nas_buffer->msg[1],mac,4);
m_nas_log->info("Packed Attach Accept\n"); m_nas_log->info("Packed Attach Accept\n");
//Add nas message to context setup request
//erab_ctxt->nAS_PDU_present = true;
//memcpy(erab_ctxt->nAS_PDU.buffer, nas_buffer->msg, nas_buffer->N_bytes);
//erab_ctxt->nAS_PDU.n_octets = nas_buffer->N_bytes;
return true; return true;
} }

@ -379,7 +379,13 @@ s1ap_nas_transport::handle_nas_imsi_attach_request(uint32_t enb_ue_s1ap_id,
//Set UE's EMM context //Set UE's EMM context
nas *nas_ctx = new nas; nas *nas_ctx = new nas;
nas_ctx->init(m_s1ap, m_mme_gtpc, m_hss, m_s1ap->m_nas_log); nas_ctx->init(m_s1ap->m_s1ap_args.mcc,
m_s1ap->m_s1ap_args.mnc,
m_s1ap->m_s1ap_args.mme_code,
m_s1ap->m_s1ap_args.mme_group,
m_s1ap->m_s1ap_args.mme_apn,
m_s1ap->m_s1ap_args.dns_addr,
m_s1ap, m_mme_gtpc, m_hss, m_s1ap->m_nas_log);
emm_ctx_t *emm_ctx = &nas_ctx->m_emm_ctx; emm_ctx_t *emm_ctx = &nas_ctx->m_emm_ctx;
ecm_ctx_t *ecm_ctx = &nas_ctx->m_ecm_ctx; ecm_ctx_t *ecm_ctx = &nas_ctx->m_ecm_ctx;
sec_ctx_t *sec_ctx = &nas_ctx->m_sec_ctx; sec_ctx_t *sec_ctx = &nas_ctx->m_sec_ctx;
@ -497,7 +503,13 @@ s1ap_nas_transport::handle_nas_guti_attach_request( uint32_t enb_ue_s1ap_id,
m_s1ap_log->info("Attach Request -- Could not find M-TMSI 0x%x\n", m_tmsi); m_s1ap_log->info("Attach Request -- Could not find M-TMSI 0x%x\n", m_tmsi);
nas *nas_ctx = new nas; nas *nas_ctx = new nas;
nas_ctx->init(m_s1ap, m_mme_gtpc, m_hss, m_s1ap->m_nas_log); nas_ctx->init(m_s1ap->m_s1ap_args.mcc,
m_s1ap->m_s1ap_args.mnc,
m_s1ap->m_s1ap_args.mme_code,
m_s1ap->m_s1ap_args.mme_group,
m_s1ap->m_s1ap_args.mme_apn,
m_s1ap->m_s1ap_args.dns_addr,
m_s1ap, m_mme_gtpc, m_hss, m_s1ap->m_nas_log);
emm_ctx_t *emm_ctx = &nas_ctx->m_emm_ctx; emm_ctx_t *emm_ctx = &nas_ctx->m_emm_ctx;
ecm_ctx_t *ecm_ctx = &nas_ctx->m_ecm_ctx; ecm_ctx_t *ecm_ctx = &nas_ctx->m_ecm_ctx;
sec_ctx_t *sec_ctx = &nas_ctx->m_sec_ctx; sec_ctx_t *sec_ctx = &nas_ctx->m_sec_ctx;

Loading…
Cancel
Save