Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
53be2cc0
Commit
53be2cc0
authored
Jun 30, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_sd_log' into 'develop'
Fix sd log See merge request oai/cn5g/oai-cn5g-amf!132
parents
306af566
319f474f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
119 additions
and
74 deletions
+119
-74
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+13
-23
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+3
-2
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+21
-22
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+7
-5
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+3
-3
src/common/conversions.cpp
src/common/conversions.cpp
+24
-0
src/common/conversions.hpp
src/common/conversions.hpp
+1
-0
src/nas/ies/NSSAI.cpp
src/nas/ies/NSSAI.cpp
+14
-9
src/nas/ies/NSSAI.hpp
src/nas/ies/NSSAI.hpp
+3
-0
src/ngap/ngapIEs/S-NSSAI.cpp
src/ngap/ngapIEs/S-NSSAI.cpp
+10
-0
src/ngap/ngapIEs/S-NSSAI.hpp
src/ngap/ngapIEs/S-NSSAI.hpp
+1
-0
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
+6
-3
src/ngap/ngapMsgs/NGSetupResponse.cpp
src/ngap/ngapMsgs/NGSetupResponse.cpp
+6
-4
src/ngap/ngapMsgs/RerouteNASRequest.cpp
src/ngap/ngapMsgs/RerouteNASRequest.cpp
+7
-3
No files found.
src/amf-app/amf_config.cpp
View file @
53be2cc0
...
...
@@ -41,6 +41,7 @@
#include "string.hpp"
#include "thread_sched.hpp"
#include "fqdn.hpp"
#include "conversions.hpp"
extern
"C"
{
#include <arpa/inet.h>
...
...
@@ -226,16 +227,14 @@ int amf_config::load(const std::string& config_file) {
std
::
string
sd
=
{};
slice_item
.
lookupValue
(
AMF_CONFIG_STRING_SST
,
sst
);
slice_item
.
lookupValue
(
AMF_CONFIG_STRING_SD
,
sd
);
slice
.
sd
=
SD_NO_VALUE
;
// Default value
try
{
slice
.
sst
=
std
::
stoi
(
sst
);
slice
.
sd
=
SD_NO_VALUE
;
// Default value
// Get SD if available for non standardized SST
if
(
slice
.
sst
>
SST_MAX_STANDARDIZED_VALUE
)
{
if
(
!
sd
.
empty
())
slice
.
sd
=
std
::
stoi
(
sd
);
}
conv
::
sd_string_to_int
(
sd
,
slice
.
sd
);
}
catch
(
const
std
::
exception
&
err
)
{
Logger
::
amf_app
().
error
(
"Invalid SST/SD"
);
}
plmn_item
.
slice_list
.
push_back
(
slice
);
}
plmn_list
.
push_back
(
plmn_item
);
...
...
@@ -713,24 +712,15 @@ void amf_config::display() {
Logger
::
config
().
info
(
" TAC ...................: %d"
,
plmn_list
[
i
].
tac
);
Logger
::
config
().
info
(
" Slice Support .........:"
);
for
(
int
j
=
0
;
j
<
plmn_list
[
i
].
slice_list
.
size
();
j
++
)
{
std
::
string
str
=
{};
str
=
str
.
append
(
" SST"
)
.
append
(
(
plmn_list
[
i
].
slice_list
[
j
].
sst
>
SST_MAX_STANDARDIZED_VALUE
&&
(
plmn_list
[
i
].
slice_list
[
j
].
sd
!=
SD_NO_VALUE
))
?
", SD "
:
" ...."
)
.
append
(
"...........: "
)
.
append
(
std
::
to_string
(
plmn_list
[
i
].
slice_list
[
j
].
sst
))
.
append
(
""
)
.
append
(
(
plmn_list
[
i
].
slice_list
[
j
].
sst
>
SST_MAX_STANDARDIZED_VALUE
&&
(
plmn_list
[
i
].
slice_list
[
j
].
sd
!=
SD_NO_VALUE
))
?
", "
+
std
::
to_string
(
plmn_list
[
i
].
slice_list
[
j
].
sd
)
:
" "
);
Logger
::
config
().
info
(
str
.
c_str
());
if
(
plmn_list
[
i
].
slice_list
[
j
].
sd
!=
SD_NO_VALUE
)
{
Logger
::
config
().
info
(
" SST, SD ...........: %d, %ld (0x%x)"
,
plmn_list
[
i
].
slice_list
[
j
].
sst
,
plmn_list
[
i
].
slice_list
[
j
].
sd
,
plmn_list
[
i
].
slice_list
[
j
].
sd
);
}
else
{
Logger
::
config
().
info
(
" SST ...............: %d"
,
plmn_list
[
i
].
slice_list
[
j
].
sst
);
}
}
}
Logger
::
config
().
info
(
...
...
src/amf-app/amf_config.hpp
View file @
53be2cc0
...
...
@@ -254,14 +254,15 @@ typedef struct slice_s {
nlohmann
::
json
to_json
()
const
{
nlohmann
::
json
json_data
=
{};
json_data
[
"sst"
]
=
this
->
sst
;
if
(
sst
>
SST_MAX_STANDARDIZED
_VALUE
)
json_data
[
"sd"
]
=
this
->
sd
;
if
(
this
->
sd
!=
SD_NO
_VALUE
)
json_data
[
"sd"
]
=
this
->
sd
;
return
json_data
;
}
void
from_json
(
nlohmann
::
json
&
json_data
)
{
this
->
sst
=
json_data
[
"sst"
].
get
<
int
>
();
if
(
this
->
sst
>
SST_MAX_STANDARDIZED_VALUE
)
if
(
json_data
.
find
(
"sd"
)
!=
json_data
.
end
())
{
this
->
sd
=
json_data
[
"sd"
].
get
<
int
>
();
}
}
}
slice_t
;
...
...
src/amf-app/amf_n1.cpp
View file @
53be2cc0
...
...
@@ -3766,10 +3766,11 @@ void amf_n1::initialize_registration_accept(
for
(
auto
s
:
p
.
slice_list
)
{
SNSSAI_t
snssai
=
{};
snssai
.
sst
=
s
.
sst
;
snssai
.
sd
=
SD_NO_VALUE
;
// Default value
// Get SD if available for non standardized SST
if
(
s
.
sst
>
SST_MAX_STANDARDIZED_VALUE
)
{
snssai
.
sd
=
s
.
sd
;
snssai
.
sd
=
s
.
sd
;
if
(
snssai
.
sd
==
SD_NO_VALUE
)
{
snssai
.
length
=
SST_LENGTH
;
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
nssai
.
push_back
(
snssai
);
}
...
...
@@ -4139,7 +4140,7 @@ bool amf_n1::check_requested_nssai(const std::shared_ptr<nas_context>& nc) {
for
(
auto
s
:
p
.
slice_list
)
{
std
::
string
sd
=
std
::
to_string
(
s
.
sd
);
if
(
s
.
sst
==
n
.
sst
)
{
if
(
(
s
.
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
(
s
.
sd
==
n
.
sd
)
)
{
if
(
s
.
sd
==
n
.
sd
)
{
found_nssai
=
true
;
Logger
::
amf_n1
().
debug
(
"Found S-NSSAI (SST %d, SD %d)"
,
s
.
sst
,
n
.
sd
);
...
...
@@ -4187,16 +4188,16 @@ bool amf_n1::check_subscribed_nssai(
"NSSAIs"
);
std
::
vector
<
oai
::
amf
::
model
::
Snssai
>
common_snssais
;
for
(
auto
s
:
nc
->
requestedNssai
)
{
std
::
string
sd
=
std
::
to_string
(
s
.
sd
);
//
std::string sd = std::to_string(s.sd);
// Check with default subscribed NSSAIs
for
(
auto
n
:
nssai
.
getDefaultSingleNssais
())
{
if
(
s
.
sst
==
n
.
getSst
())
{
if
((
s
.
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
(
n
.
sdIsSet
()
and
(
n
.
getSd
().
compare
(
sd
)
==
0
))
or
(
!
n
.
sdIsSet
()
and
sd
.
empty
())
)
{
uint32_t
sd
=
SD_NO_VALUE
;
conv
::
sd_string_to_int
(
n
.
getSd
(),
sd
);
if
(
sd
==
s
.
sd
)
{
common_snssais
.
push_back
(
n
);
Logger
::
amf_n1
().
debug
(
"Common S-NSSAI (SST %d, SD %
s)"
,
s
.
sst
,
sd
.
c_str
()
);
"Common S-NSSAI (SST %d, SD %
ld)"
,
s
.
sst
,
sd
);
break
;
}
}
...
...
@@ -4205,12 +4206,12 @@ bool amf_n1::check_subscribed_nssai(
// check with other subscribed NSSAIs
for
(
auto
n
:
nssai
.
getSingleNssais
())
{
if
(
s
.
sst
==
n
.
getSst
())
{
if
((
s
.
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
(
n
.
sdIsSet
()
and
(
n
.
getSd
().
compare
(
sd
)
==
0
))
or
(
!
n
.
sdIsSet
()
and
sd
.
empty
())
)
{
uint32_t
sd
=
SD_NO_VALUE
;
conv
::
sd_string_to_int
(
n
.
getSd
(),
sd
);
if
(
sd
==
s
.
sd
)
{
common_snssais
.
push_back
(
n
);
Logger
::
amf_n1
().
debug
(
"Common S-NSSAI (SST %d, SD %
s)"
,
s
.
sst
,
sd
.
c_str
()
);
"Common S-NSSAI (SST %d, SD %
ld)"
,
s
.
sst
,
sd
);
break
;
}
}
...
...
@@ -4225,11 +4226,10 @@ bool amf_n1::check_subscribed_nssai(
for
(
auto
n
:
nssai
.
getDefaultSingleNssais
())
{
bool
found_nssai
=
false
;
for
(
auto
s
:
p
.
slice_list
)
{
std
::
string
sd
=
std
::
to_string
(
s
.
sd
);
if
(
s
.
sst
==
n
.
getSst
())
{
if
((
s
.
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
(
n
.
sdIsSet
()
and
(
n
.
getSd
().
compare
(
sd
)
==
0
))
or
(
!
n
.
sdIsSet
()
and
sd
.
empty
())
)
{
uint32_t
sd
=
SD_NO_VALUE
;
conv
::
sd_string_to_int
(
n
.
getSd
(),
sd
);
if
(
sd
==
s
.
sd
)
{
found_nssai
=
true
;
Logger
::
amf_n1
().
debug
(
"Found S-NSSAI (SST %d, SD %s)"
,
s
.
sst
,
n
.
getSd
().
c_str
());
...
...
@@ -4248,11 +4248,10 @@ bool amf_n1::check_subscribed_nssai(
for
(
auto
n
:
common_snssais
)
{
bool
found_nssai
=
false
;
for
(
auto
s
:
p
.
slice_list
)
{
std
::
string
sd
=
std
::
to_string
(
s
.
sd
);
if
(
s
.
sst
==
n
.
getSst
())
{
if
((
s
.
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
(
n
.
sdIsSet
()
and
(
n
.
getSd
().
compare
(
sd
)
==
0
))
or
(
!
n
.
sdIsSet
()
and
sd
.
empty
())
)
{
uint32_t
sd
=
SD_NO_VALUE
;
conv
::
sd_string_to_int
(
n
.
getSd
(),
sd
);
if
(
sd
==
s
.
sd
)
{
found_nssai
=
true
;
Logger
::
amf_n1
().
debug
(
"Found S-NSSAI (SST %d, SD %s)"
,
s
.
sst
,
n
.
getSd
().
c_str
());
...
...
src/amf-app/amf_n11.cpp
View file @
53be2cc0
...
...
@@ -893,13 +893,15 @@ bool amf_n11::discover_smf(
for
(
auto
&
s
:
instance_json
[
"sNssais"
].
items
())
{
nlohmann
::
json
Snssai
=
s
.
value
();
int
sst
=
0
;
std
::
string
sd
=
{};
uint32_t
sd
=
SD_NO_VALUE
;
// Default value
if
(
Snssai
.
count
(
"sst"
)
>
0
)
sst
=
Snssai
[
"sst"
].
get
<
int
>
();
if
(
Snssai
.
count
(
"sd"
)
>
0
)
sd
=
Snssai
[
"sd"
].
get
<
string
>
();
if
(
Snssai
.
count
(
"sd"
)
>
0
)
{
conv
::
sd_string_to_int
(
Snssai
[
"sd"
].
get
<
string
>
(),
sd
);
}
if
(
sst
==
snssai
.
sST
)
{
// Match SD (optional) only if it is provided
if
((
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
sd
.
empty
()
or
(
snssai
.
sD
.
compare
(
sd
)
==
0
)
)
{
uint32_t
input_sd
=
SD_NO_VALUE
;
// Default value
conv
::
sd_string_to_int
(
snssai
.
sD
,
input_sd
);
if
(
sd
==
input_sd
)
{
Logger
::
amf_n11
().
debug
(
"S-NSSAI [SST- %d, SD -%s] is matched for SMF profile"
,
snssai
.
sST
,
snssai
.
sD
.
c_str
());
...
...
src/amf-app/amf_n2.cpp
View file @
53be2cc0
...
...
@@ -2326,9 +2326,9 @@ bool amf_n2::get_common_plmn(
"S-NSSAI from AMF (SST %d, SD %s)"
,
s2
.
sst
,
std
::
to_string
(
s2
.
sd
).
c_str
());
if
(
s1
.
sst
.
compare
(
std
::
to_string
(
s2
.
sst
))
==
0
)
{
if
((
s2
.
sst
<=
SST_MAX_STANDARDIZED_VALUE
)
or
(
s1
.
sd
.
compare
(
std
::
to_string
(
s2
.
sd
))
==
0
))
{
// don't need to check SD for standard NSSAI
uint32_t
s1_sd
=
SD_NO_VALUE
;
conv
::
sd_string_to_int
(
s1
.
sd
,
s1_sd
);
if
(
s1_sd
==
s2
.
sd
)
{
Logger
::
amf_n2
().
debug
(
"Common S-NSSAI (SST %s, SD %s)"
,
s1
.
sst
.
c_str
(),
s1
.
sd
.
c_str
());
...
...
src/common/conversions.cpp
View file @
53be2cc0
...
...
@@ -26,12 +26,16 @@
*/
#include "conversions.hpp"
#include "amf.hpp"
#include "logger.hpp"
#include <arpa/inet.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <boost/algorithm/string.hpp>
static
const
char
hex_to_ascii_table
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
...
...
@@ -262,3 +266,23 @@ void conv::octet_string_2_bstring(
void
conv
::
bstring_2_octet_string
(
bstring
&
b_str
,
OCTET_STRING_t
&
octet_str
)
{
OCTET_STRING_fromBuf
(
&
octet_str
,
(
char
*
)
bdata
(
b_str
),
blength
(
b_str
));
}
//------------------------------------------------------------------------------
void
conv
::
sd_string_to_int
(
const
std
::
string
&
sd_str
,
uint32_t
&
sd
)
{
sd
=
SD_NO_VALUE
;
if
(
sd_str
.
empty
())
return
;
uint8_t
base
=
10
;
try
{
if
(
sd_str
.
size
()
>
2
)
{
if
(
boost
::
iequals
(
sd_str
.
substr
(
0
,
2
),
"0x"
))
{
base
=
16
;
}
}
sd
=
std
::
stoul
(
sd_str
,
nullptr
,
base
);
}
catch
(
const
std
::
exception
&
e
)
{
Logger
::
amf_app
().
error
(
"Error when converting from string to int for S-NSSAI SD, error: %s"
,
e
.
what
());
sd
=
SD_NO_VALUE
;
}
}
src/common/conversions.hpp
View file @
53be2cc0
...
...
@@ -73,5 +73,6 @@ class conv {
std
::
string
&
input_str
,
std
::
string
&
output_str
);
void
octet_string_2_bstring
(
const
OCTET_STRING_t
&
octet_str
,
bstring
&
b_str
);
void
bstring_2_octet_string
(
bstring
&
b_str
,
OCTET_STRING_t
&
octet_str
);
static
void
sd_string_to_int
(
const
std
::
string
&
sd_str
,
uint32_t
&
sd
);
};
#endif
/* FILE_CONVERSIONS_HPP_SEEN */
src/nas/ies/NSSAI.cpp
View file @
53be2cc0
...
...
@@ -49,9 +49,9 @@ NSSAI::NSSAI(const uint8_t iei, std::vector<struct SNSSAI_s> nssai) {
S_NSSAI
.
assign
(
nssai
.
begin
(),
nssai
.
end
());
for
(
int
i
=
0
;
i
<
nssai
.
size
();
i
++
)
{
length
+=
2
;
// 1 for IEI and 1 for sst
if
(
nssai
[
i
].
sd
!=
SD_NO_VALUE
)
length
+=
3
;
if
(
nssai
[
i
].
mHplmnSst
!=
-
1
)
length
+=
1
;
if
(
nssai
[
i
].
mHplmnSd
!=
SD_NO_VALUE
)
length
+=
3
;
if
(
nssai
[
i
].
sd
!=
SD_NO_VALUE
)
length
+=
SD_LENGTH
;
if
(
nssai
[
i
].
mHplmnSst
!=
-
1
)
length
+=
SST_LENGTH
;
if
(
nssai
[
i
].
mHplmnSd
!=
SD_NO_VALUE
)
length
+=
SD_LENGTH
;
}
}
...
...
@@ -84,12 +84,12 @@ int NSSAI::encode2buffer(uint8_t* buf, int len) {
encoded_size
++
;
for
(
int
i
=
0
;
i
<
S_NSSAI
.
size
();
i
++
)
{
int
len_s_nssai
=
1
;
int
len_s_nssai
=
SST_LENGTH
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
S_NSSAI
.
at
(
i
).
sst
;
encoded_size
++
;
if
(
S_NSSAI
.
at
(
i
).
sd
!=
SD_NO_VALUE
)
{
len_s_nssai
+=
3
;
len_s_nssai
+=
SD_LENGTH
;
*
(
buf
+
encoded_size
)
=
(
S_NSSAI
.
at
(
i
).
sd
&
0x00ff0000
)
>>
16
;
encoded_size
++
;
Logger
::
nas_mm
().
debug
(
...
...
@@ -104,12 +104,12 @@ int NSSAI::encode2buffer(uint8_t* buf, int len) {
"Encoded NSSAI SD third octet (%x)"
,
*
(
buf
+
encoded_size
-
1
));
}
if
(
S_NSSAI
.
at
(
i
).
mHplmnSst
!=
-
1
)
{
len_s_nssai
+=
1
;
len_s_nssai
+=
SST_LENGTH
;
*
(
buf
+
encoded_size
)
=
S_NSSAI
.
at
(
i
).
mHplmnSst
;
encoded_size
++
;
}
if
(
S_NSSAI
.
at
(
i
).
mHplmnSd
!=
SD_NO_VALUE
)
{
len_s_nssai
+=
3
;
len_s_nssai
+=
SD_LENGTH
;
*
(
buf
+
encoded_size
)
=
(
S_NSSAI
.
at
(
i
).
mHplmnSd
&
0x00ff0000
)
>>
16
;
encoded_size
++
;
*
(
buf
+
encoded_size
)
=
(
S_NSSAI
.
at
(
i
).
mHplmnSd
&
0x0000ff00
)
>>
8
;
...
...
@@ -138,10 +138,13 @@ int NSSAI::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
length
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
int
length_tmp
=
length
;
a
.
sd
=
SD_NO_VALUE
;
// Default value
a
.
mHplmnSd
=
SD_NO_VALUE
;
// Default value
while
(
length_tmp
)
{
switch
(
*
(
buf
+
decoded_size
))
{
case
1
:
{
decoded_size
++
;
// snssai—le
a
gth
decoded_size
++
;
// snssai—le
n
gth
length_tmp
--
;
a
.
sst
=
*
(
buf
+
decoded_size
);
decoded_size
++
;
...
...
@@ -227,7 +230,9 @@ int NSSAI::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
}
S_NSSAI
.
insert
(
S_NSSAI
.
end
(),
a
);
a
=
{
0
,
0
,
0
,
0
};
a
=
{
0
,
0
,
0
,
0
};
a
.
sd
=
SD_NO_VALUE
;
// Default value
a
.
mHplmnSd
=
SD_NO_VALUE
;
// Default value
}
for
(
int
i
=
0
;
i
<
S_NSSAI
.
size
();
i
++
)
{
...
...
src/nas/ies/NSSAI.hpp
View file @
53be2cc0
...
...
@@ -33,6 +33,9 @@
#include <vector>
#include "nas_ie_header.hpp"
#define SST_LENGTH 1
#define SD_LENGTH 3
namespace
nas
{
class
NSSAI
{
...
...
src/ngap/ngapIEs/S-NSSAI.cpp
View file @
53be2cc0
...
...
@@ -127,6 +127,16 @@ bool S_NSSAI::getSd(std::string& s_nssaiSd) const {
return
sdIsSet
;
}
//------------------------------------------------------------------------------
bool
S_NSSAI
::
getSd
(
uint32_t
&
s_nssaiSd
)
const
{
if
(
sdIsSet
)
{
s_nssaiSd
=
sd
;
}
else
{
s_nssaiSd
=
SD_NO_VALUE
;
}
return
sdIsSet
;
}
//------------------------------------------------------------------------------
std
::
string
S_NSSAI
::
getSd
()
const
{
if
(
sdIsSet
)
{
...
...
src/ngap/ngapIEs/S-NSSAI.hpp
View file @
53be2cc0
...
...
@@ -55,6 +55,7 @@ class S_NSSAI {
void
setSd
(
const
uint32_t
s
);
bool
getSd
(
std
::
string
&
s_nssaiSd
)
const
;
std
::
string
getSd
()
const
;
bool
getSd
(
uint32_t
&
s_nssaiSd
)
const
;
bool
encode2S_NSSAI
(
Ngap_S_NSSAI_t
*
);
bool
decodefromS_NSSAI
(
Ngap_S_NSSAI_t
*
);
...
...
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
View file @
53be2cc0
...
...
@@ -22,6 +22,7 @@
#include "InitialContextSetupRequest.hpp"
#include "logger.hpp"
#include "amf.hpp"
#include "conversions.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
...
...
@@ -290,9 +291,11 @@ void InitialContextSetupRequestMsg::setAllowedNssai(
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
S_NSSAI
snssai
=
{};
snssai
.
setSst
(
list
[
i
].
sst
);
if
(
!
list
[
i
].
sd
.
empty
()
&&
((
list
[
i
].
sd
.
compare
(
std
::
to_string
(
SD_NO_VALUE
))
!=
0
)))
snssai
.
setSd
(
list
[
i
].
sd
);
uint32_t
sd
=
SD_NO_VALUE
;
if
(
!
list
[
i
].
sd
.
empty
())
{
conv
::
sd_string_to_int
(
list
[
i
].
sd
,
sd
);
}
snssai
.
setSd
(
sd
);
snssaiList
.
push_back
(
snssai
);
}
allowedNssai
.
setAllowedNSSAI
(
snssaiList
);
...
...
src/ngap/ngapMsgs/NGSetupResponse.cpp
View file @
53be2cc0
...
...
@@ -22,6 +22,7 @@
#include "NGSetupResponse.hpp"
#include "logger.hpp"
#include "amf.hpp"
#include "conversions.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
...
...
@@ -138,11 +139,12 @@ void NGSetupResponseMsg::setPlmnSupportList(
for
(
int
j
=
0
;
j
<
list
[
i
].
slice_list
.
size
();
j
++
)
{
S_NSSAI
snssai
=
{};
snssai
.
setSst
(
list
[
i
].
slice_list
[
j
].
sst
);
if
(
!
list
[
i
].
slice_list
[
j
].
sd
.
empty
()
&&
(
list
[
i
].
slice_list
[
j
].
sd
.
compare
(
std
::
to_string
(
SD_NO_VALUE
))
!=
0
))
{
snssai
.
setSd
(
list
[
i
].
slice_list
[
j
].
sd
);
uint32_t
sd
=
SD_NO_VALUE
;
if
(
!
list
[
i
].
slice_list
[
j
].
sd
.
empty
(
))
{
conv
::
sd_string_to_int
(
list
[
i
].
slice_list
[
j
].
sd
,
sd
);
}
snssai
.
setSd
(
sd
);
snssais
.
push_back
(
snssai
);
}
plmnSupportItem
.
setPlmnSliceSupportList
(
plmn
,
snssais
);
...
...
src/ngap/ngapMsgs/RerouteNASRequest.cpp
View file @
53be2cc0
...
...
@@ -22,6 +22,7 @@
#include "RerouteNASRequest.hpp"
#include "common_defs.h"
#include "amf.hpp"
#include "conversions.hpp"
#include "logger.hpp"
...
...
@@ -111,9 +112,12 @@ void RerouteNASRequest::setAllowedNssai(const std::vector<S_Nssai>& list) {
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
S_NSSAI
snssai
=
{};
snssai
.
setSst
(
list
[
i
].
sst
);
if
(
!
list
[
i
].
sd
.
empty
()
&&
((
list
[
i
].
sd
.
compare
(
std
::
to_string
(
SD_NO_VALUE
))
!=
0
)))
snssai
.
setSd
(
list
[
i
].
sd
);
uint32_t
sd
=
SD_NO_VALUE
;
if
(
!
list
[
i
].
sd
.
empty
())
{
conv
::
sd_string_to_int
(
list
[
i
].
sd
,
sd
);
}
snssai
.
setSd
(
sd
);
snssaiList
.
push_back
(
snssai
);
}
allowedNssai
->
setAllowedNSSAI
(
snssaiList
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment