Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDR
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
OpenXG
OpenXG-UDR
Commits
bcec69f5
Commit
bcec69f5
authored
Sep 21, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add API version to sbi interface
parent
5d8d4adf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
src/udr_app/udr_config.cpp
src/udr_app/udr_config.cpp
+10
-10
src/udr_app/udr_config.hpp
src/udr_app/udr_config.hpp
+4
-4
No files found.
src/udr_app/udr_config.cpp
View file @
bcec69f5
...
...
@@ -40,7 +40,7 @@ namespace config {
//------------------------------------------------------------------------------
udr_config
::
udr_config
()
:
mysql
(),
instance
(),
pid_dir
(),
nudr
()
{
nudr_http2_port
=
8080
;
nudr
_
api_version
=
"v1"
;
nudr
.
api_version
=
"v1"
;
}
//------------------------------------------------------------------------------
...
...
@@ -97,12 +97,6 @@ int udr_config::load(const std ::string &config_file) {
Logger
::
udr_app
().
error
(
UDR_CONFIG_STRING_HTTP2_PORT
"failed"
);
throw
(
UDR_CONFIG_STRING_HTTP2_PORT
"failed"
);
}
// NUDR API VERSION
if
(
!
(
nudr_cfg
.
lookupValue
(
UDR_CONFIG_STRING_API_VERSION
,
nudr_api_version
)))
{
Logger
::
udr_app
().
error
(
UDR_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
UDR_CONFIG_STRING_API_VERSION
"failed"
);
}
}
catch
(
const
SettingNotFoundException
&
nfex
)
{
Logger
::
udr_app
().
error
(
"%s : %s, using defaults"
,
nfex
.
what
(),
...
...
@@ -151,7 +145,7 @@ int udr_config::load_interface(const libconfig::Setting &if_cfg,
address
.
c_str
());
return
RETURNerror
;
}
unsigned
char
buf_in_addr
[
sizeof
(
struct
in6_addr
)];
// you never know...
unsigned
char
buf_in_addr
[
sizeof
(
struct
in6_addr
)];
// you never know...
if
(
inet_pton
(
AF_INET
,
util
::
trim
(
words
.
at
(
0
)).
c_str
(),
buf_in_addr
)
==
1
)
{
memcpy
(
&
cfg
.
addr4
,
buf_in_addr
,
sizeof
(
struct
in_addr
));
...
...
@@ -167,6 +161,12 @@ int udr_config::load_interface(const libconfig::Setting &if_cfg,
0xFFFFFFFF
<<
(
32
-
std
::
stoi
(
util
::
trim
(
words
.
at
(
1
)))));
}
if_cfg
.
lookupValue
(
UDR_CONFIG_STRING_PORT
,
cfg
.
port
);
// API VERSION
if
(
!
(
if_cfg
.
lookupValue
(
UDR_CONFIG_STRING_API_VERSION
,
cfg
.
api_version
)))
{
Logger
::
udr_app
().
error
(
UDR_CONFIG_STRING_API_VERSION
"failed"
);
throw
(
UDR_CONFIG_STRING_API_VERSION
"failed"
);
}
}
return
RETURNok
;
}
...
...
@@ -190,7 +190,7 @@ void udr_config::display() {
Logger
::
config
().
info
(
" Port ................: %d"
,
nudr
.
port
);
Logger
::
config
().
info
(
" HTTP2 port ..........: %d"
,
nudr_http2_port
);
Logger
::
config
().
info
(
" API version..........: %s"
,
nudr
_
api_version
.
c_str
());
nudr
.
api_version
.
c_str
());
Logger
::
config
().
info
(
"- MYSQL Server Addr...................................: %s"
,
...
...
@@ -206,4 +206,4 @@ void udr_config::display() {
mysql
.
mysql_db
.
c_str
());
}
}
// namespace config
}
// namespace config
src/udr_app/udr_config.hpp
View file @
bcec69f5
...
...
@@ -23,8 +23,8 @@
#define _UDR_CONFIG_H_
#include <arpa/inet.h>
#include <libconfig.h++>
#include <netinet/in.h>
#include <libconfig.h++>
#include <string>
#define UDR_CONFIG_STRING_UDR_CONFIG "UDR"
...
...
@@ -62,11 +62,12 @@ typedef struct interface_cfg_s {
struct
in6_addr
addr6
;
unsigned
int
mtu
;
unsigned
int
port
;
std
::
string
api_version
;
}
interface_cfg_t
;
class
udr_config
{
public:
public:
udr_config
();
~
udr_config
();
...
...
@@ -78,10 +79,9 @@ public:
std
::
string
pid_dir
;
interface_cfg_t
nudr
;
unsigned
int
nudr_http2_port
;
std
::
string
nudr_api_version
;
mysql_conf_t
mysql
;
};
}
// namespace config
}
// namespace config
#endif
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