diff --git a/srsepc/hdr/mme/nas.h b/srsepc/hdr/mme/nas.h index 4ce4382bc..10179c95c 100644 --- a/srsepc/hdr/mme/nas.h +++ b/srsepc/hdr/mme/nas.h @@ -132,6 +132,7 @@ typedef struct { std::string short_net_name; srsran::CIPHERING_ALGORITHM_ID_ENUM cipher_algo; srsran::INTEGRITY_ALGORITHM_ID_ENUM integ_algo; + bool request_imeisv; } nas_init_t; typedef struct { @@ -268,6 +269,7 @@ private: std::string m_dns; std::string m_full_net_name; std::string m_short_net_name; + bool m_request_imeisv = false; // Timers timeout values uint16_t m_t3413 = 0; diff --git a/srsepc/hdr/mme/s1ap_common.h b/srsepc/hdr/mme/s1ap_common.h index 5fe6e6f89..3c38d6929 100644 --- a/srsepc/hdr/mme/s1ap_common.h +++ b/srsepc/hdr/mme/s1ap_common.h @@ -42,6 +42,7 @@ typedef struct { std::string pcap_filename; srsran::CIPHERING_ALGORITHM_ID_ENUM encryption_algo; srsran::INTEGRITY_ALGORITHM_ID_ENUM integrity_algo; + bool request_imeisv; } s1ap_args_t; typedef struct { diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index c2ace4cb2..d541e3412 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -84,6 +84,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) string dns_addr; string full_net_name; string short_net_name; + bool request_imeisv; string hss_db_file; string hss_auth_algo; string log_filename; @@ -113,6 +114,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("mme.encryption_algo", bpo::value(&encryption_algo)->default_value("EEA0"), "Set preferred encryption algorithm for NAS layer ") ("mme.integrity_algo", bpo::value(&integrity_algo)->default_value("EIA1"), "Set preferred integrity protection algorithm for NAS") ("mme.paging_timer", bpo::value(&paging_timer)->default_value(2), "Set paging timer value in seconds (T3413)") + ("mme.request_imeisv", bpo::value(&request_imeisv)->default_value(false), "Enable IMEISV request in Security mode command") ("hss.db_file", bpo::value(&hss_db_file)->default_value("ue_db.csv"), ".csv file that stores UE's keys") ("spgw.gtpu_bind_addr", bpo::value(&spgw_bind_addr)->default_value("127.0.0.1"), "IP address of SP-GW for the S1-U connection") ("spgw.sgi_if_addr", bpo::value(&sgi_if_addr)->default_value("176.16.0.1"), "IP address of TUN interface for the SGi connection") @@ -272,6 +274,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) args->mme_args.s1ap_args.short_net_name = short_net_name; args->mme_args.s1ap_args.mme_apn = mme_apn; args->mme_args.s1ap_args.paging_timer = paging_timer; + args->mme_args.s1ap_args.request_imeisv = request_imeisv; args->spgw_args.gtpu_bind_addr = spgw_bind_addr; args->spgw_args.sgi_if_addr = sgi_if_addr; args->spgw_args.sgi_if_name = sgi_if_name; diff --git a/srsepc/src/mme/nas.cc b/srsepc/src/mme/nas.cc index c43324390..56d8f6da7 100644 --- a/srsepc/src/mme/nas.cc +++ b/srsepc/src/mme/nas.cc @@ -36,7 +36,8 @@ nas::nas(const nas_init_t& args, const nas_if_t& itf) : m_dns(args.dns), m_full_net_name(args.full_net_name), m_short_net_name(args.short_net_name), - m_t3413(args.paging_timer) + m_t3413(args.paging_timer), + m_request_imeisv(args.request_imeisv) { m_sec_ctx.integ_algo = args.integ_algo; m_sec_ctx.cipher_algo = args.cipher_algo; @@ -1380,7 +1381,11 @@ bool nas::pack_security_mode_command(srsran::byte_buffer_t* nas_buffer) sm_cmd.ue_security_cap.gea_present = m_sec_ctx.ms_network_cap_present; memcpy(sm_cmd.ue_security_cap.gea, m_sec_ctx.ms_network_cap.gea, 8 * sizeof(bool)); - sm_cmd.imeisv_req_present = false; + sm_cmd.imeisv_req_present = m_request_imeisv; + if (m_request_imeisv) { + sm_cmd.imeisv_req = LIBLTE_MME_IMEISV_REQUESTED; + } + sm_cmd.nonce_ue_present = false; sm_cmd.nonce_mme_present = false; diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index b4d701eb4..6e7633c16 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -71,6 +71,7 @@ void s1ap_nas_transport::init() m_nas_init.paging_timer = m_s1ap->m_s1ap_args.paging_timer; m_nas_init.integ_algo = m_s1ap->m_s1ap_args.integrity_algo; m_nas_init.cipher_algo = m_s1ap->m_s1ap_args.encryption_algo; + m_nas_init.request_imeisv = m_s1ap->m_s1ap_args.request_imeisv; // Init NAS interface m_nas_if.s1ap = s1ap::get_instance();