Commit 2bb215f9 authored by Niuhaiwen's avatar Niuhaiwen

fix some bug of itti

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