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
9a72671d
Commit
9a72671d
authored
Jan 06, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get NRF info from configuration file
parent
53d44562
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
2 deletions
+52
-2
etc/smf.conf
etc/smf.conf
+9
-2
src/smf_app/smf_config.cpp
src/smf_app/smf_config.cpp
+29
-0
src/smf_app/smf_config.hpp
src/smf_app/smf_config.hpp
+14
-0
No files found.
etc/smf.conf
View file @
9a72671d
...
@@ -87,7 +87,7 @@ SMF =
...
@@ -87,7 +87,7 @@ SMF =
{
{
IPV4_ADDRESS
=
"@AMF_IPV4_ADDRESS@"
;
# YOUR AMF CONFIG HERE
IPV4_ADDRESS
=
"@AMF_IPV4_ADDRESS@"
;
# YOUR AMF CONFIG HERE
PORT
= @
AMF_PORT
@;
# YOUR AMF CONFIG HERE (default: 80)
PORT
= @
AMF_PORT
@;
# YOUR AMF CONFIG HERE (default: 80)
API_VERSION
=
"@AMF_API_VERSION@"
;
# YOUR
S
MF API VERSION FOR SBI CONFIG HERE
API_VERSION
=
"@AMF_API_VERSION@"
;
# YOUR
A
MF API VERSION FOR SBI CONFIG HERE
};
};
UDM
:
UDM
:
...
@@ -101,6 +101,13 @@ SMF =
...
@@ -101,6 +101,13 @@ SMF =
{
IPV4_ADDRESS
=
"@UPF_IPV4_ADDRESS@"
;}
# YOUR UPF CONFIG HERE
{
IPV4_ADDRESS
=
"@UPF_IPV4_ADDRESS@"
;}
# YOUR UPF CONFIG HERE
);
);
NRF
:
{
IPV4_ADDRESS
=
"@NRF_IPV4_ADDRESS@"
;
# YOUR NRF CONFIG HERE
PORT
= @
NRF_PORT
@;
# YOUR NRF CONFIG HERE (default: 80)
API_VERSION
=
"@NRF_API_VERSION@"
;
# YOUR NRF API VERSION FOR SBI CONFIG HERE
};
LOCAL_CONFIGURATION
:
LOCAL_CONFIGURATION
:
{
{
USE_LOCAL_CONFIGURATION
=
"yes"
;
USE_LOCAL_CONFIGURATION
=
"yes"
;
...
...
src/smf_app/smf_config.cpp
View file @
9a72671d
...
@@ -611,6 +611,28 @@ int smf_config::load(const string &config_file) {
...
@@ -611,6 +611,28 @@ int smf_config::load(const string &config_file) {
}
}
}
}
// NRF
const
Setting
&
nrf_cfg
=
smf_cfg
[
SMF_CONFIG_STRING_NRF
];
struct
in_addr
nrf_ipv4_addr
;
unsigned
int
nrf_port
=
0
;
std
::
string
nrf_api_version
;
nrf_cfg
.
lookupValue
(
SMF_CONFIG_STRING_NRF_IPV4_ADDRESS
,
astring
);
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
astring
).
c_str
(),
nrf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR NRF !"
);
nrf_addr
.
ipv4_addr
=
nrf_ipv4_addr
;
if
(
!
(
nrf_cfg
.
lookupValue
(
SMF_CONFIG_STRING_NRF_PORT
,
nrf_port
)))
{
Logger
::
smf_app
().
error
(
SMF_CONFIG_STRING_NRF_PORT
"failed"
);
throw
(
SMF_CONFIG_STRING_NRF_PORT
"failed"
);
}
nrf_addr
.
port
=
nrf_port
;
if
(
!
(
nrf_cfg
.
lookupValue
(
SMF_CONFIG_STRING_API_VERSION
,
nrf_api_version
)))
{
Logger
::
smf_app
().
error
(
SMF_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
SMF_CONFIG_STRING_API_VERSION
"failed"
);
}
nrf_addr
.
api_version
=
nrf_api_version
;
// Local configuration
// Local configuration
num_session_management_subscription
=
0
;
num_session_management_subscription
=
0
;
const
Setting
&
local_cfg
=
smf_cfg
[
SMF_CONFIG_STRING_LOCAL_CONFIGURATION
];
const
Setting
&
local_cfg
=
smf_cfg
[
SMF_CONFIG_STRING_LOCAL_CONFIGURATION
];
...
@@ -818,6 +840,13 @@ void smf_config::display() {
...
@@ -818,6 +840,13 @@ void smf_config::display() {
Logger
::
smf_app
().
info
(
" API version .........: %s"
,
Logger
::
smf_app
().
info
(
" API version .........: %s"
,
udm_addr
.
api_version
.
c_str
());
udm_addr
.
api_version
.
c_str
());
Logger
::
smf_app
().
info
(
"- NRF:"
);
Logger
::
smf_app
().
info
(
" IPv4 Addr ...........: %s"
,
inet_ntoa
(
*
((
struct
in_addr
*
)
&
nrf_addr
.
ipv4_addr
)));
Logger
::
smf_app
().
info
(
" Port ................: %lu "
,
nrf_addr
.
port
);
Logger
::
smf_app
().
info
(
" API version .........: %s"
,
nrf_addr
.
api_version
.
c_str
());
Logger
::
smf_app
().
info
(
"- Helpers:"
);
Logger
::
smf_app
().
info
(
"- Helpers:"
);
Logger
::
smf_app
().
info
(
" Push PCO (DNS+MTU) ..: %s"
,
Logger
::
smf_app
().
info
(
" Push PCO (DNS+MTU) ..: %s"
,
force_push_pco
==
0
?
"false"
:
"true"
);
force_push_pco
==
0
?
"false"
:
"true"
);
...
...
src/smf_app/smf_config.hpp
View file @
9a72671d
...
@@ -110,6 +110,10 @@
...
@@ -110,6 +110,10 @@
#define SMF_CONFIG_STRING_UPF_LIST "UPF_LIST"
#define SMF_CONFIG_STRING_UPF_LIST "UPF_LIST"
#define SMF_CONFIG_STRING_UPF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_UPF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_NRF "NRF"
#define SMF_CONFIG_STRING_NRF_IPV4_ADDRESS "IPV4_ADDRESS"
#define SMF_CONFIG_STRING_NRF_PORT "PORT"
#define SMF_CONFIG_STRING_LOCAL_CONFIGURATION "LOCAL_CONFIGURATION"
#define SMF_CONFIG_STRING_LOCAL_CONFIGURATION "LOCAL_CONFIGURATION"
#define SMF_CONFIG_STRING_USE_LOCAL_CONFIGURATION "USE_LOCAL_CONFIGURATION"
#define SMF_CONFIG_STRING_USE_LOCAL_CONFIGURATION "USE_LOCAL_CONFIGURATION"
#define SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST \
#define SMF_CONFIG_STRING_SESSION_MANAGEMENT_SUBSCRIPTION_LIST \
...
@@ -221,6 +225,12 @@ class smf_config {
...
@@ -221,6 +225,12 @@ class smf_config {
std
::
vector
<
pfcp
::
node_id_t
>
upfs
;
std
::
vector
<
pfcp
::
node_id_t
>
upfs
;
struct
{
struct
in_addr
ipv4_addr
;
unsigned
int
port
;
std
::
string
api_version
;
}
nrf_addr
;
// Local configuration
// Local configuration
bool
local_configuration
;
bool
local_configuration
;
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 5
#define SMF_NUM_SESSION_MANAGEMENT_SUBSCRIPTION_MAX 5
...
@@ -284,6 +294,10 @@ class smf_config {
...
@@ -284,6 +294,10 @@ class smf_config {
udm_addr
.
port
=
80
;
udm_addr
.
port
=
80
;
udm_addr
.
api_version
=
"v1"
;
udm_addr
.
api_version
=
"v1"
;
nrf_addr
.
ipv4_addr
.
s_addr
=
INADDR_ANY
;
nrf_addr
.
port
=
80
;
nrf_addr
.
api_version
=
"v1"
;
local_configuration
=
false
;
local_configuration
=
false
;
num_session_management_subscription
=
0
;
num_session_management_subscription
=
0
;
...
...
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