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
a2c23916
Commit
a2c23916
authored
Apr 12, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with NSSAI
parent
84a6185b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
10 deletions
+52
-10
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+52
-10
No files found.
src/amf-app/amf_n2.cpp
View file @
a2c23916
...
@@ -703,12 +703,23 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
...
@@ -703,12 +703,23 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
0xe000
);
// TODO: remove hardcoded value
0xe000
);
// TODO: remove hardcoded value
msg
->
setSecurityKey
((
uint8_t
*
)
bdata
(
itti_msg
.
kgnb
));
msg
->
setSecurityKey
((
uint8_t
*
)
bdata
(
itti_msg
.
kgnb
));
msg
->
setNasPdu
((
uint8_t
*
)
bdata
(
itti_msg
.
nas
),
blength
(
itti_msg
.
nas
));
msg
->
setNasPdu
((
uint8_t
*
)
bdata
(
itti_msg
.
nas
),
blength
(
itti_msg
.
nas
));
// TODO: get the allowed NSSAIs from conf file
std
::
vector
<
S_Nssai
>
list
;
std
::
vector
<
S_Nssai
>
list
;
S_Nssai
item
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
item
.
sst
=
"01"
;
for
(
auto
s
:
p
.
slice_list
)
{
item
.
sd
=
"None"
;
S_Nssai
item
;
list
.
push_back
(
item
);
item
.
sst
=
s
.
sST
;
item
.
sd
=
s
.
sD
;
list
.
push_back
(
item
);
}
}
// std::vector<S_Nssai> list;
/* S_Nssai item;
item.sst = "01";
item.sd = "None";
list.push_back(item);
*/
msg
->
setAllowedNssai
(
list
);
msg
->
setAllowedNssai
(
list
);
bdestroy
(
itti_msg
.
nas
);
bdestroy
(
itti_msg
.
nas
);
bdestroy
(
itti_msg
.
kgnb
);
bdestroy
(
itti_msg
.
kgnb
);
...
@@ -724,9 +735,37 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
...
@@ -724,9 +735,37 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
if
(
itti_msg
.
is_pdu_exist
)
{
if
(
itti_msg
.
is_pdu_exist
)
{
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
;
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
;
PDUSessionResourceSetupRequestItem_t
item
;
PDUSessionResourceSetupRequestItem_t
item
;
item
.
pduSessionId
=
itti_msg
.
pdu_session_id
;
item
.
pduSessionId
=
itti_msg
.
pdu_session_id
;
item
.
s_nssai
.
sst
=
"01"
;
item
.
s_nssai
.
sd
=
"None"
;
// Get NSSAI from PDU Session Context
std
::
shared_ptr
<
nas_context
>
nc
;
if
(
amf_n1_inst
->
is_amf_ue_id_2_nas_context
(
itti_msg
.
amf_ue_ngap_id
))
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
itti_msg
.
amf_ue_ngap_id
);
else
{
Logger
::
amf_n2
().
warn
(
"No existed nas_context with amf_ue_ngap_id(0x%x)"
,
itti_msg
.
amf_ue_ngap_id
);
// TODO:
}
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n2
().
debug
(
"SUPI (%s)"
,
supi
.
c_str
());
std
::
shared_ptr
<
pdu_session_context
>
psc
;
if
(
!
amf_app_inst
->
find_pdu_session_context
(
supi
,
itti_msg
.
pdu_session_id
,
psc
))
{
Logger
::
amf_n2
().
warn
(
"Cannot get pdu_session_context with SUPI (%s)"
,
supi
.
c_str
());
item
.
s_nssai
.
sst
=
"01"
;
item
.
s_nssai
.
sd
=
"None"
;
}
else
{
item
.
s_nssai
.
sst
=
std
::
to_string
(
psc
.
get
()
->
snssai
.
sST
);
item
.
s_nssai
.
sd
=
psc
.
get
()
->
snssai
.
sD
;
}
Logger
::
amf_n2
().
debug
(
"S_NSSAI (SST, SD) %s, %s"
,
item
.
s_nssai
.
sst
.
c_str
(),
item
.
s_nssai
.
sd
.
c_str
());
item
.
pduSessionNAS_PDU
=
NULL
;
item
.
pduSessionNAS_PDU
=
NULL
;
if
(
itti_msg
.
isn2sm_avaliable
)
{
if
(
itti_msg
.
isn2sm_avaliable
)
{
bstring
n2sm
=
itti_msg
.
n2sm
;
bstring
n2sm
=
itti_msg
.
n2sm
;
...
@@ -784,8 +823,6 @@ void amf_n2::handle_itti_message(
...
@@ -784,8 +823,6 @@ void amf_n2::handle_itti_message(
nas_pdu
[
blength
(
itti_msg
.
nas
)]
=
'\0'
;
nas_pdu
[
blength
(
itti_msg
.
nas
)]
=
'\0'
;
item
.
pduSessionNAS_PDU
=
nas_pdu
;
item
.
pduSessionNAS_PDU
=
nas_pdu
;
item
.
sizeofpduSessionNAS_PDU
=
blength
(
itti_msg
.
nas
);
item
.
sizeofpduSessionNAS_PDU
=
blength
(
itti_msg
.
nas
);
item
.
s_nssai
.
sst
=
"01"
;
// TODO: get from N1N2msgTranferMsg
item
.
s_nssai
.
sd
=
"none"
;
// TODO: get from N1N2msgTranferMsg
// Get NSSAI from PDU Session Context
// Get NSSAI from PDU Session Context
std
::
shared_ptr
<
nas_context
>
nc
;
std
::
shared_ptr
<
nas_context
>
nc
;
...
@@ -805,6 +842,11 @@ void amf_n2::handle_itti_message(
...
@@ -805,6 +842,11 @@ void amf_n2::handle_itti_message(
supi
,
itti_msg
.
pdu_session_id
,
psc
))
{
supi
,
itti_msg
.
pdu_session_id
,
psc
))
{
Logger
::
amf_n2
().
warn
(
Logger
::
amf_n2
().
warn
(
"Cannot get pdu_session_context with SUPI (%s)"
,
supi
.
c_str
());
"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
}
else
{
item
.
s_nssai
.
sst
=
std
::
to_string
(
psc
.
get
()
->
snssai
.
sST
);
item
.
s_nssai
.
sd
=
psc
.
get
()
->
snssai
.
sD
;
}
}
// item.s_nssai.sst = std::to_string(psc.get()->snssai.sST);
// item.s_nssai.sst = std::to_string(psc.get()->snssai.sST);
...
...
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