Commit 92d197a1 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue for SUPI conversion

parent 82c68b3b
......@@ -46,6 +46,7 @@ typedef struct {
char data[SUPI_DIGITS_MAX + 1];
} supi_t;
// TODO: Move to conversions
static void smf_string_to_supi(supi_t* const supi, char const* const supi_str) {
// strncpy(supi->data, supi_str, SUPI_DIGITS_MAX + 1);
memcpy((void*) supi->data, (void*) supi_str, SUPI_DIGITS_MAX + 1);
......@@ -77,6 +78,13 @@ static uint64_t smf_supi_to_u64(supi_t supi) {
return uint_supi;
}
static std::string smf_supi64_to_string(const supi64_t& supi) {
std::string supi_str = std::to_string(supi);
uint8_t padded_len = SUPI_DIGITS_MAX - supi_str.length();
for (int i = 0; i < padded_len; i++) supi_str = "0" + supi_str;
return supi_str;
}
typedef struct s_nssai // section 28.4, TS23.003
{
const uint8_t HASH_SEED = 17;
......
......@@ -859,7 +859,8 @@ bool smf_sbi::get_sm_data(
std::string(inet_ntoa(*((struct in_addr*) &smf_cfg.udm_addr.ipv4_addr))) +
":" + std::to_string(smf_cfg.udm_addr.port) + NUDM_SDM_BASE +
smf_cfg.udm_addr.api_version +
fmt::format(NUDM_SDM_GET_SM_DATA_URL, std::to_string(supi)) + query_str;
fmt::format(NUDM_SDM_GET_SM_DATA_URL, smf_supi64_to_string(supi)) +
query_str;
Logger::smf_sbi().debug("UDM's URL: %s ", url.c_str());
......
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