Commit 2bb215f9 authored by Niuhaiwen's avatar Niuhaiwen

fix some bug of itti

parent 20b8eed8
...@@ -26,6 +26,7 @@ include_directories(${SRC_DIR}/utils) ...@@ -26,6 +26,7 @@ include_directories(${SRC_DIR}/utils)
include_directories(${SRC_DIR}/utils/bstr) include_directories(${SRC_DIR}/utils/bstr)
include_directories(${SRC_DIR}/libngap) include_directories(${SRC_DIR}/libngap)
include_directories(${SRC_DIR}/itti) include_directories(${SRC_DIR}/itti)
include_directories(${SRC_DIR}/ausf_app)
################### code frrom amf cmakelists########################### ################### code frrom amf cmakelists###########################
......
...@@ -44,7 +44,7 @@ void ausf_app_task(void*){ ...@@ -44,7 +44,7 @@ void ausf_app_task(void*){
//TODO: periodic_getinfo_handler //TODO: periodic_getinfo_handler
break; break;
case TASK_AUSF_APP_TIMEOUT_NRF_HEARTBEAT: case TASK_AUSF_APP_TIMEOUT_NRF_HEARTBEAT:
amf_app_inst->timer_nrf_heartbeat_timeout( ausf_app_inst->timer_nrf_heartbeat_timeout(
to->timer_id, to->arg2_user); to->timer_id, to->arg2_user);
break; break;
default: default:
...@@ -76,14 +76,14 @@ ausf_app::ausf_app() ...@@ -76,14 +76,14 @@ ausf_app::ausf_app()
} }
void ausf_app::register_to_nrf(){ void ausf_app::register_to_nrf(){
// Create a NF profile to this instance // Create a NF profile to this instance
generate_smf_profile(); generate_ausf_profile();
// Send request to N11 to send NF registration to NRF // Send request to N11 to send NF registration to NRF
trigger_nf_registration_request(); trigger_nf_registration_request();
} }
void ausf_app::generate_ausf_profile(){ void ausf_app::generate_ausf_profile(){
generate_uuid(); generate_uuid();
nf_instance_profile.set_nf_instance_id(amf_instance_id); nf_instance_profile.set_nf_instance_id(ausf_instance_id);
nf_instance_profile.set_nf_instance_name("bupt-ausf"); nf_instance_profile.set_nf_instance_name("bupt-ausf");
nf_instance_profile.set_nf_type("AUSF"); nf_instance_profile.set_nf_type("AUSF");
nf_instance_profile.set_nf_status("REGISTERED"); nf_instance_profile.set_nf_status("REGISTERED");
...@@ -113,8 +113,7 @@ void ausf_app::generate_ausf_profile(){ ...@@ -113,8 +113,7 @@ void ausf_app::generate_ausf_profile(){
nf_instance_profile.display(); nf_instance_profile.display();
} }
void ausf_app::trigger_nf_registration_request(){ void ausf_app::trigger_nf_registration_request(){
Logger::ausf_app().debug(" Logger::ausf_app().debug("Send ITTI msg to N11 task to trigger the registration request to NRF");
Send ITTI msg to N11 task to trigger the registration request to NRF");
std::shared_ptr<itti_sbi_register_nf_instance_request> itti_msg = std::shared_ptr<itti_sbi_register_nf_instance_request> itti_msg =
std::make_shared<itti_sbi_register_nf_instance_request>(TASK_AUSF_APP,TASK_AUSF_APP); std::make_shared<itti_sbi_register_nf_instance_request>(TASK_AUSF_APP,TASK_AUSF_APP);
...@@ -122,7 +121,7 @@ void ausf_app::trigger_nf_registration_request(){ ...@@ -122,7 +121,7 @@ void ausf_app::trigger_nf_registration_request(){
register_nf_instance(itti_msg); register_nf_instance(itti_msg);
} }
void ausf_app::timer_nrf_heartbeat_timeout(){ void ausf_app::timer_nrf_heartbeat_timeout(timer_id_t timer_id, uint64_t arg2_user){
} }
void ausf_app::generate_uuid(){ void ausf_app::generate_uuid(){
ausf_instance_id = to_string(boost::uuids::random_generator()()); ausf_instance_id = to_string(boost::uuids::random_generator()());
...@@ -130,4 +129,4 @@ void ausf_app::generate_uuid(){ ...@@ -130,4 +129,4 @@ void ausf_app::generate_uuid(){
void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instance_request> msg) void ausf_app::register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instance_request> msg)
{ {
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ namespace ausf_application{ ...@@ -22,7 +22,7 @@ namespace ausf_application{
// Send request to N11 to send NF registration to NRF // Send request to N11 to send NF registration to NRF
void trigger_nf_registration_request(); void trigger_nf_registration_request();
void generate_uuid(); void generate_uuid();
void timer_nrf_heartbeat_timeout(); void timer_nrf_heartbeat_timeout(timer_id_t timer_id, uint64_t arg2_user);
void register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instance_request> msg); void register_nf_instance(std::shared_ptr<itti_sbi_register_nf_instance_request> msg);
private: private:
...@@ -31,4 +31,4 @@ namespace ausf_application{ ...@@ -31,4 +31,4 @@ namespace ausf_application{
timer_id_t timer_nrf_heartbeat; timer_id_t timer_nrf_heartbeat;
}; };
} }
#endif #endif
\ No newline at end of file
...@@ -210,7 +210,7 @@ void nf_profile::from_json(const nlohmann::json& data) { ...@@ -210,7 +210,7 @@ void nf_profile::from_json(const nlohmann::json& data) {
capacity = data["capacity"].get<int>(); capacity = data["capacity"].get<int>();
} }
} }
/------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void ausf_profile::set_nf_services(const std::vector<nf_service_t>& n) { void ausf_profile::set_nf_services(const std::vector<nf_service_t>& n) {
nf_services = n; nf_services = n;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "logger.hpp" #include "logger.hpp"
#include "3gpp_29.510.h"
namespace ausf_application{ namespace ausf_application{
...@@ -92,9 +93,9 @@ namespace ausf_application{ ...@@ -92,9 +93,9 @@ namespace ausf_application{
}; };
class ausf_profile : public nf_profile { class ausf_profile : public nf_profile {
public: public:
ausf_profile() : nf_profile() { custom_info = {}; } ausf_profile() : nf_profile() { }
ausf_profile(const std::string& id) : nf_profile(id) { custom_info = {}; } ausf_profile(const std::string& id) : nf_profile(id) { }
ausf_profile& operator=(const ausf_profile& s) { ausf_profile& operator=(const ausf_profile& s) {
nf_instance_id = s.nf_instance_id; nf_instance_id = s.nf_instance_id;
...@@ -124,4 +125,4 @@ namespace ausf_application{ ...@@ -124,4 +125,4 @@ namespace ausf_application{
//nlohmann::json custom_info; // store extra json data //nlohmann::json custom_info; // store extra json data
}; };
} }
#endif #endif
\ No newline at end of file
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <vector> #include <vector>
#include "3gpp_23.003.h"
enum class nf_status_e { REGISTERED = 0, SUSPENDED = 1, UNDISCOVERABLE = 2 }; enum class nf_status_e { REGISTERED = 0, SUSPENDED = 1, UNDISCOVERABLE = 2 };
......
...@@ -21,7 +21,7 @@ class itti_sbi_msg : public itti_msg { ...@@ -21,7 +21,7 @@ class itti_sbi_msg : public itti_msg {
} }
}; };
class itti_sbi_register_nf_instance_request : public itti_msg_sbi { class itti_sbi_register_nf_instance_request : public itti_sbi_msg {
public: public:
itti_sbi_register_nf_instance_request( itti_sbi_register_nf_instance_request(
const task_id_t orig, const task_id_t dest) const task_id_t orig, const task_id_t dest)
......
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