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-Simple
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
CommunityXG
OpenXG-AMF-Simple
Commits
6bb7a6c6
Commit
6bb7a6c6
authored
Aug 18, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add N11 interface
parent
b67b2482
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
4 deletions
+23
-4
etc/amf.conf
etc/amf.conf
+4
-1
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+16
-1
src/amf-app/amf_config.hpp
src/amf-app/amf_config.hpp
+2
-1
src/oai-amf/main.cpp
src/oai-amf/main.cpp
+1
-1
No files found.
etc/amf.conf
View file @
6bb7a6c6
...
@@ -47,10 +47,13 @@ AMF =
...
@@ -47,10 +47,13 @@ AMF =
NGAP_AMF
:{
NGAP_AMF
:{
INTERFACE_NAME
=
"ens3"
;
INTERFACE_NAME
=
"ens3"
;
IPV4_ADDRESS
=
"read"
;
IPV4_ADDRESS
=
"read"
;
SCTP_
PORT
=
38412
;
PORT
=
38412
;
PPID
=
60
;
PPID
=
60
;
};
};
N11
:{
N11
:{
INTERFACE_NAME
=
"ens3"
;
IPV4_ADDRESS
=
"read"
;
HTTP_PORT
=
80
;
SMF_INSTANCES_POOL
= (
SMF_INSTANCES_POOL
= (
{
SMF_INSTANCE_ID
=
1
;
IPV4_ADDRESS
=
"192.168.122.168"
;
PORT
=
"80"
;
VERSION
=
"v2"
;
SELECTED
=
"true"
},
{
SMF_INSTANCE_ID
=
1
;
IPV4_ADDRESS
=
"192.168.122.168"
;
PORT
=
"80"
;
VERSION
=
"v2"
;
SELECTED
=
"true"
},
{
SMF_INSTANCE_ID
=
2
;
IPV4_ADDRESS
=
"10.103.238.21"
;
PORT
=
"8181"
;
VERSION
=
"v1"
;
SELECTED
=
"false"
}
{
SMF_INSTANCE_ID
=
2
;
IPV4_ADDRESS
=
"10.103.238.21"
;
PORT
=
"8181"
;
VERSION
=
"v1"
;
SELECTED
=
"false"
}
...
...
src/amf-app/amf_config.cpp
View file @
6bb7a6c6
...
@@ -53,6 +53,7 @@ namespace config {
...
@@ -53,6 +53,7 @@ namespace config {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
amf_config
::
amf_config
()
{
amf_config
::
amf_config
()
{
//TODO:
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -160,6 +161,7 @@ int amf_config::load(const std::string &config_file) {
...
@@ -160,6 +161,7 @@ int amf_config::load(const std::string &config_file) {
const
Setting
&
n2_amf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_INTERFACE_NGAP_AMF
];
const
Setting
&
n2_amf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_INTERFACE_NGAP_AMF
];
load_interface
(
n2_amf_cfg
,
n2
);
load_interface
(
n2_amf_cfg
,
n2
);
const
Setting
&
n11_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_INTERFACE_N11
];
const
Setting
&
n11_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_INTERFACE_N11
];
load_interface
(
n11_cfg
,
n11
);
const
Setting
&
smf_addr_pool
=
n11_cfg
[
AMF_CONFIG_STRING_SMF_INSTANCES_POOL
];
const
Setting
&
smf_addr_pool
=
n11_cfg
[
AMF_CONFIG_STRING_SMF_INSTANCES_POOL
];
int
count
=
smf_addr_pool
.
getLength
();
int
count
=
smf_addr_pool
.
getLength
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
...
@@ -268,6 +270,19 @@ void amf_config::display() {
...
@@ -268,6 +270,19 @@ void amf_config::display() {
Logger
::
config
().
info
(
"- MYSQL db ...........................................: %s"
,
auth_para
.
mysql_db
.
c_str
());
Logger
::
config
().
info
(
"- MYSQL db ...........................................: %s"
,
auth_para
.
mysql_db
.
c_str
());
Logger
::
config
().
info
(
"- operator key .......................................: %s"
,
auth_para
.
operator_key
.
c_str
());
Logger
::
config
().
info
(
"- operator key .......................................: %s"
,
auth_para
.
operator_key
.
c_str
());
Logger
::
config
().
info
(
"- random .............................................: %s"
,
auth_para
.
random
.
c_str
());
Logger
::
config
().
info
(
"- random .............................................: %s"
,
auth_para
.
random
.
c_str
());
Logger
::
config
().
info
(
"- N2 Networking:"
);
Logger
::
config
().
info
(
" iface ................: %s"
,
n2
.
if_name
.
c_str
());
Logger
::
config
().
info
(
" ip ...................: %s"
,
inet_ntoa
(
n2
.
addr4
));
Logger
::
config
().
info
(
" port .................: %d"
,
n2
.
port
);
Logger
::
config
().
info
(
"- N11 Networking:"
);
Logger
::
config
().
info
(
" iface ................: %s"
,
n11
.
if_name
.
c_str
());
Logger
::
config
().
info
(
" ip ...................: %s"
,
inet_ntoa
(
n11
.
addr4
));
Logger
::
config
().
info
(
" port .................: %d"
,
n11
.
port
);
// Logger::config().info(" HTTP2 port ............: %d", n11_http2_port);
Logger
::
config
().
info
(
"- Remote SMF Pool.....................................: "
);
Logger
::
config
().
info
(
"- Remote 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
;
...
@@ -308,7 +323,7 @@ int amf_config::load_interface(const libconfig::Setting &if_cfg, interface_cfg_t
...
@@ -308,7 +323,7 @@ int amf_config::load_interface(const libconfig::Setting &if_cfg, interface_cfg_t
}
}
cfg
.
network4
.
s_addr
=
htons
(
ntohs
(
cfg
.
addr4
.
s_addr
)
&
0xFFFFFFFF
<<
(
32
-
std
::
stoi
(
util
::
trim
(
words
.
at
(
1
)))));
cfg
.
network4
.
s_addr
=
htons
(
ntohs
(
cfg
.
addr4
.
s_addr
)
&
0xFFFFFFFF
<<
(
32
-
std
::
stoi
(
util
::
trim
(
words
.
at
(
1
)))));
}
}
if_cfg
.
lookupValue
(
AMF_CONFIG_STRING_
SCTP_
PORT
,
cfg
.
port
);
if_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PORT
,
cfg
.
port
);
try
{
try
{
const
Setting
&
sched_params_cfg
=
if_cfg
[
AMF_CONFIG_STRING_SCHED_PARAMS
];
const
Setting
&
sched_params_cfg
=
if_cfg
[
AMF_CONFIG_STRING_SCHED_PARAMS
];
...
...
src/amf-app/amf_config.hpp
View file @
6bb7a6c6
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
#define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF"
#define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF"
#define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define AMF_CONFIG_STRING_
SCTP_PORT "SCTP_
PORT"
#define AMF_CONFIG_STRING_
PORT "
PORT"
#define AMF_CONFIG_STRING_PPID "PPID"
#define AMF_CONFIG_STRING_PPID "PPID"
#define AMF_CONFIG_STRING_INTERFACE_N11 "N11"
#define AMF_CONFIG_STRING_INTERFACE_N11 "N11"
...
@@ -171,6 +171,7 @@ class amf_config {
...
@@ -171,6 +171,7 @@ class amf_config {
unsigned
int
instance
;
unsigned
int
instance
;
std
::
string
pid_dir
;
std
::
string
pid_dir
;
interface_cfg_t
n2
;
interface_cfg_t
n2
;
interface_cfg_t
n11
;
itti_cfg_t
itti
;
itti_cfg_t
itti
;
unsigned
int
statistics_interval
;
unsigned
int
statistics_interval
;
std
::
string
AMF_Name
;
std
::
string
AMF_Name
;
...
...
src/oai-amf/main.cpp
View file @
6bb7a6c6
...
@@ -64,7 +64,7 @@ if (!Options::parse(argc, argv)) {
...
@@ -64,7 +64,7 @@ if (!Options::parse(argc, argv)) {
amf_app_inst
->
allRegistredModulesInit
(
modules
);
amf_app_inst
->
allRegistredModulesInit
(
modules
);
Logger
::
amf_app
().
debug
(
"Initiating AMF server endpoints"
);
Logger
::
amf_app
().
debug
(
"Initiating AMF server endpoints"
);
Pistache
::
Address
addr
(
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
amf_cfg
.
n
2
.
addr4
)))
,
Pistache
::
Port
(
80
));
Pistache
::
Address
addr
(
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
amf_cfg
.
n
11
.
addr4
)))
,
Pistache
::
Port
(
amf_cfg
.
n11
.
port
));
AMFApiServer
amfApiServer
(
addr
,
amf_app_inst
);
AMFApiServer
amfApiServer
(
addr
,
amf_app_inst
);
amfApiServer
.
init
(
2
);
amfApiServer
.
init
(
2
);
std
::
thread
amf_api_manager
(
&
AMFApiServer
::
start
,
amfApiServer
);
std
::
thread
amf_api_manager
(
&
AMFApiServer
::
start
,
amfApiServer
);
...
...
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