Commit 2f1e8ef3 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'add_debug_info' into 'develop'

Add debug info

See merge request oai/cn5g/oai-cn5g-nrf!6
parents 4982e0da 836fd33b
...@@ -71,6 +71,7 @@ typedef struct audience_s { ...@@ -71,6 +71,7 @@ typedef struct audience_s {
// TODO: // TODO:
} }
} }
return *this;
// TODO: // TODO:
} }
......
...@@ -86,6 +86,7 @@ typedef struct subscription_condition_api_s { ...@@ -86,6 +86,7 @@ typedef struct subscription_condition_api_s {
subscription_condition_api_s& operator=(subscription_condition_api_s& s) { subscription_condition_api_s& operator=(subscription_condition_api_s& s) {
// TODO: // TODO:
return *this;
} }
friend void to_json( friend void to_json(
......
...@@ -191,6 +191,7 @@ typedef struct subscription_condition_s { ...@@ -191,6 +191,7 @@ typedef struct subscription_condition_s {
// TODO: // TODO:
} }
} }
return *this;
// TODO: // TODO:
} }
...@@ -258,6 +259,7 @@ typedef struct nf_service_version_s { ...@@ -258,6 +259,7 @@ typedef struct nf_service_version_s {
nf_service_version_s& operator=(const nf_service_version_s& s) { nf_service_version_s& operator=(const nf_service_version_s& s) {
api_version_in_uri = s.api_version_in_uri; api_version_in_uri = s.api_version_in_uri;
api_full_version = s.api_full_version; api_full_version = s.api_full_version;
return *this;
} }
std::string to_string() const { std::string to_string() const {
......
...@@ -80,12 +80,15 @@ nrf_app::nrf_app(const std::string& config_file, nrf_event& ev) ...@@ -80,12 +80,15 @@ nrf_app::nrf_app(const std::string& config_file, nrf_event& ev)
Logger::nrf_app().startup("Started"); Logger::nrf_app().startup("Started");
} }
//------------------------------------------------------------------------------
nrf_app::~nrf_app() { nrf_app::~nrf_app() {
Logger::nrf_app().debug("Delete NRF_APP instance..."); Logger::nrf_app().debug("Delete NRF_APP instance...");
for (auto i : connections) { for (auto i : connections) {
if (i.connected()) i.disconnect(); if (i.connected()) i.disconnect();
} }
if (nrf_client_inst) delete nrf_client_inst; if (nrf_client_inst) delete nrf_client_inst;
if (nrf_jwt_inst) delete nrf_jwt_inst;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -106,7 +109,7 @@ void nrf_app::handle_register_nf_instance( ...@@ -106,7 +109,7 @@ void nrf_app::handle_register_nf_instance(
// Check if nfInstanceID is a valid UUID (version 4) // Check if nfInstanceID is a valid UUID (version 4)
if (!api_conv::validate_uuid(nf_instance_id)) { if (!api_conv::validate_uuid(nf_instance_id)) {
http_code = HTTP_STATUS_CODE_400_BAD_REQUEST; http_code = HTTP_STATUS_CODE_400_BAD_REQUEST;
Logger::nrf_app().debug( Logger::nrf_app().info(
"Bad UUID format for NF Instance ID (%s)", nf_instance_id.c_str()); "Bad UUID format for NF Instance ID (%s)", nf_instance_id.c_str());
problem_details.setCause( problem_details.setCause(
protocol_application_error_e2str[MANDATORY_QUERY_PARAM_INCORRECT]); protocol_application_error_e2str[MANDATORY_QUERY_PARAM_INCORRECT]);
...@@ -148,7 +151,8 @@ void nrf_app::handle_register_nf_instance( ...@@ -148,7 +151,8 @@ void nrf_app::handle_register_nf_instance(
http_code = HTTP_STATUS_CODE_201_CREATED; http_code = HTTP_STATUS_CODE_201_CREATED;
// add to the DB // add to the DB
add_nf_profile(nf_instance_id, sn); add_nf_profile(nf_instance_id, sn);
Logger::nrf_app().debug("Added/Updated NF Profile to the DB"); Logger::nrf_app().info(
"Added/Updated NF Profile (ID %s) to the DB", nf_instance_id.c_str());
// Heartbeart management for this NF profile // Heartbeart management for this NF profile
// get current time // get current time
...@@ -210,7 +214,7 @@ void nrf_app::handle_update_nf_instance( ...@@ -210,7 +214,7 @@ void nrf_app::handle_update_nf_instance(
case PATCH_OP_REPLACE: { case PATCH_OP_REPLACE: {
if (path.compare("nfStatus") == 0) { if (path.compare("nfStatus") == 0) {
is_heartbeart_procedure = true; is_heartbeart_procedure = true;
Logger::nrf_app().debug("NF Heart-Beat procedure!"); Logger::nrf_app().info("NF Heart-Beat procedure!");
} }
if (sn.get()->replace_profile_info(path, p.getValue())) { if (sn.get()->replace_profile_info(path, p.getValue())) {
update_nf_profile(nf_instance_id, sn); update_nf_profile(nf_instance_id, sn);
...@@ -352,7 +356,7 @@ void nrf_app::handle_get_nf_instance( ...@@ -352,7 +356,7 @@ void nrf_app::handle_get_nf_instance(
profile = find_nf_profile(nf_instance_id); profile = find_nf_profile(nf_instance_id);
if (profile.get() == nullptr) { if (profile.get() == nullptr) {
Logger::nrf_app().debug( Logger::nrf_app().info(
"Profile with profile ID %s not found", nf_instance_id.c_str()); "Profile with profile ID %s not found", nf_instance_id.c_str());
http_code = HTTP_STATUS_CODE_404_NOT_FOUND; http_code = HTTP_STATUS_CODE_404_NOT_FOUND;
problem_details.setCause( problem_details.setCause(
...@@ -383,7 +387,7 @@ void nrf_app::handle_deregister_nf_instance( ...@@ -383,7 +387,7 @@ void nrf_app::handle_deregister_nf_instance(
m_event_sub.nf_status_deregistered(profile); // from nrf_app m_event_sub.nf_status_deregistered(profile); // from nrf_app
if (remove_nf_profile(nf_instance_id)) { if (remove_nf_profile(nf_instance_id)) {
Logger::nrf_app().debug( Logger::nrf_app().info(
"Removed NF profile with profile ID %s", nf_instance_id.c_str()); "Removed NF profile with profile ID %s", nf_instance_id.c_str());
http_code = HTTP_STATUS_CODE_204_NO_CONTENT; http_code = HTTP_STATUS_CODE_204_NO_CONTENT;
return; return;
...@@ -394,7 +398,7 @@ void nrf_app::handle_deregister_nf_instance( ...@@ -394,7 +398,7 @@ void nrf_app::handle_deregister_nf_instance(
return; return;
} }
} else { } else {
Logger::nrf_app().debug( Logger::nrf_app().info(
"Profile with profile ID %s not found", nf_instance_id.c_str()); "Profile with profile ID %s not found", nf_instance_id.c_str());
http_code = HTTP_STATUS_CODE_404_NOT_FOUND; http_code = HTTP_STATUS_CODE_404_NOT_FOUND;
problem_details.setCause( problem_details.setCause(
...@@ -1017,7 +1021,7 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) { ...@@ -1017,7 +1021,7 @@ void nrf_app::handle_nf_status_profile_changed(const std::string& profile_id) {
void nrf_app::get_subscription_list( void nrf_app::get_subscription_list(
const std::string& profile_id, const uint8_t& notification_type, const std::string& profile_id, const uint8_t& notification_type,
std::vector<std::string>& uris) const { std::vector<std::string>& uris) const {
Logger::nrf_app().debug( Logger::nrf_app().info(
"\tGet the list of subscriptions related to this profile, profile id %s", "\tGet the list of subscriptions related to this profile, profile id %s",
profile_id.c_str()); profile_id.c_str());
...@@ -1074,7 +1078,7 @@ void nrf_app::get_subscription_list( ...@@ -1074,7 +1078,7 @@ void nrf_app::get_subscription_list(
std::string nf_type = nf_type_e2str[profile.get()->get_nf_type()]; std::string nf_type = nf_type_e2str[profile.get()->get_nf_type()];
if (nf_type.compare(condition.nf_type) == 0) { if (nf_type.compare(condition.nf_type) == 0) {
uris.push_back(uri); uris.push_back(uri);
Logger::nrf_app().debug( Logger::nrf_app().info(
"\tSubscription id %s, uri %s", s.first.c_str(), uri.c_str()); "\tSubscription id %s, uri %s", s.first.c_str(), uri.c_str());
} }
} break; } break;
......
...@@ -54,6 +54,7 @@ bool nrf_jwt::generate_signature( ...@@ -54,6 +54,7 @@ bool nrf_jwt::generate_signature(
// Get the encoded string/assertion // Get the encoded string/assertion
signature = obj.signature(); signature = obj.signature();
return true;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -75,6 +76,7 @@ bool nrf_jwt::generate_signature( ...@@ -75,6 +76,7 @@ bool nrf_jwt::generate_signature(
// Get the encoded string/assertion // Get the encoded string/assertion
signature = obj.signature(); signature = obj.signature();
return true;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -83,6 +85,7 @@ bool nrf_jwt::get_secret_key( ...@@ -83,6 +85,7 @@ bool nrf_jwt::get_secret_key(
const std::string& target_nf_type, std::string& key) const { const std::string& target_nf_type, std::string& key) const {
// TODO: // TODO:
key = "secret"; key = "secret";
return true;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -91,6 +94,7 @@ bool nrf_jwt::get_secret_key( ...@@ -91,6 +94,7 @@ bool nrf_jwt::get_secret_key(
std::string& key) const { std::string& key) const {
// TODO: // TODO:
key = "secret"; key = "secret";
return true;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment