Commit 030856ea authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Add function to get GUTI from TMSI

parent c904b0f4
...@@ -204,7 +204,6 @@ long amf_app::generate_amf_ue_ngap_id() { ...@@ -204,7 +204,6 @@ long amf_app::generate_amf_ue_ngap_id() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool amf_app::is_ran_amf_id_2_ue_context(const string& ue_context_key) const { bool amf_app::is_ran_amf_id_2_ue_context(const string& ue_context_key) const {
std::shared_lock lock(m_ue_ctx_key); std::shared_lock lock(m_ue_ctx_key);
// return bool{ue_ctx_key.count(ue_context_key) > 0};
if (ue_ctx_key.count(ue_context_key) > 0) { if (ue_ctx_key.count(ue_context_key) > 0) {
if (ue_ctx_key.at(ue_context_key) != nullptr) { if (ue_ctx_key.at(ue_context_key) != nullptr) {
return true; return true;
......
...@@ -491,3 +491,17 @@ std::string conv::get_serving_network_name( ...@@ -491,3 +491,17 @@ std::string conv::get_serving_network_name(
snn = "5G:mnc" + mnc + ".mcc" + mcc + ".3gppnetwork.org"; snn = "5G:mnc" + mnc + ".mcc" + mcc + ".3gppnetwork.org";
return snn; return snn;
} }
//------------------------------------------------------------------------------
std::string conv::uint32_to_hex_string(uint32_t value) {
char hex_str[8];
sprintf(hex_str, "%X", value);
return std::string(hex_str);
}
//------------------------------------------------------------------------------
std::string conv::tmsi_to_guti(
const std::string& mcc, const std::string& mnc,
const std::string& region_id, const std::string& tmsi) {
return {mcc + mnc + region_id + tmsi};
}
...@@ -99,5 +99,9 @@ class conv { ...@@ -99,5 +99,9 @@ class conv {
const uint32_t ran_ue_ngap_id, long amf_ue_ngap_id); const uint32_t ran_ue_ngap_id, long amf_ue_ngap_id);
static std::string get_serving_network_name( static std::string get_serving_network_name(
const std::string& mnc, const std::string& mcc); const std::string& mnc, const std::string& mcc);
static std::string uint32_to_hex_string(uint32_t value);
static std::string tmsi_to_guti(
const std::string& mcc, const std::string& mnc,
const std::string& region_id, const std::string& tmsi);
}; };
#endif /* FILE_CONVERSIONS_HPP_SEEN */ #endif /* FILE_CONVERSIONS_HPP_SEEN */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment