Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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-SMF
Commits
02426169
Commit
02426169
authored
Sep 24, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue after merging
parent
1a1dd6ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
44 deletions
+16
-44
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+16
-44
No files found.
src/smf_app/smf_context.cpp
View file @
02426169
...
@@ -1376,7 +1376,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1376,7 +1376,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
std
::
shared_ptr
<
dnn_configuration_t
>
sdc
=
{};
std
::
shared_ptr
<
dnn_configuration_t
>
sdc
=
{};
find_dnn_subscription
(
snssai
,
ss
);
find_dnn_subscription
(
snssai
,
ss
);
if
(
nullptr
!=
ss
.
get
())
{
if
(
nullptr
!=
ss
.
get
())
{
ss
.
get
()
->
find_dnn_configuration
(
sd
->
dnn_in_use
,
sdc
);
ss
.
get
()
->
find_dnn_configuration
(
dnn
,
sdc
);
if
(
nullptr
!=
sdc
.
get
())
{
if
(
nullptr
!=
sdc
.
get
())
{
paa
.
pdu_session_type
.
pdu_session_type
=
paa
.
pdu_session_type
.
pdu_session_type
=
sdc
.
get
()
sdc
.
get
()
...
@@ -1427,8 +1427,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1427,8 +1427,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
// TODO: use requested PDU Session Type?
// TODO: use requested PDU Session Type?
// paa.pdu_session_type.pdu_session_type = PDU_SESSION_TYPE_E_IPV4V6;
// paa.pdu_session_type.pdu_session_type = PDU_SESSION_TYPE_E_IPV4V6;
if
((
not
paa_static_ip
)
||
(
not
paa
.
is_ip_assigned
()))
{
if
((
not
paa_static_ip
)
||
(
not
paa
.
is_ip_assigned
()))
{
bool
success
=
bool
success
=
paa_dynamic
::
get_instance
().
get_free_paa
(
dnn
,
paa
);
paa_dynamic
::
get_instance
().
get_free_paa
(
sd
->
dnn_in_use
,
paa
);
if
(
success
)
{
if
(
success
)
{
set_paa
=
true
;
set_paa
=
true
;
}
else
{
}
else
{
...
@@ -1457,8 +1456,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1457,8 +1456,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
if
(
!
pco_ids
.
ci_ipv4_address_allocation_via_dhcpv4
)
{
if
(
!
pco_ids
.
ci_ipv4_address_allocation_via_dhcpv4
)
{
// use SM NAS signalling
// use SM NAS signalling
if
((
not
paa_static_ip
)
||
(
not
paa
.
is_ip_assigned
()))
{
if
((
not
paa_static_ip
)
||
(
not
paa
.
is_ip_assigned
()))
{
bool
success
=
bool
success
=
paa_dynamic
::
get_instance
().
get_free_paa
(
dnn
,
paa
);
paa_dynamic
::
get_instance
().
get_free_paa
(
sd
->
dnn_in_use
,
paa
);
if
(
success
)
{
if
(
success
)
{
set_paa
=
true
;
set_paa
=
true
;
}
else
{
}
else
{
...
@@ -3820,22 +3818,9 @@ void smf_context::handle_ue_ip_change(scid_t scid, uint8_t http_version) {
...
@@ -3820,22 +3818,9 @@ void smf_context::handle_ue_ip_change(scid_t scid, uint8_t http_version) {
supi64
);
supi64
);
}
}
// get dnn context
std
::
shared_ptr
<
dnn_context
>
sd
=
{};
if
(
!
sc
.
get
()
->
find_dnn_context
(
scf
.
get
()
->
nssai
,
scf
.
get
()
->
dnn
,
sd
))
{
if
(
nullptr
==
sd
.
get
())
{
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding DNN context!"
);
return
;
}
}
// get smf_pdu_session
// get smf_pdu_session
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
bool
find_pdn
=
sd
.
get
()
->
find_pdu_session
(
pdu_session_id
,
sp
);
if
(
!
find_pdu_session
(
pdu_session_id
,
sp
))
{
if
(
nullptr
==
sp
.
get
())
{
Logger
::
smf_app
().
warn
(
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding SMF PDU Session context!"
);
"Could not retrieve the corresponding SMF PDU Session context!"
);
return
;
return
;
...
@@ -3941,22 +3926,10 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
...
@@ -3941,22 +3926,10 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
"Supi "
SUPI_64_FMT
"!"
,
"Supi "
SUPI_64_FMT
"!"
,
supi64
);
supi64
);
}
}
// get dnn context
std
::
shared_ptr
<
dnn_context
>
sd
=
{};
if
(
!
sc
.
get
()
->
find_dnn_context
(
scf
.
get
()
->
nssai
,
scf
.
get
()
->
dnn
,
sd
))
{
if
(
nullptr
==
sd
.
get
())
{
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding DNN context!"
);
return
;
}
}
// get smf_pdu_session
// get smf_pdu_session
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
std
::
shared_ptr
<
smf_pdu_session
>
sp
=
{};
bool
find_pdn
=
sd
.
get
()
->
find_pdu_session
(
pdu_session_id
,
sp
);
if
(
nullptr
==
sp
.
get
(
))
{
if
(
!
find_pdu_session
(
pdu_session_id
,
sp
))
{
Logger
::
smf_app
().
warn
(
Logger
::
smf_app
().
warn
(
"Could not retrieve the corresponding SMF PDU Session context!"
);
"Could not retrieve the corresponding SMF PDU Session context!"
);
return
;
return
;
...
@@ -3994,8 +3967,9 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
...
@@ -3994,8 +3967,9 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
// custom json e.g., for FlexCN
// custom json e.g., for FlexCN
nlohmann
::
json
cj
=
{};
nlohmann
::
json
cj
=
{};
// PLMN
// PLMN
plmn_t
plmn
=
{};
plmn_t
plmn
=
{};
std
::
string
mcc
,
mnc
;
std
::
string
mcc
=
{};
std
::
string
mnc
=
{};
sc
->
get_plmn
(
plmn
);
sc
->
get_plmn
(
plmn
);
conv
::
plmnToMccMnc
(
plmn
,
mcc
,
mnc
);
conv
::
plmnToMccMnc
(
plmn
,
mcc
,
mnc
);
cj
[
"plmn"
][
"mcc"
]
=
mcc
;
cj
[
"plmn"
][
"mcc"
]
=
mcc
;
...
@@ -4012,15 +3986,13 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
...
@@ -4012,15 +3986,13 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
cj
[
"ue_ipv6_prefix"
]
=
str_addr6
;
cj
[
"ue_ipv6_prefix"
]
=
str_addr6
;
}
}
}
}
// PDU Session Type
cj
[
"pdu_session_type"
]
=
cj
[
"pdu_session_type"
]
=
sp
->
pdu_session_type
.
toString
();
sp
->
pdu_session_type
.
toString
();
// PDU Session Type
// NSSAI
// NSSAI
cj
[
"snssai"
][
"sst"
]
=
scf
->
nssai
.
sST
;
cj
[
"snssai"
][
"sst"
]
=
sp
->
get_snssai
().
sST
;
cj
[
"snssai"
][
"sd"
]
=
scf
->
nssai
.
sD
;
cj
[
"snssai"
][
"sd"
]
=
sp
->
get_snssai
().
sD
;
// DNN
cj
[
"dnn"
]
=
sp
->
get_dnn
();
// DNN
cj
[
"dnn"
]
=
scf
->
dnn
;
cj
[
"amf_addr"
]
=
sc
->
get_amf_addr
();
// Serving AMF addr
// Serving AMF addr
cj
[
"amf_addr"
]
=
scf
->
amf_addr
;
// QoS flows associated with this session
// QoS flows associated with this session
std
::
vector
<
smf_qos_flow
>
flows
=
{};
std
::
vector
<
smf_qos_flow
>
flows
=
{};
...
@@ -4031,7 +4003,7 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
...
@@ -4031,7 +4003,7 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
for
(
auto
f
:
flows
)
{
for
(
auto
f
:
flows
)
{
nlohmann
::
json
tmp
=
{};
nlohmann
::
json
tmp
=
{};
tmp
[
"qfi"
]
=
(
uint8_t
)
f
.
qfi
.
qfi
;
tmp
[
"qfi"
]
=
(
uint8_t
)
f
.
qfi
.
qfi
;
// UL FT
eid
IPv4/IPv6 (UPF)
// UL FT
EID
IPv4/IPv6 (UPF)
if
(
f
.
ul_fteid
.
v4
)
if
(
f
.
ul_fteid
.
v4
)
tmp
[
"upf_addr"
][
"ipv4"
]
=
inet_ntoa
(
f
.
ul_fteid
.
ipv4_address
);
tmp
[
"upf_addr"
][
"ipv4"
]
=
inet_ntoa
(
f
.
ul_fteid
.
ipv4_address
);
if
(
f
.
ul_fteid
.
v6
)
{
if
(
f
.
ul_fteid
.
v6
)
{
...
@@ -4042,7 +4014,7 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
...
@@ -4042,7 +4014,7 @@ void smf_context::handle_flexcn_event(scid_t scid, uint8_t http_version) {
tmp
[
"upf_addr"
][
"ipv6"
]
=
str_addr6
;
tmp
[
"upf_addr"
][
"ipv6"
]
=
str_addr6
;
}
}
}
}
// DL FT
eid
Ipv4/v6 (AN)
// DL FT
EID
Ipv4/v6 (AN)
if
(
f
.
dl_fteid
.
v4
)
if
(
f
.
dl_fteid
.
v4
)
tmp
[
"an_addr"
][
"ipv4"
]
=
inet_ntoa
(
f
.
dl_fteid
.
ipv4_address
);
tmp
[
"an_addr"
][
"ipv4"
]
=
inet_ntoa
(
f
.
dl_fteid
.
ipv4_address
);
if
(
f
.
dl_fteid
.
v6
)
{
if
(
f
.
dl_fteid
.
v6
)
{
...
...
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