Skip to content
Snippets Groups Projects
Commit 965ac3f4 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen
Browse files

Merge branch 'develop' into fix_exception_handling

parents 27c79fcf 759a0ef7
No related branches found
No related tags found
1 merge request!64Fix exception handling
Showing
with 104 additions and 109 deletions
# CODEOWNERS
- Tien Thinh NGUYEN, Eurecom
- Lionel GAUTHIER , Eurecom
- Rohan KHARADE, OSA
- Sebastien ROUX, Eurecom
- Robert SCHMIDT, Eurecom
- Raphael DEFOSSEUX, OSA
- Stefan Spettel, phine.tech
\ No newline at end of file
......@@ -144,7 +144,6 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
void NFInstanceIDDocumentApiImpl::update_nf_instance(
const std::string& nfInstanceID, const std::vector<PatchItem>& patchItem,
Pistache::Http::ResponseWriter& response) {
Logger::nrf_sbi().info("");
Logger::nrf_sbi().info(
"Got a request to update an NF instance, Instance ID: %s",
nfInstanceID.c_str());
......
......@@ -392,7 +392,6 @@ void nrf_http2_server::get_nf_instances_handler(
void nrf_http2_server::update_instance_handler(
const std::string& nfInstanceID, const std::vector<PatchItem>& patchItem,
const response& response) {
Logger::nrf_sbi().info("");
Logger::nrf_sbi().info(
"Got a request to update an NF instance, Instance ID: %s",
nfInstanceID.c_str());
......@@ -412,13 +411,14 @@ void nrf_http2_server::update_instance_handler(
(http_code != HTTP_STATUS_CODE_204_NO_CONTENT)) {
to_json(json_data, problem_details);
content_type = "application/problem+json";
Logger::nrf_sbi().debug("Json data: %s", json_data.dump().c_str());
} else if (http_code == HTTP_STATUS_CODE_200_OK) {
if (profile.get() != nullptr)
// convert the profile to Json
profile.get()->to_json(json_data);
Logger::nrf_sbi().debug("Json data: %s", json_data.dump().c_str());
}
Logger::nrf_sbi().debug("Json data: %s", json_data.dump().c_str());
header_map h;
h.emplace(
"location", header_value{
......@@ -426,8 +426,11 @@ void nrf_http2_server::update_instance_handler(
nrf_cfg->local().get_sbi().get_api_version() +
"/nf-instances/" + nfInstanceID});
h.emplace("content-type", header_value{content_type});
response.write_head(http_code, h);
response.end(json_data.dump().c_str());
if (http_code != HTTP_STATUS_CODE_204_NO_CONTENT) {
response.end(json_data.dump().c_str());
}
}
void nrf_http2_server::deregister_nf_instance_handler(
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file smf_http2-server.h
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2020
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_NRF_HTTP2_SERVER_SEEN
#define FILE_NRF_HTTP2_SERVER_SEEN
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file 3gpp_23.003.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_3GPP_23_003_SEEN
#define FILE_3GPP_23_003_SEEN
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file common_defs.h
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_COMMON_DEFS_SEEN
#define FILE_COMMON_DEFS_SEEN
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file dynamic_memory_check.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_DYNAMIC_MEMORY_CHECK_SEEN
#define FILE_DYNAMIC_MEMORY_CHECK_SEEN
......
......@@ -49,11 +49,6 @@ typedef enum nf_type_s {
NF_TYPE_UNKNOWN = 21
} nf_type_t;
static const std::vector<std::string> nf_type_e2str = {
"NRF", "UDM", "AMF", "SMF", "AUSF", "NEF", "PCF", "SMSF",
"NSSF", "UDR", "LMF", "GMLC", "5G_EIR", "SEPP", "UPF", "N3IWF",
"AF", "UDSF", "BSF", "CHF", "NWDAF", "UNKNOWN"};
typedef enum patch_op_type_s {
PATCH_OP_ADD = 0,
PATCH_OP_REMOVE = 1,
......@@ -65,9 +60,6 @@ typedef enum patch_op_type_s {
} patch_op_type_t;
static const std::vector<std::string> patch_op_type_e2str = {
"ADD", "REMOVE", "REPLACE", "MOVE", "COPY", "TEST", "UNKNOWN"};
// Event Subscription IDs)
typedef uint32_t evsub_id_t;
#define EVSUB_ID_FMT "0x%" PRIx32
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file api_conversions.cpp
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2020
\email: tien-thinh.nguyen@eurecom.fr
*/
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
......@@ -708,6 +700,78 @@ nf_type_t api_conv::string_to_nf_type(const std::string& str) {
return NF_TYPE_UNKNOWN;
}
//------------------------------------------------------------------------------
std::string api_conv::nf_type_to_string(const nf_type_t& nf_type) {
switch (nf_type) {
case NF_TYPE_NRF: {
return "NRF";
} break;
case NF_TYPE_AMF: {
return "AMF";
} break;
case NF_TYPE_AUSF: {
return "AUSF";
} break;
case NF_TYPE_NEF: {
return "NEF";
} break;
case NF_TYPE_NWDAF: {
return "NWDAF";
} break;
case NF_TYPE_PCF: {
return "PCF";
} break;
case NF_TYPE_NSSF: {
return "NSSF";
} break;
case NF_TYPE_SMF: {
return "SMF";
} break;
case NF_TYPE_UDM: {
return "UDM";
} break;
case NF_TYPE_UDR: {
return "UDR";
} break;
case NF_TYPE_UDSF: {
return "UDSF";
} break;
case NF_TYPE_UPF: {
return "UPF";
} break;
case NF_TYPE_LMF: {
return "LMF";
} break;
case NF_TYPE_SMSF: {
return "SMSF";
} break;
case NF_TYPE_GMLC: {
return "GMLC";
} break;
case NF_TYPE_5G_EIR: {
return "5G_EIR";
} break;
case NF_TYPE_SEPP: {
return "SEPP";
} break;
case NF_TYPE_N3IWF: {
return "N3IWF";
} break;
case NF_TYPE_AF: {
return "AF";
} break;
case NF_TYPE_BSF: {
return "BSF";
} break;
case NF_TYPE_CHF: {
return "CHF";
} break;
default:
return "NF TYPE UNKNOWN";
}
return "NF TYPE UNKNOWN";
}
//------------------------------------------------------------------------------
nf_up_interface_type_t api_conv::string_to_up_interface_type(
const std::string& str) {
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file api_conversions.hpp
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2020
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_API_CONVERSIONS_HPP_SEEN
#define FILE_API_CONVERSIONS_HPP_SEEN
......@@ -63,14 +55,21 @@ bool subscription_api_to_nrf_subscription(
const SubscriptionData& api_sub, std::shared_ptr<nrf_subscription>& sub);
/*
* Convert a string to nf type
* Convert a string to NF type
* @param [const std::string &] str: string input
* @return the corresponding nf_type
*/
nf_type_t string_to_nf_type(const std::string& str);
/*
* Convert a string to nf type
* Convert NF type to string
* @param [const nf_type_t &] nf_type: NF type
* @return the corresponding string
*/
std::string nf_type_to_string(const nf_type_t& nf_type);
/*
* Convert a string to UP interface type
* @param [const std::string &] str: string input
* @return the corresponding up_interface_type
*/
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file conversions.hpp
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_CONVERSIONS_HPP_SEEN
#define FILE_CONVERSIONS_HPP_SEEN
#include <stdint.h>
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file get_gateway_netlink.hpp
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_GET_GATEWAY_NETLINK_HPP_SEEN
#define FILE_GET_GATEWAY_NETLINK_HPP_SEEN
......
......@@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "common_defs.h"
#include "if.hpp"
#include "logger.hpp"
......
......@@ -19,14 +19,9 @@
* contact@openairinterface.org
*/
/*! \file get_gateway_netlink.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_IF_HPP_SEEN
#define FILE_IF_HPP_SEEN
#include <string>
int get_gateway_and_iface(std::string* gw /*OUT*/, std::string* iface /*OUT*/);
......
......@@ -19,14 +19,9 @@
* contact@openairinterface.org
*/
/*! \file mime_parser.hpp
\brief
\author
\company Eurecom
\email:
*/
#ifndef FILE_MIME_PARSER_HPP_SEEN
#define FILE_MIME_PARSER_HPP_SEEN
#include <string>
#include <map>
#include <vector>
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file pid_file.cpp
\brief
\author Lionel GAUTHIER
\date 2016
\email: lionel.gauthier@eurecom.fr
*/
#include "logger.hpp"
#include "pid_file.hpp"
......
......@@ -19,14 +19,9 @@
* contact@openairinterface.org
*/
/*! \file pid_file.hpp
\brief
\author Lionel GAUTHIER
\date 2016
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_PID_FILE_SEEN
#define FILE_PID_FILE_SEEN
#include <string>
namespace util {
......
......@@ -18,6 +18,7 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "string.hpp"
#include <iostream>
......@@ -104,4 +105,4 @@ std::string util::get_query_param(std::string querystring, std::string param) {
}
});
return query_param_tmp;
}
\ No newline at end of file
}
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file string.hpp
\brief
\author Lionel GAUTHIER
\date 2018
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_STRING_HPP_FILE_SEEN
#define FILE_STRING_HPP_FILE_SEEN
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file thread_sched.cpp
\brief
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#include "thread_sched.hpp"
//------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment