Commit 8f8eef69 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'nssai' into 'develop'

use (SST, SD) to get the subscription information

See merge request oai/cn5g/oai-cn5g-smf!60
parents f750f1ab fdd34d52
......@@ -44,7 +44,7 @@ int encode_snssai(SNSSAI snssai, uint8_t iei, uint8_t* buffer, uint32_t len) {
}
ielen = snssai.len;
ielen = 1;
// ielen = 1;
*(buffer + encoded) = ielen;
encoded++;
......@@ -56,9 +56,9 @@ int encode_snssai(SNSSAI snssai, uint8_t iei, uint8_t* buffer, uint32_t len) {
(ielen == SST_AND_SD_AND_MAPPEDHPLMNSST_LENGTH) ||
(ielen == SST_AND_SD_AND_MAPPEDHPLMNSST_AND_MAPPEDHPLMNSD_LENGTH)) {
bit32Stream = snssai.sd;
ENCODE_U8(buffer + encoded, (uint8_t) bit32Stream, encoded);
ENCODE_U8(buffer + encoded, (uint8_t)(bit32Stream >> 8), encoded);
ENCODE_U8(buffer + encoded, (uint8_t)(bit32Stream >> 16), encoded);
ENCODE_U8(buffer + encoded, (uint8_t)(bit32Stream >> 8), encoded);
ENCODE_U8(buffer + encoded, (uint8_t) bit32Stream, encoded);
}
if ((ielen == SST_AND_MAPPEDHPLMNSST_LENGTH) ||
......
......@@ -1646,7 +1646,10 @@ bool smf_app::get_session_management_subscription_data(
for (int i = 0; i < smf_cfg.num_session_management_subscription; i++) {
if ((0 == dnn.compare(smf_cfg.session_management_subscription[i].dnn)) and
(snssai.sST ==
smf_cfg.session_management_subscription[i].single_nssai.sST)) {
smf_cfg.session_management_subscription[i].single_nssai.sST) and
(0 ==
snssai.sD.compare(
smf_cfg.session_management_subscription[i].single_nssai.sD))) {
std::shared_ptr<dnn_configuration_t> dnn_configuration =
std::make_shared<dnn_configuration_t>();
......
......@@ -238,7 +238,7 @@ class smf_config {
std::string api_version;
} nrf_addr;
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 5
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 10
struct {
snssai_t single_nssai;
std::string session_type;
......
......@@ -207,7 +207,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
try {
sm_msg->pdu_session_establishment_accept.snssai.sd =
std::stoul(sm_context_res.get_snssai().sD, nullptr, 16);
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",
......
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