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
026e4651
Commit
026e4651
authored
Feb 10, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup for N11
parent
7b10d6a8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
130 additions
and
230 deletions
+130
-230
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+15
-2
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+2
-0
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+3
-2
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+106
-225
src/amf-app/amf_n11.hpp
src/amf-app/amf_n11.hpp
+4
-1
No files found.
src/amf-app/amf_config.cpp
View file @
026e4651
...
...
@@ -85,6 +85,7 @@ amf_config::amf_config() {
smf_pool
=
{};
support_features
.
enable_nf_registration
=
false
;
support_features
.
enable_nrf_selection
=
false
;
support_features
.
enable_external_nrf
=
false
;
support_features
.
enable_smf_selection
=
false
;
support_features
.
enable_external_ausf
=
false
;
support_features
.
enable_external_udm
=
false
;
...
...
@@ -261,6 +262,14 @@ int amf_config::load(const std::string& config_file) {
support_features
.
enable_nrf_selection
=
false
;
}
support_features_cfg
.
lookupValue
(
AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_NRF
,
opt
);
if
(
boost
::
iequals
(
opt
,
"yes"
))
{
support_features
.
enable_external_nrf
=
true
;
}
else
{
support_features
.
enable_external_nrf
=
false
;
}
support_features_cfg
.
lookupValue
(
AMF_CONFIG_STRING_SUPPORT_FEATURES_SMF_SELECTION
,
opt
);
if
(
boost
::
iequals
(
opt
,
"yes"
))
{
...
...
@@ -532,7 +541,7 @@ int amf_config::load(const std::string& config_file) {
}
// NSSF
if
(
support_features
.
enable_
nrf_selection
)
{
if
(
support_features
.
enable_
external_nssf
)
{
const
Setting
&
nssf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_NSSF
];
struct
in_addr
nssf_ipv4_addr
=
{};
unsigned
int
nssf_port
=
{};
...
...
@@ -723,7 +732,7 @@ void amf_config::display() {
" API version ...........: %s"
,
nrf_addr
.
api_version
.
c_str
());
}
if
(
support_features
.
enable_
nrf_selection
)
{
if
(
support_features
.
enable_
external_nssf
)
{
Logger
::
config
().
info
(
"- NSSF:"
);
Logger
::
config
().
info
(
" IP Addr ...............: %s"
,
inet_ntoa
(
nssf_addr
.
ipv4_addr
));
...
...
@@ -774,6 +783,9 @@ void amf_config::display() {
Logger
::
config
().
info
(
" SMF Selection .........: %s"
,
support_features
.
enable_smf_selection
?
"Yes"
:
"No"
);
Logger
::
config
().
info
(
" External NRF ..........: %s"
,
support_features
.
enable_external_nrf
?
"Yes"
:
"No"
);
Logger
::
config
().
info
(
" External AUSF .........: %s"
,
support_features
.
enable_external_ausf
?
"Yes"
:
"No"
);
...
...
@@ -858,4 +870,5 @@ std::string amf_config::get_nssf_network_slice_selection_information_uri() {
":"
+
std
::
to_string
(
nssf_addr
.
port
)
+
"/nnssf-nsselection/"
+
nssf_addr
.
api_version
+
"/network-slice-information"
;
}
}
// namespace config
src/amf-app/amf_config.hpp
View file @
026e4651
...
...
@@ -105,6 +105,7 @@
#define AMF_CONFIG_STRING_SUPPORT_FEATURES "SUPPORT_FEATURES"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_NF_REGISTRATION "NF_REGISTRATION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_NRF_SELECTION "NRF_SELECTION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_NRF "EXTERNAL_NRF"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_SMF_SELECTION "SMF_SELECTION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_AUSF "EXTERNAL_AUSF"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_UDM "EXTERNAL_UDM"
...
...
@@ -233,6 +234,7 @@ class amf_config {
struct
{
bool
enable_nf_registration
;
bool
enable_nrf_selection
;
bool
enable_external_nrf
;
bool
enable_smf_selection
;
bool
enable_external_ausf
;
bool
enable_external_udm
;
...
...
src/amf-app/amf_n1.cpp
View file @
026e4651
...
...
@@ -1608,11 +1608,12 @@ bool amf_n1::_5g_aka_confirmation_from_ausf(
msgBody
=
confirmationdata_j
.
dump
();
// TODO: Should be updated
uint8_t
http_version
=
1
;
uint8_t
http_version
=
1
;
uint32_t
response_code
=
0
;
if
(
amf_cfg
.
support_features
.
use_http2
)
http_version
=
2
;
amf_n11_inst
->
curl_http_client
(
remoteUri
,
"PUT"
,
msgBody
,
response
,
http_version
);
remoteUri
,
"PUT"
,
msgBody
,
response
,
response_code
,
http_version
);
free_wrapper
((
void
**
)
&
resStar_s
);
try
{
...
...
src/amf-app/amf_n11.cpp
View file @
026e4651
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n11.hpp
View file @
026e4651
...
...
@@ -83,7 +83,8 @@ class amf_n11 {
void
curl_http_client
(
std
::
string
remote_uri
,
std
::
string
method
,
std
::
string
msg_body
,
nlohmann
::
json
&
response_json
,
uint8_t
http_version
=
1
);
nlohmann
::
json
&
response_json
,
uint32_t
&
response_code
,
uint8_t
http_version
=
1
);
void
curl_http_client
(
std
::
string
&
remote_uri
,
std
::
string
&
json_data
,
std
::
string
&
n1sm_msg
,
...
...
@@ -106,6 +107,8 @@ class amf_n11 {
bool
send_ue_authentication_request
(
oai
::
amf
::
model
::
AuthenticationInfo
&
auth_info
,
oai
::
amf
::
model
::
UEAuthenticationCtx
&
ue_auth_ctx
,
uint8_t
http_version
);
void
get_nrf_uri
(
std
::
string
&
nrf_uri
);
};
}
// namespace amf_application
...
...
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