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
5ad768b6
Commit
5ad768b6
authored
Aug 11, 2021
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add_debug_info' into 'develop'
Add debug info See merge request oai/cn5g/oai-cn5g-udr!6
parents
cb863684
2be41e2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
src/udr_app/udr_app.cpp
src/udr_app/udr_app.cpp
+31
-14
No files found.
src/udr_app/udr_app.cpp
View file @
5ad768b6
...
...
@@ -696,7 +696,9 @@ void udr_app::handle_create_authentication_status(const std::string &ue_id,
const
AuthEvent
&
authEvent
,
nlohmann
::
json
&
response_data
,
Pistache
::
Http
::
Code
&
code
)
{
MYSQL_RES
*
res
=
NULL
;
Logger
::
udr_server
().
info
(
"Handle Create Authentication Status"
);
MYSQL_RES
*
res
=
nullptr
;
MYSQL_ROW
row
=
{};
const
std
::
string
select_AuthenticationStatus
=
...
...
@@ -704,6 +706,9 @@ void udr_app::handle_create_authentication_status(const std::string &ue_id,
std
::
string
query
=
{};
nlohmann
::
json
j
=
{};
Logger
::
udr_server
().
info
(
"MySQL query: %s"
,
select_AuthenticationStatus
.
c_str
());
if
(
mysql_real_query
(
&
mysql
,
select_AuthenticationStatus
.
c_str
(),
(
unsigned
long
)
select_AuthenticationStatus
.
size
()))
{
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
...
...
@@ -746,6 +751,8 @@ void udr_app::handle_create_authentication_status(const std::string &ue_id,
// query += ",authType='"+j.dump()+"'";
}
Logger
::
udr_server
().
info
(
"MySQL query: %s"
,
query
.
c_str
());
mysql_free_result
(
res
);
if
(
mysql_real_query
(
&
mysql
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
Logger
::
udr_server
().
error
(
"mysql create failure!SQL(%s)"
,
query
.
c_str
());
...
...
@@ -756,8 +763,8 @@ void udr_app::handle_create_authentication_status(const std::string &ue_id,
code
=
Pistache
::
Http
::
Code
::
No_Content
;
to_json
(
j
,
authEvent
);
Logger
::
udr_server
().
debug
(
"AuthenticationStatus PUT - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
Logger
::
udr_server
().
info
(
"AuthenticationStatus PUT - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
}
//------------------------------------------------------------------------------
...
...
@@ -782,7 +789,8 @@ void udr_app::handle_delete_authentication_status(const std::string &ue_id,
void
udr_app
::
handle_query_authentication_status
(
const
std
::
string
&
ue_id
,
nlohmann
::
json
&
response_data
,
Pistache
::
Http
::
Code
&
code
)
{
MYSQL_RES
*
res
=
NULL
;
Logger
::
udr_server
().
info
(
"Handle Query Authentication Status"
);
MYSQL_RES
*
res
=
nullptr
;
MYSQL_ROW
row
=
{};
MYSQL_FIELD
*
field
=
nullptr
;
nlohmann
::
json
j
=
{};
...
...
@@ -790,6 +798,7 @@ void udr_app::handle_query_authentication_status(const std::string &ue_id,
const
std
::
string
query
=
"select * from AuthenticationStatus WHERE ueid='"
+
ue_id
+
"'"
;
Logger
::
udr_server
().
info
(
"MySQL query: %s"
,
query
.
c_str
());
if
(
mysql_real_query
(
&
mysql
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
query
.
c_str
());
...
...
@@ -832,8 +841,8 @@ void udr_app::handle_query_authentication_status(const std::string &ue_id,
response_data
=
j
;
code
=
Pistache
::
Http
::
Code
::
Ok
;
Logger
::
udr_server
().
debug
(
"AuthenticationStatus GET - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
Logger
::
udr_server
().
info
(
"AuthenticationStatus GET - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
}
else
{
Logger
::
udr_server
().
error
(
"AuthenticationStatus no data!SQL(%s)"
,
query
.
c_str
());
...
...
@@ -846,11 +855,16 @@ void udr_app::handle_query_authentication_status(const std::string &ue_id,
void
udr_app
::
handle_modify_authentication_subscription
(
const
std
::
string
&
ue_id
,
const
std
::
vector
<
PatchItem
>
&
patchItem
,
nlohmann
::
json
&
response_data
,
Pistache
::
Http
::
Code
&
code
)
{
MYSQL_RES
*
res
=
NULL
;
Logger
::
udr_server
().
info
(
"Handle Update Authentication Subscription"
);
MYSQL_RES
*
res
=
nullptr
;
MYSQL_ROW
row
=
{};
const
std
::
string
select_Authenticationsubscription
=
"select * from AuthenticationSubscription WHERE ueid='"
+
ue_id
+
"'"
;
Logger
::
udr_server
().
info
(
"MySQL Query (%s)"
,
select_Authenticationsubscription
.
c_str
());
std
::
string
query
=
{};
nlohmann
::
json
j
=
{};
nlohmann
::
json
tmp_j
=
{};
...
...
@@ -890,10 +904,11 @@ void udr_app::handle_modify_authentication_subscription(
select_Authenticationsubscription
.
c_str
());
}
Logger
::
udr_server
().
info
(
"MySQL Update cmd (%s)"
,
query
.
c_str
());
mysql_free_result
(
res
);
if
(
mysql_real_query
(
&
mysql
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
(
unsigned
long
)
query
.
size
())
!=
0
)
{
Logger
::
udr_server
().
error
(
"update mysql failure!SQL(%s)"
,
query
.
c_str
());
return
;
...
...
@@ -904,8 +919,8 @@ void udr_app::handle_modify_authentication_subscription(
j
+=
tmp_j
;
}
Logger
::
udr_server
().
debug
(
"AuthenticationSubscription PATCH - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
Logger
::
udr_server
().
info
(
"AuthenticationSubscription PATCH - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
response_data
=
{};
code
=
Pistache
::
Http
::
Code
::
No_Content
;
...
...
@@ -915,14 +930,16 @@ void udr_app::handle_modify_authentication_subscription(
void
udr_app
::
handle_read_authentication_subscription
(
const
std
::
string
&
ue_id
,
nlohmann
::
json
&
response_data
,
Pistache
::
Http
::
Code
&
code
)
{
MYSQL_RES
*
res
=
NULL
;
Logger
::
udr_server
().
info
(
"Handle Read Authentication Subscription"
);
MYSQL_RES
*
res
=
nullptr
;
MYSQL_ROW
row
=
{};
MYSQL_FIELD
*
field
=
nullptr
;
nlohmann
::
json
j
=
{};
AuthenticationSubscription
authenticationsubscription
;
AuthenticationSubscription
authenticationsubscription
=
{}
;
const
std
::
string
query
=
"select * from AuthenticationSubscription WHERE ueid='"
+
ue_id
+
"'"
;
Logger
::
udr_server
().
info
(
"MySQL Query (%s)"
,
query
.
c_str
());
if
(
mysql_real_query
(
&
mysql
,
query
.
c_str
(),
(
unsigned
long
)
query
.
size
()))
{
Logger
::
udr_server
().
error
(
"mysql_real_query failure!SQL(%s)"
,
...
...
@@ -990,8 +1007,8 @@ void udr_app::handle_read_authentication_subscription(
response_data
=
j
;
code
=
Pistache
::
Http
::
Code
::
Ok
;
Logger
::
udr_server
().
debug
(
"AuthenticationSubscription GET - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
Logger
::
udr_server
().
info
(
"AuthenticationSubscription GET - json:
\n\"
%s
\"
"
,
j
.
dump
().
c_str
());
}
else
{
Logger
::
udr_server
().
error
(
"AuthenticationSubscription no data!SQL(%s)"
,
query
.
c_str
());
...
...
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