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
47da9a26
Commit
47da9a26
authored
Aug 30, 2021
by
Mohammed Ismail
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fqdn_ausf' into 'develop'
Support FQDN for AUSF See merge request oai/cn5g/oai-cn5g-amf!52
parents
4ed0fefa
eedb57aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
28 deletions
+48
-28
ci-scripts/dsTesterDockerCompose/docker-compose.tplt
ci-scripts/dsTesterDockerCompose/docker-compose.tplt
+1
-0
etc/amf.conf
etc/amf.conf
+2
-1
src/amf-app/amf_config.cpp
src/amf-app/amf_config.cpp
+45
-27
No files found.
ci-scripts/dsTesterDockerCompose/docker-compose.tplt
View file @
47da9a26
...
@@ -84,6 +84,7 @@ services:
...
@@ -84,6 +84,7 @@ services:
- AUSF_IPV4_ADDRESS=0.0.0.0
- AUSF_IPV4_ADDRESS=0.0.0.0
- AUSF_PORT=80
- AUSF_PORT=80
- AUSF_API_VERSION=v1
- AUSF_API_VERSION=v1
- AUSF_FQDN=localhost
depends_on:
depends_on:
- cicd_mysql
- cicd_mysql
networks:
networks:
...
...
etc/amf.conf
View file @
47da9a26
...
@@ -85,7 +85,7 @@ AMF =
...
@@ -85,7 +85,7 @@ AMF =
IPV4_ADDRESS
=
"@NRF_IPV4_ADDRESS@"
;
# YOUR NRF CONFIG HERE
IPV4_ADDRESS
=
"@NRF_IPV4_ADDRESS@"
;
# YOUR NRF CONFIG HERE
PORT
= @
NRF_PORT
@;
# YOUR NRF CONFIG HERE (default: 80)
PORT
= @
NRF_PORT
@;
# YOUR NRF CONFIG HERE (default: 80)
API_VERSION
=
"@NRF_API_VERSION@"
;
# YOUR NRF API VERSION FOR SBI CONFIG HERE
API_VERSION
=
"@NRF_API_VERSION@"
;
# YOUR NRF API VERSION FOR SBI CONFIG HERE
FQDN
=
"@NRF_FQDN@"
FQDN
=
"@NRF_FQDN@"
# YOUR NRF FQDN CONFIG HERE
};
};
AUSF
:
AUSF
:
...
@@ -93,6 +93,7 @@ AMF =
...
@@ -93,6 +93,7 @@ AMF =
IPV4_ADDRESS
=
"@AUSF_IPV4_ADDRESS@"
;
# YOUR AUSF CONFIG HERE
IPV4_ADDRESS
=
"@AUSF_IPV4_ADDRESS@"
;
# YOUR AUSF CONFIG HERE
PORT
= @
AUSF_PORT
@;
# YOUR AUSF CONFIG HERE (default: 80)
PORT
= @
AUSF_PORT
@;
# YOUR AUSF CONFIG HERE (default: 80)
API_VERSION
=
"@AUSF_API_VERSION@"
;
# YOUR AUSF API VERSION FOR SBI CONFIG HERE
API_VERSION
=
"@AUSF_API_VERSION@"
;
# YOUR AUSF API VERSION FOR SBI CONFIG HERE
FQDN
=
"@AUSF_FQDN@"
# YOUR AUSF FQDN CONFIG HERE
};
};
};
};
...
...
src/amf-app/amf_config.cpp
View file @
47da9a26
...
@@ -132,7 +132,7 @@ int amf_config::load(const std::string& config_file) {
...
@@ -132,7 +132,7 @@ int amf_config::load(const std::string& config_file) {
const
Setting
&
amf_cfg
=
root
[
AMF_CONFIG_STRING_AMF_CONFIG
];
const
Setting
&
amf_cfg
=
root
[
AMF_CONFIG_STRING_AMF_CONFIG
];
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
"%s : %s"
,
nfex
.
what
(),
nfex
.
getPath
());
Logger
::
amf_app
().
error
(
"%s : %s"
,
nfex
.
what
(),
nfex
.
getPath
());
return
-
1
;
return
RETURNerror
;
}
}
// Instance
// Instance
...
@@ -286,7 +286,7 @@ int amf_config::load(const std::string& config_file) {
...
@@ -286,7 +286,7 @@ int amf_config::load(const std::string& config_file) {
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
return
-
1
;
return
RETURNerror
;
}
}
// Network interfaces
// Network interfaces
...
@@ -399,34 +399,52 @@ int amf_config::load(const std::string& config_file) {
...
@@ -399,34 +399,52 @@ int amf_config::load(const std::string& config_file) {
}
}
// AUSF
// AUSF
// TODO: add FQDN option
if
(
enable_external_ausf
)
{
const
Setting
&
ausf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_AUSF
];
const
Setting
&
ausf_cfg
=
new_if_cfg
[
AMF_CONFIG_STRING_AUSF
];
struct
in_addr
ausf_ipv4_addr
=
{};
struct
in_addr
ausf_ipv4_addr
=
{};
unsigned
int
ausf_port
=
{};
unsigned
int
ausf_port
=
{};
std
::
string
ausf_api_version
=
{};
std
::
string
ausf_api_version
=
{};
ausf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_IPV4_ADDRESS
,
address
);
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
address
).
c_str
(),
ausf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR AUSF !"
);
ausf_addr
.
ipv4_addr
=
ausf_ipv4_addr
;
if
(
!
(
ausf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PORT
,
ausf_port
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_PORT
"failed"
);
throw
(
AMF_CONFIG_STRING_PORT
"failed"
);
}
ausf_addr
.
port
=
ausf_port
;
if
(
!
(
ausf_cfg
.
lookupValue
(
if
(
!
use_fqdn_dns
)
{
AMF_CONFIG_STRING_API_VERSION
,
ausf_api_version
)))
{
ausf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_IPV4_ADDRESS
,
address
);
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
IPV4_STR_ADDR_TO_INADDR
(
throw
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
util
::
trim
(
address
).
c_str
(),
ausf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR AUSF !"
);
ausf_addr
.
ipv4_addr
=
ausf_ipv4_addr
;
if
(
!
(
ausf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_PORT
,
ausf_port
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_PORT
"failed"
);
throw
(
AMF_CONFIG_STRING_PORT
"failed"
);
}
ausf_addr
.
port
=
ausf_port
;
if
(
!
(
ausf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_API_VERSION
,
ausf_api_version
)))
{
Logger
::
amf_app
().
error
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
AMF_CONFIG_STRING_API_VERSION
"failed"
);
}
ausf_addr
.
api_version
=
ausf_api_version
;
}
else
{
std
::
string
ausf_fqdn
=
{};
ausf_cfg
.
lookupValue
(
AMF_CONFIG_STRING_FQDN_DNS
,
ausf_fqdn
);
uint8_t
addr_type
=
{};
fqdn
::
resolve
(
ausf_fqdn
,
address
,
ausf_port
,
addr_type
);
if
(
addr_type
!=
0
)
{
// IPv6: TODO
throw
(
"DO NOT SUPPORT IPV6 ADDR FOR AUSF!"
);
}
else
{
// IPv4
IPV4_STR_ADDR_TO_INADDR
(
util
::
trim
(
address
).
c_str
(),
ausf_ipv4_addr
,
"BAD IPv4 ADDRESS FORMAT FOR AUSF !"
);
ausf_addr
.
ipv4_addr
=
ausf_ipv4_addr
;
ausf_addr
.
port
=
ausf_port
;
ausf_addr
.
api_version
=
"v1"
;
// TODO: get API version
}
}
}
}
ausf_addr
.
api_version
=
ausf_api_version
;
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
return
-
1
;
return
RETURNerror
;
}
}
// Emergency support
// Emergency support
...
@@ -437,7 +455,7 @@ int amf_config::load(const std::string& config_file) {
...
@@ -437,7 +455,7 @@ int amf_config::load(const std::string& config_file) {
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
return
-
1
;
return
RETURNerror
;
}
}
// Authentication Info
// Authentication Info
...
@@ -455,7 +473,7 @@ int amf_config::load(const std::string& config_file) {
...
@@ -455,7 +473,7 @@ int amf_config::load(const std::string& config_file) {
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
return
-
1
;
return
RETURNerror
;
}
}
// Integrity/Ciphering algorithms (NAS)
// Integrity/Ciphering algorithms (NAS)
...
@@ -496,7 +514,7 @@ int amf_config::load(const std::string& config_file) {
...
@@ -496,7 +514,7 @@ int amf_config::load(const std::string& config_file) {
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
amf_app
().
error
(
Logger
::
amf_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
"%s : %s, using defaults"
,
nfex
.
what
(),
nfex
.
getPath
());
return
-
1
;
return
RETURNerror
;
}
}
return
1
;
return
1
;
...
...
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