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
09adfb29
Commit
09adfb29
authored
Feb 03, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get UDM info from Conf file
parent
f11d241c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
5 deletions
+80
-5
etc/amf.conf
etc/amf.conf
+9
-0
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+65
-0
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+3
-1
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+1
-1
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+2
-3
No files found.
etc/amf.conf
View file @
09adfb29
...
...
@@ -97,6 +97,15 @@ AMF =
FQDN
=
"@AUSF_FQDN@"
# YOUR AUSF FQDN CONFIG HERE
};
UDM
:
{
IPV4_ADDRESS
=
"127.0.0.1"
;
# YOUR AUSF CONFIG HERE
PORT
=
80
;
# YOUR AUSF CONFIG HERE (default: 80)
API_VERSION
=
"v1"
;
# YOUR AUSF API VERSION FOR SBI CONFIG HERE
FQDN
=
"udm"
;
# YOUR AUSF FQDN CONFIG HERE
#DEFAULT_SINGLE_NSSAIS = [{"sst": 1, "sd":"1"}, {"sst": 2, "sd":"2"}]
};
NSSF
:
{
IPV4_ADDRESS
=
"@NSSF_IPV4_ADDRESS@"
;
# YOUR NSSF CONFIG HERE
...
...
src/amf-app/amf_config.cpp
View file @
09adfb29
...
...
@@ -64,6 +64,12 @@ amf_config::amf_config() {
ausf_addr
.
ipv4_addr
.
s_addr
=
INADDR_ANY
;
ausf_addr
.
port
=
80
;
ausf_addr
.
api_version
=
"v1"
;
udm_addr
.
ipv4_addr
.
s_addr
=
INADDR_ANY
;
udm_addr
.
port
=
80
;
udm_addr
.
api_version
=
"v1"
;
nssf_addr
.
ipv4_addr
.
s_addr
=
INADDR_ANY
;
nssf_addr
.
port
=
80
;
nssf_addr
.
api_version
=
"v1"
;
instance
=
0
;
n2
=
{};
n11
=
{};
...
...
@@ -482,6 +488,49 @@ int amf_config::load(const std::string& config_file) {
}
}
// UDM
if
(
support_features
.
enable_external_udm
)
{
const
Setting
&
udm_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_UDM
];
struct
in_addr
udm_ipv4_addr
=
{};
unsigned
int
udm_port
=
{};
std
::
string
udm_api_version
=
{};
if
(
!
support_features
.
use_fqdn_dns
)
{
udm_cfg
.
lookupValue
(
AMF_CONFIG_STRING_IPV4_ADDRESS
,
address
);
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
address
).
c_str
(),
udm_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR UDM !"
);
udm_addr
.
ipv4_addr
=
udm_ipv4_addr
;
if
(
!
(
udm_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PORT
,
udm_port
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_PORT
"failed"
);
throw
(
AMF_CONFIG_STRING_PORT
"failed"
);
}
udm_addr
.
port
=
udm_port
;
if
(
!
(
udm_cfg
.
lookupValue
(
AMF_CONFIG_STRING_API_VERSION
,
udm_api_version
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
}
udm_addr
.
api_version
=
udm_api_version
;
}
else
{
std
::
string
udm_fqdn
=
{};
udm_cfg
.
lookupValue
(
AMF_CONFIG_STRING_FQDN_DNS
,
udm_fqdn
);
uint8_t
addr_type
=
{};
fqdn
::
resolve
(
udm_fqdn
,
address
,
udm_port
,
addr_type
);
if
(
addr_type
!=
0
)
{
// IPv6: TODO
throw
(
"DO NOT SUPPORT IPV6 ADDR FOR UDM!"
);
}
else
{
// IPv4
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
address
).
c_str
(),
udm_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR UDM !"
);
udm_addr
.
ipv4_addr
=
udm_ipv4_addr
;
udm_addr
.
port
=
udm_port
;
udm_addr
.
api_version
=
"v1"
;
// TODO: get API version
}
}
}
// NSSF
if
(
support_features
.
enable_nrf_selection
)
{
const
Setting
&
nssf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_NSSF
];
...
...
@@ -692,6 +741,15 @@ void amf_config::display() {
" API version ...........: %s"
,
ausf_addr
.
api_version
.
c_str
());
}
if
(
support_features
.
enable_external_udm
)
{
Logger
::
config
().
info
(
"- UDM:"
);
Logger
::
config
().
info
(
" IP Addr ...............: %s"
,
inet_ntoa
(
udm_addr
.
ipv4_addr
));
Logger
::
config
().
info
(
" Port ..................: %d"
,
udm_addr
.
port
);
Logger
::
config
().
info
(
" API version ...........: %s"
,
udm_addr
.
api_version
.
c_str
());
}
if
(
!
support_features
.
enable_smf_selection
)
{
Logger
::
config
().
info
(
"- SMF Pool.........: "
);
for
(
int
i
=
0
;
i
<
smf_pool
.
size
();
i
++
)
{
...
...
@@ -786,4 +844,11 @@ std::string amf_config::get_nrf_nf_discovery_service_uri() {
nrf_addr
.
api_version
+
"/nf-instances"
;
}
//------------------------------------------------------------------------------
std
::
string
amf_config
::
get_udm_slice_selection_subscription_data_retrieval_uri
(
const
std
::
string
&
supi
)
{
return
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
udm_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
udm_addr
.
port
)
+
"/nudm-sdm/"
+
udm_addr
.
api_version
+
"/"
+
supi
+
"/nssai"
;
}
}
// namespace config
src/amf-app/amf_config.hpp
View file @
09adfb29
...
...
@@ -66,7 +66,7 @@
#define AMF_CONFIG_STRING_API_VERSION "API_VERSION"
#define AMF_CONFIG_STRING_AUSF "AUSF"
#define AMF_CONFIG_STRING_UDM "UDM"
#define AMF_CONFIG_STRING_NSSF "NSSF"
#define AMF_CONFIG_STRING_SCHED_PARAMS "SCHED_PARAMS"
...
...
@@ -206,6 +206,8 @@ class amf_config {
int
load
(
const
std
::
string
&
config_file
);
int
load_interface
(
const
Setting
&
if_cfg
,
interface_cfg_t
&
cfg
);
std
::
string
get_nrf_nf_discovery_service_uri
();
std
::
string
get_udm_slice_selection_subscription_data_retrieval_uri
(
const
std
::
string
&
supi
);
void
display
();
unsigned
int
instance
;
...
...
src/amf-app/amf_n1.cpp
View file @
09adfb29
...
...
@@ -3710,7 +3710,7 @@ bool amf_n1::reroute_registration_request(std::shared_ptr<nas_context>& nc) {
return
false
;
}
// Update subscribed NSSAIs
//
TODO:
Update subscribed NSSAIs
// Check that AMF can process the Requested NSSAIs or not
if
(
check_requested_nssai
(
nc
,
nssai
))
{
...
...
src/amf-app/amf_n11.cpp
View file @
09adfb29
...
...
@@ -601,9 +601,8 @@ void amf_n11::handle_itti_message(
itti_msg
.
http_version
);
std
::
string
url
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
amf_cfg
.
udm_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
amf_cfg
.
udm_addr
.
port
)
+
"/nudm-sdm/"
+
amf_cfg
.
udm_addr
.
api_version
+
"/"
+
itti_msg
.
supi
+
"/nssai"
;
amf_cfg
.
get_udm_slice_selection_subscription_data_retrieval_uri
(
itti_msg
.
supi
);
nlohmann
::
json
json_data
=
{};
json_data
[
"plmn-id"
][
"mcc"
]
=
itti_msg
.
plmn
.
mcc
;
json_data
[
"plmn-id"
][
"mnc"
]
=
itti_msg
.
plmn
.
mnc
;
...
...
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