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
300b3355
Commit
300b3355
authored
Feb 18, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
4c95e448
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
83 deletions
+0
-83
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+0
-78
src/amf-app/amf_n11.hpp
src/amf-app/amf_n11.hpp
+0
-5
No files found.
src/amf-app/amf_n11.cpp
View file @
300b3355
...
...
@@ -786,84 +786,6 @@ void amf_n11::handle_post_sm_context_response_error(
}
}
//-----------------------------------------------------------------------------------------------------
bool
amf_n11
::
discover_smf_from_nsi_info
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
,
std
::
string
&
smf_port
,
const
snssai_t
snssai
,
const
plmn_t
plmn
,
const
std
::
string
dnn
)
{
Logger
::
amf_n11
().
debug
(
"Send NS Selection to NSSF to discover the appropriate NRF"
);
bool
result
=
true
;
std
::
string
nrf_addr
=
{};
std
::
string
nrf_port
=
{};
std
::
string
nrf_api_version
=
{};
uint8_t
http_version
=
1
;
if
(
amf_cfg
.
support_features
.
use_http2
)
http_version
=
2
;
// Get NSI information from NSSF
nlohmann
::
json
slice_info
=
{};
nlohmann
::
json
snssai_info
=
{};
snssai_info
[
"sst"
]
=
snssai
.
sST
;
if
(
!
snssai
.
sD
.
empty
())
snssai_info
[
"sd"
]
=
snssai
.
sD
;
slice_info
[
"sNssai"
]
=
snssai_info
;
slice_info
[
"roamingIndication"
]
=
"NON_ROAMING"
;
// ToDo Add TAI
std
::
string
url
=
amf_cfg
.
get_nssf_network_slice_selection_information_uri
();
std
::
string
parameters
=
{};
parameters
=
"?nf-type=AMF&nf-id="
+
amf_app_inst
->
get_nf_instance
()
+
"&slice-info-request-for-pdu-session="
+
slice_info
.
dump
();
url
+=
parameters
;
Logger
::
amf_n11
().
debug
(
"Send Network Slice Information Retrieval during PDU session "
"establishment procedure, URL %s"
,
url
.
c_str
());
nlohmann
::
json
response_data
=
{};
uint32_t
response_code
=
0
;
curl_http_client
(
url
,
"GET"
,
""
,
response_data
,
response_code
);
Logger
::
amf_n11
().
debug
(
"NFDiscovery, response from NRF, json data:
\n
%s"
,
response_data
.
dump
().
c_str
());
std
::
string
nrf_uri
=
{};
if
(
response_code
!=
200
)
{
Logger
::
amf_n11
().
warn
(
"NS Selection, could not get response from NSSF"
);
result
=
false
;
}
else
{
Logger
::
amf_n11
().
debug
(
"NS Selection, got successful response from NSSF"
);
Logger
::
amf_n11
().
debug
(
"NS Selection, response from NSSF, json data:
\n
%s"
,
response_data
.
dump
().
c_str
());
// Process data to obtain NRF info
if
(
response_data
.
find
(
"nsiInformation"
)
!=
response_data
.
end
())
{
if
(
response_data
[
"nsiInformation"
].
count
(
"nrfId"
)
>
0
)
nrf_uri
=
response_data
[
"nsiInformation"
][
"nrfId"
].
get
<
std
::
string
>
();
std
::
string
nsi_id
=
{};
if
(
response_data
[
"nsiInformation"
].
count
(
"nsi_id"
)
>
0
)
nsi_id
=
response_data
[
"nsiInformation"
][
"nsiId"
].
get
<
std
::
string
>
();
}
}
Logger
::
amf_n11
().
debug
(
"NS Selection, NRF's URI: %s"
,
nrf_uri
.
c_str
());
if
(
!
result
)
return
result
;
Logger
::
amf_n11
().
debug
(
"NSI Information is successfully retrieved from NSSF"
);
if
(
!
discover_smf
(
smf_addr
,
smf_port
,
smf_api_version
,
snssai
,
plmn
,
dnn
,
nrf_uri
))
{
return
false
;
}
return
true
;
}
//-----------------------------------------------------------------------------------------------------
bool
amf_n11
::
discover_smf
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_port
,
std
::
string
&
smf_api_version
,
...
...
src/amf-app/amf_n11.hpp
View file @
300b3355
...
...
@@ -92,11 +92,6 @@ class amf_n11 {
std
::
string
&
n2sm_msg
,
uint8_t
http_version
,
uint32_t
&
response_code
,
uint32_t
promise_id
=
0
);
bool
discover_smf_from_nsi_info
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
,
std
::
string
&
smf_port
,
const
snssai_t
snssai
,
const
plmn_t
plmn
,
const
std
::
string
dnn
);
bool
discover_smf
(
std
::
string
&
smf_addr
,
std
::
string
&
smf_port
,
std
::
string
&
smf_api_version
,
const
snssai_t
snssai
,
const
plmn_t
plmn
,
...
...
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