Commit 3c71b1c2 authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix SD issue

parent 2e98b774
......@@ -62,15 +62,23 @@ static uint64_t smf_supi_to_u64(supi_t supi) {
typedef struct s_nssai // section 28.4, TS23.003
{
uint8_t sST;
// uint32_t sD:24;
std::string sD;
// s_nssai(const uint8_t& sst, const uint32_t sd) : sST(sst), sD(sd) {}
s_nssai(const uint8_t& sst, const std::string sd) : sST(sst), sD(sd) {}
s_nssai() : sST(), sD() {}
s_nssai(const s_nssai& p) : sST(p.sST), sD(p.sD) {}
uint8_t sst;
uint32_t sd;
s_nssai(const uint8_t& m_sst, const uint32_t m_sd) : sst(m_sst), sd(m_sd) {}
s_nssai(const uint8_t& m_sst, const std::string m_sd) : sst(m_sst) {
sd = 0xFFFFFF;
try {
sd = std::stoul(m_sd, nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for snssai.SD, error: %s",
e.what());
}
}
s_nssai() : sst(), sd() {}
s_nssai(const s_nssai& p) : sst(p.sst), sd(p.sd) {}
bool operator==(const struct s_nssai& s) const {
if ((s.sST == this->sST) && (s.sD.compare(this->sD) == 0)) {
if ((s.sst == this->sst) && (s.sd == this->sd)) {
return true;
} else {
return false;
......@@ -78,15 +86,15 @@ typedef struct s_nssai // section 28.4, TS23.003
}
s_nssai& operator=(const struct s_nssai& s) {
sST = s.sST;
sD = s.sD;
sst = s.sst;
sd = s.sd;
return *this;
}
std::string toString() const {
std::string s = {};
s.append("SST=").append(std::to_string(sST));
s.append(", SD=").append(sD);
s.append("SST=").append(std::to_string(sst));
s.append(", SD=").append(std::to_string(sd));
return s;
}
......
......@@ -558,8 +558,8 @@ void xgpp_conv::smf_event_exposure_notification_from_openapi(
void xgpp_conv::sm_context_request_from_nas(
const nas_message_t& nas_msg,
smf::pdu_session_create_sm_context_request& pcr) {
pdu_session_type_t pdu_session_type = {.pdu_session_type =
PDU_SESSION_TYPE_E_IPV4};
pdu_session_type_t pdu_session_type = {
.pdu_session_type = PDU_SESSION_TYPE_E_IPV4};
// Extended Protocol Discriminator
pcr.set_epd(nas_msg.header.extended_protocol_discriminator);
// Message Type
......@@ -634,3 +634,15 @@ void xgpp_conv::update_sm_context_response_from_ctx_request(
ct_response->res.set_snssai(ct_request->req.get_snssai());
ct_response->res.set_dnn(ct_request->req.get_dnn());
}
//------------------------------------------------------------------------------
void xgpp_conv::sd_string_to_int(const std::string& sd_str, uint32_t& sd) {
sd = 0xFFFFFF;
try {
sd = std::stoul(sd_str, nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for S-NSSAI SD, error: %s",
e.what());
}
}
......@@ -169,6 +169,7 @@ void update_sm_context_response_from_ctx_request(
const std::shared_ptr<itti_n11_update_sm_context_request>& ct_request,
std::shared_ptr<itti_n11_update_sm_context_response>& ct_response);
void sd_string_to_int(const std::string& sd_str, uint32_t& sd);
} // namespace xgpp_conv
#endif /* FILE_3GPP_CONVERSIONS_HPP_SEEN */
......@@ -785,8 +785,8 @@ void smf_app::handle_pdu_session_create_sm_context_request(
std::string n1_sm_message, n1_sm_message_hex;
nas_message_t decoded_nas_msg = {};
cause_value_5gsm_e cause_n1 = {cause_value_5gsm_e::CAUSE_0_UNKNOWN};
pdu_session_type_t pdu_session_type = {.pdu_session_type =
PDU_SESSION_TYPE_E_IPV4};
pdu_session_type_t pdu_session_type = {
.pdu_session_type = PDU_SESSION_TYPE_E_IPV4};
// Step 1. Decode NAS and get the necessary information
int decoder_rc = smf_n1::get_instance().decode_n1_sm_container(
......@@ -853,8 +853,8 @@ void smf_app::handle_pdu_session_create_sm_context_request(
snssai_t snssai = smreq->req.get_snssai();
Logger::smf_app().info(
"Handle a PDU Session Create SM Context Request message from AMF, "
"SUPI " SUPI_64_FMT ", SNSSAI SST %d, SD %s",
supi64, snssai.sST, snssai.sD.c_str());
"SUPI " SUPI_64_FMT ", SNSSAI SST %d, SD %#0x",
supi64, snssai.sst, snssai.sd);
// Step 2. Verify Procedure transaction id, pdu session id, message type,
// request type, etc.
......@@ -1878,8 +1878,8 @@ bool smf_app::get_session_management_subscription_data(
std::make_shared<dnn_configuration_t>();
for (auto sub : smf_cfg.session_management_subscriptions) {
if ((0 == dnn.compare(sub.dnn)) and (snssai.sST == sub.single_nssai.sST) and
(0 == snssai.sD.compare(sub.single_nssai.sD))) {
if ((0 == dnn.compare(sub.dnn)) and (snssai.sst == sub.single_nssai.sst) and
(snssai.sd == sub.single_nssai.sd)) {
// PDU Session Type
pdu_session_type_t pdu_session_type(
pdu_session_type_e::PDU_SESSION_TYPE_E_IPV4);
......@@ -2278,14 +2278,14 @@ void smf_app::generate_smf_profile() {
for (auto sms : smf_cfg.session_management_subscriptions) {
// SNSSAIS
snssai_t snssai = {};
snssai.sD = sms.single_nssai.sD;
snssai.sST = sms.single_nssai.sST;
snssai.sd = sms.single_nssai.sd;
snssai.sst = sms.single_nssai.sst;
// Verify if this SNSSAI exist
std::vector<snssai_t> ss = {};
nf_instance_profile.get_nf_snssais(ss);
bool found = false;
for (auto it : ss) {
if ((it.sD == snssai.sD) and (it.sST == snssai.sST)) {
if ((it.sd == snssai.sd) and (it.sst == snssai.sst)) {
found = true;
break;
}
......@@ -2296,8 +2296,8 @@ void smf_app::generate_smf_profile() {
dnn_smf_info_item_t dnn_item = {.dnn = sms.dnn};
snssai_smf_info_item_t smf_info_item = {};
smf_info_item.dnn_smf_info_list.push_back(dnn_item);
smf_info_item.snssai.sD = sms.single_nssai.sD;
smf_info_item.snssai.sST = sms.single_nssai.sST;
smf_info_item.snssai.sd = sms.single_nssai.sd;
smf_info_item.snssai.sst = sms.single_nssai.sst;
nf_instance_profile.add_smf_info_item(smf_info_item);
}
......
......@@ -843,8 +843,17 @@ int smf_config::load(const string& config_file) {
session_management_subscription_cfg.lookupValue(
SMF_CONFIG_STRING_SESSION_AMBR_DL, session_ambr_dl);
sub_item.single_nssai.sST = nssai_sst;
sub_item.single_nssai.sD = nssai_sd;
sub_item.single_nssai.sst = nssai_sst;
sub_item.single_nssai.sd = 0xFFFFFF;
try {
sub_item.single_nssai.sd = std::stoul(nssai_sd, nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for snssai.SD, error: "
"%s",
e.what());
}
sub_item.session_type = default_session_type;
sub_item.dnn = dnn;
sub_item.ssc_mode = default_ssc_mode;
......@@ -1062,13 +1071,13 @@ void smf_config::display() {
nssai_str = nssai_str.append(" ")
.append(SMF_CONFIG_STRING_NSSAI_SST)
.append(": ")
.append(std::to_string(sub.single_nssai.sST));
.append(std::to_string(sub.single_nssai.sst));
if (!boost::iequals(sub.single_nssai.sD, "0xffffff")) {
if (sub.single_nssai.sd != 0xffffff) {
nssai_str = nssai_str.append(", ")
.append(SMF_CONFIG_STRING_NSSAI_SD)
.append(": ")
.append(sub.single_nssai.sD);
.append(std::to_string(sub.single_nssai.sd));
}
Logger::smf_app().info("%s", nssai_str.c_str());
......
......@@ -945,9 +945,9 @@ void smf_context::handle_itti_msg(
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]
["contentId"] = N2_SM_CONTENT_ID; // NGAP part
json_data["n2InfoContainer"]["smInfo"]["sNssai"]["sst"] =
session_report_msg.get_snssai().sST;
session_report_msg.get_snssai().sst;
json_data["n2InfoContainer"]["smInfo"]["sNssai"]["sd"] =
session_report_msg.get_snssai().sD;
std::to_string(session_report_msg.get_snssai().sd);
session_report_msg.set_json_data(json_data);
......@@ -1057,7 +1057,7 @@ void smf_context::get_default_qos(
const snssai_t& snssai, const std::string& dnn,
subscribed_default_qos_t& default_qos) {
Logger::smf_app().info(
"Get default QoS for a PDU Session, key %d", (uint8_t) snssai.sST);
"Get default QoS for a PDU Session, key %d", (uint8_t) snssai.sst);
// get the default QoS profile
std::shared_ptr<session_management_subscription> ss = {};
std::shared_ptr<dnn_configuration_t> sdc = {};
......@@ -3162,9 +3162,9 @@ void smf_context::handle_pdu_session_modification_network_requested(
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]
["contentId"] = N2_SM_CONTENT_ID; // NGAP part
json_data["n2InfoContainer"]["smInfo"]["sNssai"]["sst"] =
itti_msg->msg.get_snssai().sST;
itti_msg->msg.get_snssai().sst;
json_data["n2InfoContainer"]["smInfo"]["sNssai"]["sd"] =
itti_msg->msg.get_snssai().sD;
std::to_string(itti_msg->msg.get_snssai().sd);
json_data["n2InfoContainer"]["ranInfo"] = "SM";
json_data["pduSessionId"] = itti_msg->msg.get_pdu_session_id();
......@@ -3561,16 +3561,7 @@ bool smf_context::handle_ho_cancellation(
//------------------------------------------------------------------------------
void smf_context::get_snssai_key(const snssai_t& snssai, uint32_t& key) {
uint32_t sd = SD_NO_VALUE;
try {
sd = std::stoul(snssai.sD, nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for snssai.SD, error: %s",
e.what());
}
key = (sd << 8 | snssai.sST);
key = (snssai.sd << 8 | snssai.sst);
}
//------------------------------------------------------------------------------
......@@ -3582,11 +3573,10 @@ void smf_context::insert_dnn_subscription(
get_snssai_key(snssai, key);
std::unique_lock<std::recursive_mutex> lock(m_context);
dnn_subscriptions[key] = ss;
Logger::smf_app().info(
"Inserted DNN Subscription, key: %ld (SST %d, SD %s)", key, snssai.sST,
snssai.sD.c_str());
"Inserted DNN Subscription, key: %ld (SST %d, SD %#0x)", key, snssai.sst,
snssai.sd);
}
//------------------------------------------------------------------------------
......@@ -3598,11 +3588,9 @@ void smf_context::insert_dnn_subscription(
get_snssai_key(snssai, key);
std::unique_lock<std::recursive_mutex> lock(m_context);
if (dnn_subscriptions.count(key) > 0) {
std::shared_ptr<session_management_subscription> old_ss =
dnn_subscriptions.at(key);
std::shared_ptr<dnn_configuration_t> dnn_configuration = {};
ss.get()->find_dnn_configuration(dnn, dnn_configuration);
if (dnn_configuration != nullptr) {
......@@ -3613,8 +3601,8 @@ void smf_context::insert_dnn_subscription(
dnn_subscriptions[key] = ss;
}
Logger::smf_app().info(
"Inserted DNN Subscription, key: %ld (SST %d, SD %s), dnn %s", key,
snssai.sST, snssai.sD.c_str(), dnn.c_str());
"Inserted DNN Subscription, key: %ld (SST %d, SD %#0x), dnn %s", key,
snssai.sst, snssai.sd, dnn.c_str());
}
//------------------------------------------------------------------------------
......@@ -3645,8 +3633,8 @@ bool smf_context::find_dnn_subscription(
get_snssai_key(snssai, key);
Logger::smf_app().info(
"Find a DNN Subscription with key: %ld (SST %d, SD %s), map size %d",
(uint8_t) snssai.sST, snssai.sD.c_str(), dnn_subscriptions.size());
"Find a DNN Subscription with key: %ld (SST %d, SD %#0x), map size %d",
(uint8_t) snssai.sst, snssai.sd, dnn_subscriptions.size());
std::unique_lock<std::recursive_mutex> lock(m_context);
if (dnn_subscriptions.count(key) > 0) {
......@@ -3655,8 +3643,8 @@ bool smf_context::find_dnn_subscription(
}
Logger::smf_app().info(
"DNN subscription (SST %d, SD %s) not found", (uint8_t) snssai.sST,
snssai.sD.c_str());
"DNN subscription (SST %d, SD %#0x) not found", (uint8_t) snssai.sst,
snssai.sd);
return false;
}
......@@ -4157,8 +4145,8 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
cj["pdu_session_type"] =
sp->pdu_session_type.toString(); // PDU Session Type
// NSSAI
cj["snssai"]["sst"] = sp->get_snssai().sST;
cj["snssai"]["sd"] = sp->get_snssai().sD;
cj["snssai"]["sst"] = sp->get_snssai().sst;
cj["snssai"]["sd"] = std::to_string(sp->get_snssai().sd);
cj["dnn"] = sp->get_dnn(); // DNN
cj["amf_addr"] = sc->get_amf_addr(); // Serving AMF addr
......
......@@ -203,18 +203,9 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
// SNSSAI
sm_msg->pdu_session_establishment_accept.snssai.len = SST_AND_SD_LENGTH;
sm_msg->pdu_session_establishment_accept.snssai.sst =
sm_context_res.get_snssai().sST;
try {
sm_msg->pdu_session_establishment_accept.snssai.sd =
std::stoul(sm_context_res.get_snssai().sD, nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_n1().warn(
"Error when converting from string to int for snssai.SD, error: %s",
e.what());
//"no SD value associated with the SST"
sm_msg->pdu_session_establishment_accept.snssai.sd = 0xFFFFFF;
}
sm_context_res.get_snssai().sst;
sm_msg->pdu_session_establishment_accept.snssai.sd =
sm_context_res.get_snssai().sd;
Logger::smf_n1().debug(
"SNSSAI SST %d, SD %#0x",
......
......@@ -467,17 +467,17 @@ bool pfcp_associations::select_up_node(
Logger::smf_app().debug("UPF info: %s", upf_info.to_string().c_str());
for (auto ui : upf_info.snssai_upf_info_list) {
if (ui.snssai.sST == snssai.sST) {
if ((ui.snssai.sST <= SST_MAX_STANDARDIZED_VALUE) or
(snssai.sD.compare(ui.snssai.sD) == 0)) {
if (ui.snssai.sst == snssai.sst) {
if ((ui.snssai.sst <= SST_MAX_STANDARDIZED_VALUE) or
(snssai.sd == ui.snssai.sd)) {
for (auto d : ui.dnn_upf_info_list) {
if (d.dnn.compare(dnn) == 0) {
node_id = it->second->node_id;
Logger::smf_app().info(
"Select the UPF for the corresponding DNN %s, NSSSAI (SD: "
"%s, "
"SST: %d) ",
d.dnn.c_str(), snssai.sD.c_str(), snssai.sST);
"Select the UPF for the corresponding DNN %s, NSSSAI (SST: "
"%d, "
"SD: %d) ",
d.dnn.c_str(), snssai.sst, snssai.sd);
return true;
}
}
......
......@@ -542,9 +542,9 @@ void session_create_sm_context_procedure::handle_itti_msg(
json_data["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]
["contentId"] = N2_SM_CONTENT_ID; // NGAP part
json_data["n2InfoContainer"]["smInfo"]["sNssai"]["sst"] =
n11_triggered_pending->res.get_snssai().sST;
n11_triggered_pending->res.get_snssai().sst;
json_data["n2InfoContainer"]["smInfo"]["sNssai"]["sd"] =
n11_triggered_pending->res.get_snssai().sD;
std::to_string(n11_triggered_pending->res.get_snssai().sd);
json_data["n2InfoContainer"]["ranInfo"] = "SM";
// N1N2MsgTxfrFailureNotification
......
......@@ -203,7 +203,7 @@ void nf_profile::display() const {
Logger::smf_app().debug("\tSNSSAI:");
}
for (auto s : snssais) {
Logger::smf_app().debug("\t\t SST %d, SD %s", s.sST, s.sD.c_str());
Logger::smf_app().debug("\t\t SST %d, SD %#0x", s.sst, s.sd);
}
if (!fqdn.empty()) {
Logger::smf_app().debug("\tFQDN: %s", fqdn.c_str());
......@@ -235,8 +235,8 @@ void nf_profile::to_json(nlohmann::json& data) const {
data["sNssais"] = nlohmann::json::array();
for (auto s : snssais) {
nlohmann::json tmp = {};
tmp["sst"] = s.sST;
tmp["sd"] = s.sD;
tmp["sst"] = s.sst;
tmp["sd"] = std::to_string(s.sd);
data["sNssais"].push_back(tmp);
}
if (!fqdn.empty()) {
......@@ -282,8 +282,17 @@ void nf_profile::from_json(const nlohmann::json& data) {
if (data.find("sNssais") != data.end()) {
for (auto it : data["sNssais"]) {
snssai_t s = {};
s.sST = it["sst"].get<int>();
s.sD = it["sd"].get<std::string>();
s.sst = it["sst"].get<int>();
s.sd = 0xFFFFFF;
try {
s.sd = std::stoul(it["sd"].get<std::string>(), nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for snssai.SD, error: %s",
e.what());
}
// s.sD = it["sd"].get<std::string>();
snssais.push_back(s);
}
}
......@@ -384,7 +393,7 @@ void smf_profile::display() const {
for (auto s : smf_info.snssai_smf_info_list) {
Logger::smf_app().debug("\t\tParameters supported by the SMF:");
Logger::smf_app().debug(
"\t\t\tSNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str());
"\t\t\tSNSSAI (SST %d, SD %#0x)", s.snssai.sst, s.snssai.sd);
for (auto d : s.dnn_smf_info_list) {
Logger::smf_app().debug("\t\t\tDNN %s", d.dnn.c_str());
}
......@@ -430,8 +439,8 @@ void smf_profile::to_json(nlohmann::json& data) const {
data["smfInfo"]["sNssaiSmfInfoList"] = nlohmann::json::array();
for (auto s : smf_info.snssai_smf_info_list) {
nlohmann::json tmp = {};
tmp["sNssai"]["sst"] = s.snssai.sST;
tmp["sNssai"]["sd"] = s.snssai.sD;
tmp["sNssai"]["sst"] = s.snssai.sst;
tmp["sNssai"]["sd"] = std::to_string(s.snssai.sd);
tmp["dnnSmfInfoList"] = nlohmann::json::array();
for (auto d : s.dnn_smf_info_list) {
nlohmann::json dnn_json = {};
......@@ -464,9 +473,19 @@ void smf_profile::from_json(const nlohmann::json& data) {
snssai_smf_info_item_t smf_info_item = {};
if (it.find("sNssai") != it.end()) {
if (it["sNssai"].find("sst") != it["sNssai"].end())
smf_info_item.snssai.sST = it["sNssai"]["sst"].get<int>();
if (it["sNssai"].find("sd") != it["sNssai"].end())
smf_info_item.snssai.sD = it["sNssai"]["sd"].get<std::string>();
smf_info_item.snssai.sst = it["sNssai"]["sst"].get<int>();
if (it["sNssai"].find("sd") != it["sNssai"].end()) {
smf_info_item.snssai.sd = 0xFFFFFF;
try {
smf_info_item.snssai.sd = std::stoul(
it["sNssai"]["sd"].get<std::string>(), nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for snssai.SD, "
"error: %s",
e.what());
}
}
}
if (it.find("dnnSmfInfoList") != it.end()) {
for (auto d : it["dnnSmfInfoList"]) {
......@@ -514,7 +533,7 @@ void upf_profile::display() const {
for (auto s : upf_info.snssai_upf_info_list) {
Logger::smf_app().debug("\t\tParameters supported by the UPF:");
Logger::smf_app().debug(
"\t\t\tSNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str());
"\t\t\tSNSSAI (SST %d, SD %#0x)", s.snssai.sst, s.snssai.sd);
for (auto d : s.dnn_upf_info_list) {
Logger::smf_app().debug("\t\t\tDNN %s", d.dnn.c_str());
}
......@@ -550,8 +569,8 @@ void upf_profile::to_json(nlohmann::json& data) const {
data["upfInfo"]["sNssaiUpfInfoList"] = nlohmann::json::array();
for (auto s : upf_info.snssai_upf_info_list) {
nlohmann::json tmp = {};
tmp["sNssai"]["sst"] = s.snssai.sST;
tmp["sNssai"]["sd"] = s.snssai.sD;
tmp["sNssai"]["sst"] = s.snssai.sst;
tmp["sNssai"]["sd"] = std::to_string(s.snssai.sd);
tmp["dnnSmfInfoList"] = nlohmann::json::array();
for (auto d : s.dnn_upf_info_list) {
nlohmann::json dnn_json = {};
......@@ -598,9 +617,19 @@ void upf_profile::from_json(const nlohmann::json& data) {
snssai_upf_info_item_t upf_info_item = {};
if (it.find("sNssai") != it.end()) {
if (it["sNssai"].find("sst") != it["sNssai"].end())
upf_info_item.snssai.sST = it["sNssai"]["sst"].get<int>();
if (it["sNssai"].find("sd") != it["sNssai"].end())
upf_info_item.snssai.sD = it["sNssai"]["sd"].get<std::string>();
upf_info_item.snssai.sst = it["sNssai"]["sst"].get<int>();
if (it["sNssai"].find("sd") != it["sNssai"].end()) {
upf_info_item.snssai.sd = 0xFFFFFF;
try {
upf_info_item.snssai.sd = std::stoul(
it["sNssai"]["sd"].get<std::string>(), nullptr, 10);
} catch (const std::exception& e) {
Logger::smf_app().warn(
"Error when converting from string to int for snssai.SD, "
"error: %s",
e.what());
}
}
}
if (it.find("dnnUpfInfoList") != it.end()) {
for (auto d : it["dnnUpfInfoList"]) {
......
......@@ -43,6 +43,7 @@
#include "itti.hpp"
#include "logger.hpp"
#include "mime_parser.hpp"
#include "3gpp_conversions.hpp"
#include "smf.h"
#include "smf_app.hpp"
#include "smf_config.hpp"
......@@ -844,8 +845,8 @@ bool smf_sbi::get_sm_data(
std::string mnc = {};
conv::plmnToMccMnc(plmn, mcc, mnc);
query_str = "?single-nssai={\"sst\":" + std::to_string(snssai.sST) +
",\"sd\":\"" + snssai.sD + "\"}&dnn=" + dnn +
query_str = "?single-nssai={\"sst\":" + std::to_string(snssai.sst) +
",\"sd\":\"" + std::to_string(snssai.sd) + "\"}&dnn=" + dnn +
"&plmn-id={\"mcc\":\"" + mcc + "\",\"mnc\":\"" + mnc + "\"}";
std::string url =
std::string(inet_ntoa(*((struct in_addr*) &smf_cfg.udm_addr.ipv4_addr))) +
......@@ -906,13 +907,16 @@ bool smf_sbi::get_sm_data(
if (jsonData.find("singleNssai") == jsonData.end()) return false;
if (jsonData["singleNssai"].find("sst") != jsonData["singleNssai"].end()) {
uint8_t sst = jsonData["singleNssai"]["sst"].get<uint8_t>();
if (sst != snssai.sST) {
if (sst != snssai.sst) {
return false;
}
}
if (jsonData["singleNssai"].find("sd") != jsonData["singleNssai"].end()) {
std::string sd = jsonData["singleNssai"]["sd"];
if (sd.compare(snssai.sD) != 0) {
std::string sd_str = jsonData["singleNssai"]["sd"];
uint32_t sd = 0xFFFFFF;
xgpp_conv::sd_string_to_int(
jsonData["singleNssai"]["sd"].get<std::string>(), sd);
if (sd != snssai.sd) {
return false;
}
}
......
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