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
e9614ab6
Commit
e9614ab6
authored
Oct 15, 2021
by
kharade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nssf parameters added in config file
parent
632c3bb9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
1 deletion
+93
-1
ci-scripts/dsTesterDockerCompose/docker-compose.tplt
ci-scripts/dsTesterDockerCompose/docker-compose.tplt
+4
-0
etc/amf.conf
etc/amf.conf
+9
-1
scripts/entrypoint.sh
scripts/entrypoint.sh
+7
-0
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+63
-0
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+10
-0
No files found.
ci-scripts/dsTesterDockerCompose/docker-compose.tplt
View file @
e9614ab6
...
...
@@ -85,6 +85,10 @@ services:
- AUSF_PORT=80
- AUSF_API_VERSION=v1
- AUSF_FQDN=localhost
- NSSF_IPV4_ADDRESS=0.0.0.0
- NSSF_PORT=80
- NSSF_API_VERSION=v1
- NSSF_FQDN=localhost
depends_on:
- cicd_mysql
networks:
...
...
etc/amf.conf
View file @
e9614ab6
...
...
@@ -96,13 +96,21 @@ AMF =
API_VERSION
=
"@AUSF_API_VERSION@"
;
# YOUR AUSF API VERSION FOR SBI CONFIG HERE
FQDN
=
"@AUSF_FQDN@"
# YOUR AUSF FQDN CONFIG HERE
};
NSSF
:
{
IPV4_ADDRESS
=
"@NSSF_IPV4_ADDRESS@"
;
# YOUR NSSF CONFIG HERE
PORT
= @
NSSF_PORT
@;
# YOUR NSSF CONFIG HERE (default: 80)
API_VERSION
=
"@NSSF_API_VERSION@"
;
# YOUR NSSF API VERSION FOR SBI CONFIG HERE
FQDN
=
"@NSSF_FQDN@"
# YOUR NSSF FQDN CONFIG HERE
};
};
SUPPORT_FEATURES
:
{
# STRING, {"yes", "no"},
NF_REGISTRATION
=
"@NF_REGISTRATION@"
;
# Set to yes if AMF resgisters to an NRF
NRF_SELECTION
=
"@NRF_SELECTION@"
;
# Set to yes to enable NRF discovery and selection
SMF_SELECTION
=
"@SMF_SELECTION@"
;
# Set to yes to enable SMF discovery and selection
EXTERNAL_AUSF
=
"@EXTERNAL_AUSF@"
;
# Set to yes if AMF works with an external AUSF
EXTERNAL_UDM
=
"@EXTERNAL_UDM@"
;
# Set to yes if AMF works with an external UDM
...
...
scripts/entrypoint.sh
View file @
e9614ab6
...
...
@@ -7,7 +7,14 @@ CONFIG_DIR="/openair-amf/etc"
# Default values
EXTERNAL_AUSF
=
${
EXTERNAL_AUSF
:-
no
}
EXTERNAL_UDM
=
${
EXTERNAL_UDM
:-
no
}
NRF_SELECTION
=
${
NRF_SELECTION
:-
no
}
NSSF_IPV4_ADDRESS
=
${
NSSF_IPV4_ADDRESS
:-
0
.0.0.0
}
NSSF_PORT
=
${
NSSF_PORT
:-
80
}
NSSF_API_VERSION
=
${
NSSF_API_VERSION
:-
v2
}
NSSF_FQDN
=
${
NSSF_FQDN
:-
oai
-nssf
}
if
[[
${
USE_FQDN_DNS
}
==
"yes"
]]
;
then
NSSF_IPV4_ADDR
=
${
NSSF_IPV4_ADDR_0
:-
0
.0.0.0
}
SMF_IPV4_ADDR_0
=
${
SMF_IPV4_ADDR_0
:-
0
.0.0.0
}
SMF_IPV4_ADDR_1
=
${
SMF_IPV4_ADDR_1
:-
0
.0.0.0
}
NRF_IPV4_ADDRESS
=
${
NRF_IPV4_ADDRESS
:-
0
.0.0.0
}
...
...
src/amf-app/amf_config.cpp
View file @
e9614ab6
...
...
@@ -78,6 +78,7 @@ amf_config::amf_config() {
nas_cfg
=
{};
smf_pool
=
{};
support_features
.
enable_nf_registration
=
false
;
support_features
.
enable_nrf_selection
=
false
;
support_features
.
enable_smf_selection
=
false
;
support_features
.
enable_external_ausf
=
false
;
support_features
.
enable_external_udm
=
false
;
...
...
@@ -237,6 +238,14 @@ int amf_config::load(const std::string& config_file) {
support_features
.
enable_nf_registration
=
false
;
}
support_features_cfg
.
lookupValue
(
AMF_CONFIG_STRING_SUPPORT_FEATURES_NRF_SELECTION
,
opt
);
if
(
boost
::
iequals
(
opt
,
"yes"
))
{
support_features
.
enable_nrf_selection
=
true
;
}
else
{
support_features
.
enable_nrf_selection
=
false
;
}
support_features_cfg
.
lookupValue
(
AMF_CONFIG_STRING_SUPPORT_FEATURES_SMF_SELECTION
,
opt
);
if
(
boost
::
iequals
(
opt
,
"yes"
))
{
...
...
@@ -456,6 +465,48 @@ int amf_config::load(const std::string& config_file) {
}
}
// NSSF
if
(
support_features
.
enable_nrf_selection
)
{
const
Setting
&
nssf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_NSSF
];
struct
in_addr
nssf_ipv4_addr
=
{};
unsigned
int
nssf_port
=
{};
std
::
string
nssf_api_version
=
{};
if
(
!
support_features
.
use_fqdn_dns
)
{
nssf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_IPV4_ADDRESS
,
address
);
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
address
).
c_str
(),
nssf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR NSSF !"
);
nssf_addr
.
ipv4_addr
=
nssf_ipv4_addr
;
if
(
!
(
nssf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PORT
,
nssf_port
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_PORT
"failed"
);
throw
(
AMF_CONFIG_STRING_PORT
"failed"
);
}
nssf_addr
.
port
=
nssf_port
;
if
(
!
(
nssf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_API_VERSION
,
nssf_api_version
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
}
nssf_addr
.
api_version
=
nssf_api_version
;
}
else
{
std
::
string
nssf_fqdn
=
{};
nssf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_FQDN_DNS
,
nssf_fqdn
);
uint8_t
addr_type
=
{};
fqdn
::
resolve
(
nssf_fqdn
,
address
,
nssf_port
,
addr_type
);
if
(
addr_type
!=
0
)
{
// IPv6: TODO
throw
(
"DO NOT SUPPORT IPV6 ADDR FOR NSSF!"
);
}
else
{
// IPv4
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
address
).
c_str
(),
nssf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR NSSF !"
);
nssf_addr
.
ipv4_addr
=
nssf_ipv4_addr
;
nssf_addr
.
port
=
nssf_port
;
nssf_addr
.
api_version
=
"v1"
;
// TODO: get API version
}
}
}
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
...
...
@@ -607,6 +658,15 @@ void amf_config::display() {
" API version ...........: %s"
,
nrf_addr
.
api_version
.
c_str
());
}
if
(
support_features
.
enable_nrf_selection
)
{
Logger
::
config
().
info
(
"- NSSF:"
);
Logger
::
config
().
info
(
" IP Addr ...............: %s"
,
inet_ntoa
(
nssf_addr
.
ipv4_addr
));
Logger
::
config
().
info
(
" Port ..................: %d"
,
nssf_addr
.
port
);
Logger
::
config
().
info
(
" API version ...........: %s"
,
nssf_addr
.
api_version
.
c_str
());
}
if
(
support_features
.
enable_external_ausf
)
{
Logger
::
config
().
info
(
"- AUSF:"
);
Logger
::
config
().
info
(
...
...
@@ -634,6 +694,9 @@ void amf_config::display() {
Logger
::
config
().
info
(
" NF Registration .......: %s"
,
support_features
.
enable_nf_registration
?
"Yes"
:
"No"
);
Logger
::
config
().
info
(
" NRF Selection .........: %s"
,
support_features
.
enable_nrf_selection
?
"Yes"
:
"No"
);
Logger
::
config
().
info
(
" SMF Selection .........: %s"
,
support_features
.
enable_smf_selection
?
"Yes"
:
"No"
);
...
...
src/amf-app/amf_config.hpp
View file @
e9614ab6
...
...
@@ -67,6 +67,8 @@
#define AMF_CONFIG_STRING_AUSF "AUSF"
#define AMF_CONFIG_STRING_NSSF "NSSF"
#define AMF_CONFIG_STRING_SCHED_PARAMS "SCHED_PARAMS"
#define AMF_CONFIG_STRING_THREAD_RD_CPU_ID "CPU_ID"
#define AMF_CONFIG_STRING_THREAD_RD_SCHED_POLICY "SCHED_POLICY"
...
...
@@ -102,6 +104,7 @@
"ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST"
#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_SMF_SELECTION "SMF_SELECTION"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_AUSF "EXTERNAL_AUSF"
#define AMF_CONFIG_STRING_SUPPORT_FEATURES_EXTERNAL_UDM "EXTERNAL_UDM"
...
...
@@ -204,6 +207,7 @@ class amf_config {
struct
{
bool
enable_nf_registration
;
bool
enable_nrf_selection
;
bool
enable_smf_selection
;
bool
enable_external_ausf
;
bool
enable_external_udm
;
...
...
@@ -222,6 +226,12 @@ class amf_config {
unsigned
int
port
;
std
::
string
api_version
;
}
ausf_addr
;
struct
{
struct
in_addr
ipv4_addr
;
unsigned
int
port
;
std
::
string
api_version
;
}
nssf_addr
;
}
;
}
// namespace config
...
...
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