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{ typedef struct{
std::string auth_algo; std::string auth_algo;
std::string db_file; std::string db_file;
uint16_t mcc;
uint16_t mnc;
}hss_args_t; }hss_args_t;
typedef struct{ typedef struct{
@ -99,6 +101,8 @@ private:
/*Logs*/ /*Logs*/
srslte::log_filter *m_hss_log; srslte::log_filter *m_hss_log;
uint16_t mcc;
uint16_t mnc;
}; };
} // namespace srsepc } // namespace srsepc

@ -90,7 +90,10 @@ hss::init(hss_args_t *hss_args, srslte::log_filter *hss_log)
return -1; 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"); m_hss_log->console("HSS Initialized\n");
return 0; 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 ak[6];
uint8_t mac[8]; uint8_t mac[8];
uint16_t mcc=61441; //001
uint16_t mnc=65281; //01
if(!get_k_amf_op(imsi,k,amf,op)) 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 ak[6];
uint8_t mac[8]; uint8_t mac[8];
uint16_t mcc=61441; //001
uint16_t mnc=65281; //01
int i = 0; int i = 0;
if(!get_k_amf_op(imsi,k,amf,op)) if(!get_k_amf_op(imsi,k,amf,op))

@ -189,10 +189,18 @@ parse_args(all_args_t *args, int argc, char* argv[]) {
} }
// Convert MCC/MNC strings // Convert MCC/MNC strings
if(!srslte::string_to_mcc(mcc, &args->mme_args.s1ap_args.mcc)) { 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)) { 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->mme_args.s1ap_args.mme_bind_addr = mme_bind_addr;

Loading…
Cancel
Save