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
677695d0
Commit
677695d0
authored
Jun 01, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for SD with Standardized SST
parent
7a1510be
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
30 deletions
+42
-30
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+15
-12
src/common/amf.hpp
src/common/amf.hpp
+3
-0
src/ngap/ngapIEs/S-NSSAI.cpp
src/ngap/ngapIEs/S-NSSAI.cpp
+15
-12
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
+3
-2
src/ngap/ngapMsgs/NGSetupResponse.cpp
src/ngap/ngapMsgs/NGSetupResponse.cpp
+3
-2
src/ngap/ngapMsgs/RerouteNASRequest.cpp
src/ngap/ngapMsgs/RerouteNASRequest.cpp
+3
-2
No files found.
src/amf-app/amf_n2.cpp
View file @
677695d0
...
...
@@ -983,9 +983,8 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
supi
,
itti_msg
.
pdu_session_id
,
psc
))
{
Logger
::
amf_n2
().
warn
(
"Cannot get pdu_session_context with SUPI (%s)"
,
supi
.
c_str
());
// TODO: remove hardcoded value
item
.
s_nssai
.
sst
=
"01"
;
item
.
s_nssai
.
sd
=
"none"
;
item
.
s_nssai
.
sst
=
"01"
;
// TODO: remove the default value
item
.
s_nssai
.
sd
=
std
::
to_string
(
SD_NO_VALUE
);
}
else
{
item
.
s_nssai
.
sst
=
std
::
to_string
(
psc
.
get
()
->
snssai
.
sST
);
item
.
s_nssai
.
sd
=
psc
.
get
()
->
snssai
.
sD
;
...
...
@@ -1094,7 +1093,8 @@ void amf_n2::handle_itti_message(
Logger
::
amf_n2
().
warn
(
"Cannot get pdu_session_context with SUPI (%s)"
,
supi
.
c_str
());
item
.
s_nssai
.
sst
=
"01"
;
// TODO: get from N1N2msgTranferMsg
item
.
s_nssai
.
sd
=
"none"
;
// TODO: get from N1N2msgTranferMsg
item
.
s_nssai
.
sd
=
std
::
to_string
(
SD_NO_VALUE
);
// TODO: get from N1N2msgTranferMsg
}
else
{
item
.
s_nssai
.
sst
=
std
::
to_string
(
psc
.
get
()
->
snssai
.
sST
);
item
.
s_nssai
.
sd
=
psc
.
get
()
->
snssai
.
sD
;
...
...
@@ -2325,8 +2325,10 @@ bool amf_n2::get_common_plmn(
Logger
::
amf_n2
().
debug
(
"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
)
and
(
s1
.
sd
.
compare
(
std
::
to_string
(
s2
.
sd
))
==
0
))
{
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
Logger
::
amf_n2
().
debug
(
"Common S-NSSAI (SST %s, SD %s)"
,
s1
.
sst
.
c_str
(),
s1
.
sd
.
c_str
());
...
...
@@ -2335,6 +2337,7 @@ bool amf_n2::get_common_plmn(
}
}
}
}
item
.
b_plmn_list
.
push_back
(
plmn_slice_support_item
);
result
.
push_back
(
item
);
...
...
src/common/amf.hpp
View file @
677695d0
...
...
@@ -69,6 +69,9 @@ constexpr uint64_t SECONDS_SINCE_FIRST_EPOCH = 2208988800;
#define NAS_MESSAGE_DOWNLINK 1
#define NAS_MESSAGE_UPLINK 0
const
uint32_t
SD_NO_VALUE
=
0xFFFFFF
;
const
uint8_t
SST_MAX_STANDARDIZED_VALUE
=
127
;
typedef
enum
{
PlainNasMsg
=
0x0
,
IntegrityProtected
=
0x1
,
...
...
src/ngap/ngapIEs/S-NSSAI.cpp
View file @
677695d0
...
...
@@ -27,7 +27,7 @@
*/
#include "S-NSSAI.hpp"
#include "amf.hpp"
#include "String2Value.hpp"
using
namespace
std
;
...
...
@@ -38,7 +38,7 @@ namespace ngap {
S_NSSAI
::
S_NSSAI
()
{
sdIsSet
=
false
;
sst
=
0
;
sd
=
0
;
sd
=
SD_NO_VALUE
;
}
//------------------------------------------------------------------------------
...
...
@@ -116,13 +116,14 @@ void S_NSSAI::setSd(const uint32_t s) {
sdIsSet
=
true
;
sd
=
s
;
}
//------------------------------------------------------------------------------
bool
S_NSSAI
::
getSd
(
std
::
string
&
s_nssaiSd
)
const
{
if
(
sdIsSet
)
{
s_nssaiSd
=
to_string
(
sd
);
}
else
s_nssaiSd
=
"None"
;
}
else
{
s_nssaiSd
=
to_string
(
SD_NO_VALUE
)
;
}
return
sdIsSet
;
}
...
...
@@ -131,19 +132,19 @@ std::string S_NSSAI::getSd() const {
if
(
sdIsSet
)
{
return
to_string
(
sd
);
}
else
return
"None"
;
return
to_string
(
SD_NO_VALUE
)
;
}
//------------------------------------------------------------------------------
bool
S_NSSAI
::
encode2S_NSSAI
(
Ngap_S_NSSAI_t
*
s_NSSAI
)
{
if
(
!
sSTEncode2OctetString
(
s_NSSAI
->
sST
))
return
false
;
if
(
sdIsSet
)
{
Ngap_SD_t
*
sd
=
(
Ngap_SD_t
*
)
calloc
(
1
,
sizeof
(
Ngap_SD_t
));
if
(
!
sd
)
return
false
;
if
(
!
sDEncode2OctetString
(
sd
))
{
free
(
sd
);
if
(
sdIsSet
&&
(
sd
!=
SD_NO_VALUE
)
)
{
Ngap_SD_t
*
sd
_tmp
=
(
Ngap_SD_t
*
)
calloc
(
1
,
sizeof
(
Ngap_SD_t
));
if
(
!
sd
_tmp
)
return
false
;
if
(
!
sDEncode2OctetString
(
sd
_tmp
))
{
free
(
sd
_tmp
);
return
false
;
}
s_NSSAI
->
sD
=
sd
;
s_NSSAI
->
sD
=
sd
_tmp
;
}
return
true
;
}
...
...
@@ -154,6 +155,8 @@ bool S_NSSAI::decodefromS_NSSAI(Ngap_S_NSSAI_t* s_NSSAI) {
if
(
s_NSSAI
->
sD
)
{
sdIsSet
=
true
;
if
(
!
sDdecodefromOctetString
(
s_NSSAI
->
sD
))
return
false
;
}
else
{
sd
=
SD_NO_VALUE
;
}
return
true
;
}
...
...
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
View file @
677695d0
...
...
@@ -21,6 +21,7 @@
#include "InitialContextSetupRequest.hpp"
#include "logger.hpp"
#include "amf.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
...
...
@@ -289,8 +290,8 @@ 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
(
"None"
)
!=
0
)
&&
(
list
[
i
].
sd
.
compare
(
"none"
)
!=
0
)))
if
(
!
list
[
i
].
sd
.
empty
()
&&
((
list
[
i
].
sd
.
compare
(
std
::
to_string
(
SD_NO_VALUE
)
)
!=
0
)))
snssai
.
setSd
(
list
[
i
].
sd
);
snssaiList
.
push_back
(
snssai
);
}
...
...
src/ngap/ngapMsgs/NGSetupResponse.cpp
View file @
677695d0
...
...
@@ -21,6 +21,7 @@
#include "NGSetupResponse.hpp"
#include "logger.hpp"
#include "amf.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
...
...
@@ -138,8 +139,8 @@ void NGSetupResponseMsg::setPlmnSupportList(
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
(
"None"
)
!=
0
)
&&
(
list
[
i
].
slice_list
[
j
].
sd
.
compare
(
"none"
)
!=
0
))
{
(
list
[
i
].
slice_list
[
j
].
sd
.
compare
(
std
::
to_string
(
SD_NO_VALUE
))
!=
0
))
{
snssai
.
setSd
(
list
[
i
].
slice_list
[
j
].
sd
);
}
snssais
.
push_back
(
snssai
);
...
...
src/ngap/ngapMsgs/RerouteNASRequest.cpp
View file @
677695d0
...
...
@@ -21,6 +21,7 @@
#include "RerouteNASRequest.hpp"
#include "common_defs.h"
#include "amf.hpp"
#include "logger.hpp"
...
...
@@ -110,8 +111,8 @@ 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
(
"None"
)
!=
0
)
&&
(
list
[
i
].
sd
.
compare
(
"none"
)
!=
0
)))
if
(
!
list
[
i
].
sd
.
empty
()
&&
((
list
[
i
].
sd
.
compare
(
std
::
to_string
(
SD_NO_VALUE
)
)
!=
0
)))
snssai
.
setSd
(
list
[
i
].
sd
);
snssaiList
.
push_back
(
snssai
);
}
...
...
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