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
bfef8dcf
Commit
bfef8dcf
authored
Jul 05, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve SMF IP addr when sending PDU session request
parent
deeb33ba
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+7
-6
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+1
-0
src/amf-app/amf_n11.cpp
src/amf-app/amf_n11.cpp
+21
-2
No files found.
src/amf-app/amf_config.cpp
View file @
bfef8dcf
...
@@ -342,6 +342,8 @@ int amf_config::load(const std::string& config_file) {
...
@@ -342,6 +342,8 @@ int amf_config::load(const std::string& config_file) {
}
else
{
}
else
{
std
::
string
smf_fqdn
=
{};
std
::
string
smf_fqdn
=
{};
smf_addr_item
.
lookupValue
(
AMF_CONFIG_STRING_FQDN_DNS
,
smf_fqdn
);
smf_addr_item
.
lookupValue
(
AMF_CONFIG_STRING_FQDN_DNS
,
smf_fqdn
);
smf_inst
.
fqdn
=
smf_fqdn
;
/*
uint8_t addr_type = 0;
uint8_t addr_type = 0;
fqdn::resolve(smf_fqdn, smf_inst.ipv4, smf_port, addr_type);
fqdn::resolve(smf_fqdn, smf_inst.ipv4, smf_port, addr_type);
if (addr_type != 0) { // IPv6: TODO
if (addr_type != 0) { // IPv6: TODO
...
@@ -353,6 +355,7 @@ int amf_config::load(const std::string& config_file) {
...
@@ -353,6 +355,7 @@ int amf_config::load(const std::string& config_file) {
smf_inst.port = std::to_string(smf_port);
smf_inst.port = std::to_string(smf_port);
smf_inst.version = "v1"; // TODO: get API version
smf_inst.version = "v1"; // TODO: get API version
}
}
*/
}
}
smf_addr_item
.
lookupValue
(
smf_addr_item
.
lookupValue
(
...
@@ -595,14 +598,12 @@ void amf_config::display() {
...
@@ -595,14 +598,12 @@ void amf_config::display() {
if
(
!
enable_smf_selection
)
{
if
(
!
enable_smf_selection
)
{
Logger
::
config
().
info
(
"- SMF Pool.........: "
);
Logger
::
config
().
info
(
"- SMF Pool.........: "
);
for
(
int
i
=
0
;
i
<
smf_pool
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
smf_pool
.
size
();
i
++
)
{
std
::
string
selected
;
std
::
string
selected
=
smf_pool
[
i
].
selected
?
"true"
:
"false"
;
if
(
smf_pool
[
i
].
selected
)
std
::
string
smf_info
=
selected
=
"true"
;
use_fqdn_dns
?
smf_pool
[
i
].
fqdn
:
smf_pool
[
i
].
ipv4
.
c_str
();
else
selected
=
"false"
;
Logger
::
config
().
info
(
Logger
::
config
().
info
(
" SMF_INSTANCE_ID %d (%s:%s, version %s) is selected: %s"
,
" SMF_INSTANCE_ID %d (%s:%s, version %s) is selected: %s"
,
smf_pool
[
i
].
id
,
smf_
pool
[
i
].
ipv4
.
c_str
(),
smf_pool
[
i
].
port
.
c_str
(),
smf_pool
[
i
].
id
,
smf_
info
.
c_str
(),
smf_pool
[
i
].
port
.
c_str
(),
smf_pool
[
i
].
version
.
c_str
(),
selected
.
c_str
());
smf_pool
[
i
].
version
.
c_str
(),
selected
.
c_str
());
}
}
}
}
...
...
src/amf-app/amf_config.hpp
View file @
bfef8dcf
...
@@ -168,6 +168,7 @@ typedef struct {
...
@@ -168,6 +168,7 @@ typedef struct {
std
::
string
port
;
std
::
string
port
;
std
::
string
version
;
std
::
string
version
;
bool
selected
;
bool
selected
;
std
::
string
fqdn
;
}
smf_inst_t
;
}
smf_inst_t
;
class
amf_config
{
class
amf_config
{
...
...
src/amf-app/amf_n11.cpp
View file @
bfef8dcf
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
#include "SmContextCreateData.h"
#include "SmContextCreateData.h"
#include "mime_parser.hpp"
#include "mime_parser.hpp"
#include "ue_context.hpp"
#include "ue_context.hpp"
#include "fqdn.hpp"
extern
"C"
{
extern
"C"
{
#include "dynamic_memory_check.h"
#include "dynamic_memory_check.h"
...
@@ -472,9 +473,27 @@ bool amf_n11::smf_selection_from_configuration(
...
@@ -472,9 +473,27 @@ bool amf_n11::smf_selection_from_configuration(
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
)
{
std
::
string
&
smf_addr
,
std
::
string
&
smf_api_version
)
{
for
(
int
i
=
0
;
i
<
amf_cfg
.
smf_pool
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
amf_cfg
.
smf_pool
.
size
();
i
++
)
{
if
(
amf_cfg
.
smf_pool
[
i
].
selected
)
{
if
(
amf_cfg
.
smf_pool
[
i
].
selected
)
{
if
(
!
amf_cfg
.
use_fqdn_dns
)
{
smf_addr
=
amf_cfg
.
smf_pool
[
i
].
ipv4
+
":"
+
amf_cfg
.
smf_pool
[
i
].
port
;
smf_addr
=
amf_cfg
.
smf_pool
[
i
].
ipv4
+
":"
+
amf_cfg
.
smf_pool
[
i
].
port
;
smf_api_version
=
amf_cfg
.
smf_pool
[
i
].
version
;
smf_api_version
=
amf_cfg
.
smf_pool
[
i
].
version
;
return
true
;
return
true
;
}
else
{
// resolve IP addr from a FQDN/DNS name
uint8_t
addr_type
=
0
;
uint32_t
smf_port
=
0
;
fqdn
::
resolve
(
amf_cfg
.
smf_pool
[
i
].
fqdn
,
amf_cfg
.
smf_pool
[
i
].
ipv4
,
smf_port
,
addr_type
);
if
(
addr_type
!=
0
)
{
// IPv6: TODO
Logger
::
amf_n11
().
warn
(
"Do not support IPv6 Addr for SMF"
);
return
false
;
}
else
{
// IPv4
smf_addr
=
amf_cfg
.
smf_pool
[
i
].
ipv4
+
":"
+
std
::
to_string
(
smf_port
);
smf_api_version
=
"v1"
;
// TODO: get API version
return
true
;
}
}
return
true
;
}
}
}
}
return
false
;
return
false
;
...
...
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