Made MCC and MNC in HSS configurable (not tested)

master
David Rupprecht 7 years ago
parent 415b528aff
commit b1cabf8117

@ -46,6 +46,8 @@ namespace srsepc{
typedef struct{
std::string auth_algo;
std::string db_file;
uint16_t mcc;
uint16_t mnc;
}hss_args_t;
typedef struct{
@ -98,7 +100,9 @@ private:
/*Logs*/
srslte::log_filter *m_hss_log;
uint16_t mcc;
uint16_t mnc;
};
} // namespace srsepc

@ -90,7 +90,10 @@ hss::init(hss_args_t *hss_args, srslte::log_filter *hss_log)
return -1;
}
m_hss_log->info("HSS Initialized. DB file %s, authentication algorithm %s\n", hss_args->db_file.c_str(),hss_args->auth_algo.c_str());
mcc = hss_args->mcc;
mnc = hss_args->mnc;
m_hss_log->info("HSS Initialized. DB file %s, authentication algorithm %s, MCC: %d, MNC: %d\n", hss_args->db_file.c_str(),hss_args->auth_algo.c_str(), mcc, mnc);
m_hss_log->console("HSS Initialized\n");
return 0;
}
@ -203,8 +206,6 @@ hss::gen_auth_info_answer_milenage(uint64_t imsi, uint8_t *k_asme, uint8_t *autn
uint8_t ak[6];
uint8_t mac[8];
uint16_t mcc=61441; //001
uint16_t mnc=65281; //01
if(!get_k_amf_op(imsi,k,amf,op))
{
@ -274,9 +275,6 @@ hss::gen_auth_info_answer_xor(uint64_t imsi, uint8_t *k_asme, uint8_t *autn, uin
uint8_t ak[6];
uint8_t mac[8];
uint16_t mcc=61441; //001
uint16_t mnc=65281; //01
int i = 0;
if(!get_k_amf_op(imsi,k,amf,op))

@ -189,12 +189,20 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
}
// Convert MCC/MNC strings
if(!srslte::string_to_mcc(mcc, &args->mme_args.s1ap_args.mcc)) {
cout << "Error parsing enb.mcc:" << mcc << " - must be a 3-digit string." << endl;
cout << "Error parsing mme.mcc:" << mcc << " - must be a 3-digit string." << endl;
}
if(!srslte::string_to_mnc(mnc, &args->mme_args.s1ap_args.mnc)) {
cout << "Error parsing enb.mnc:" << mnc << " - must be a 2 or 3-digit string." << endl;
cout << "Error parsing mme.mnc:" << mnc << " - must be a 2 or 3-digit string." << endl;
}
// Convert MCC/MNC strings
if(!srslte::string_to_mcc(mcc, &args->hss_args.mcc)) {
cout << "Error parsing mme.mcc:" << mcc << " - must be a 3-digit string." << endl;
}
if(!srslte::string_to_mnc(mnc, &args->hss_args.mnc)) {
cout << "Error parsing mme.mnc:" << mnc << " - must be a 2 or 3-digit string." << endl;
}
args->mme_args.s1ap_args.mme_bind_addr = mme_bind_addr;
args->spgw_args.gtpu_bind_addr = spgw_bind_addr;
args->spgw_args.sgi_if_addr = sgi_if_addr;
@ -302,7 +310,7 @@ main (int argc,char * argv[] )
cout << "Error initializing MME" << endl;
exit(1);
}
hss *hss = hss::get_instance();
if (hss->init(&args.hss_args,&hss_log)) {
cout << "Error initializing HSS" << endl;

Loading…
Cancel
Save