Add option to request IMEISV

This commit is contained in:
Matan Perelman 2021-07-23 18:34:24 +03:00 committed by Andre Puschmann
parent 5d6b48311e
commit f4adf80263
5 changed files with 14 additions and 2 deletions

View File

@ -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;

View File

@ -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 {

View File

@ -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<string>(&encryption_algo)->default_value("EEA0"), "Set preferred encryption algorithm for NAS layer ")
("mme.integrity_algo", bpo::value<string>(&integrity_algo)->default_value("EIA1"), "Set preferred integrity protection algorithm for NAS")
("mme.paging_timer", bpo::value<uint16_t>(&paging_timer)->default_value(2), "Set paging timer value in seconds (T3413)")
("mme.request_imeisv", bpo::value<bool>(&request_imeisv)->default_value(false), "Enable IMEISV request in Security mode command")
("hss.db_file", bpo::value<string>(&hss_db_file)->default_value("ue_db.csv"), ".csv file that stores UE's keys")
("spgw.gtpu_bind_addr", bpo::value<string>(&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<string>(&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;

View File

@ -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;

View File

@ -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();