Commit 17550447 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

code cleanup

parent db6b092a
This diff is collapsed.
...@@ -43,7 +43,6 @@ namespace spgwu { ...@@ -43,7 +43,6 @@ namespace spgwu {
#define TASK_SPGWU_NRF_TIMEOUT_NRF_HEARTBEAT (1) #define TASK_SPGWU_NRF_TIMEOUT_NRF_HEARTBEAT (1)
#define TASK_SPGWU_NRF_TIMEOUT_NRF_DEREGISTRATION (2) #define TASK_SPGWU_NRF_TIMEOUT_NRF_DEREGISTRATION (2)
class spgwu_nrf { class spgwu_nrf {
private: private:
std::thread::id thread_id; std::thread::id thread_id;
...@@ -55,40 +54,30 @@ class spgwu_nrf { ...@@ -55,40 +54,30 @@ class spgwu_nrf {
public: public:
spgwu_nrf(); spgwu_nrf();
spgwu_nrf(spgwu_nrf const &) = delete; spgwu_nrf(spgwu_nrf const&) = delete;
void operator=(spgwu_nrf const &) = delete; void operator=(spgwu_nrf const&) = delete;
/* /*
* Send NF instance registration to NRF * Send NF instance registration to NRF
* @param [std::shared_ptr<itti_nrf_register_nf_instance_request>] msg: * @param [std::string &] url: NRF's URL
* Content of message to be sent
* @return void * @return void
*/ */
void register_nf_instance( void send_register_nf_instance(std::string& url);
std::shared_ptr<itti_nrf_register_nf_instance_request> msg);
void send_register_nf_instance(std::string &url);
void send_update_nf_instance(std::string &url, nlohmann::json &data);
/* /*
* Send NF instance update to NRF * Send NF instance registration to NRF
* @param [std::shared_ptr<itti_nrf_update_nf_instance_request>] msg: Content * @param [std::string &] url: NRF's URL
* of message to be sent * @param [nlohmann::json &] data: Json data to be sent
* @return void * @return void
*/ */
void send_update_nf_instance(std::string& url, nlohmann::json& data);
/* /*
* Send NF deregister to NRF * Send NF deregister to NRF
* @param [std::shared_ptr<itti_nrf_deregister_nf_instance>] msg: Content * @param [std::string &] url: NRF's URL
* of message to be sent
* @return void * @return void
*/ */
void deregister_nf_instance( void send_deregister_nf_instance(std::string& url);
std::shared_ptr<itti_nrf_deregister_nf_instance> msg);
/* /*
* Trigger NF instance registration to NRF * Trigger NF instance registration to NRF
...@@ -98,32 +87,26 @@ class spgwu_nrf { ...@@ -98,32 +87,26 @@ class spgwu_nrf {
void register_to_nrf(); void register_to_nrf();
/* /*
* Generate a random UUID for SMF instance * Generate a random UUID for UPF instance
* @param [void] * @param [void]
* @return void * @return void
*/ */
void generate_uuid(); void generate_uuid();
/* /*
* Generate a SMF profile for this instance * Generate a UPF profile for this instance
* @param [void] * @param [void]
* @return void * @return void
*/ */
void generate_upf_profile(); void generate_upf_profile();
/* /*
* Send request to N11 task to trigger NF instance registration to NRF * will be executed when NRF Heartbeat timer expires
* @param [void] * @param [timer_id_t] timer_id
* @return void * @param [uint64_t] arg2_user
*/
void trigger_nf_registration_request();
/*
* Send request to N11 task to trigger NF instance deregistration to NRF
* @param [void]
* @return void * @return void
*/ */
void trigger_nf_deregistration(); void timer_nrf_heartbeat_timeout(timer_id_t timer_id, uint64_t arg2_user);
/* /*
* will be executed when NRF Heartbeat timer expires * will be executed when NRF Heartbeat timer expires
...@@ -131,9 +114,7 @@ class spgwu_nrf { ...@@ -131,9 +114,7 @@ class spgwu_nrf {
* @param [uint64_t] arg2_user * @param [uint64_t] arg2_user
* @return void * @return void
*/ */
void timer_nrf_heartbeat_timeout(timer_id_t timer_id, uint64_t arg2_user);
void timer_nrf_deregistration(timer_id_t timer_id, uint64_t arg2_user); void timer_nrf_deregistration(timer_id_t timer_id, uint64_t arg2_user);
}; };
} // namespace smf } // namespace spgwu
#endif /* FILE_SPGWU_NRF_HPP_SEEN */ #endif /* FILE_SPGWU_NRF_HPP_SEEN */
...@@ -38,25 +38,27 @@ using namespace std; ...@@ -38,25 +38,27 @@ using namespace std;
using namespace spgwu; using namespace spgwu;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_instance_id(const std::string &instance_id) { void spgwu_profile::set_nf_instance_id(const std::string& instance_id) {
nf_instance_id = instance_id; nf_instance_id = instance_id;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_instance_id(std::string &instance_id) const { void spgwu_profile::get_nf_instance_id(std::string& instance_id) const {
instance_id = nf_instance_id; instance_id = nf_instance_id;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::string spgwu_profile::get_nf_instance_id() const { return nf_instance_id; } std::string spgwu_profile::get_nf_instance_id() const {
return nf_instance_id;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_instance_name(const std::string &instance_name) { void spgwu_profile::set_nf_instance_name(const std::string& instance_name) {
nf_instance_name = instance_name; nf_instance_name = instance_name;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_instance_name(std::string &instance_name) const { void spgwu_profile::get_nf_instance_name(std::string& instance_name) const {
instance_name = nf_instance_name; instance_name = nf_instance_name;
} }
...@@ -66,90 +68,118 @@ std::string spgwu_profile::get_nf_instance_name() const { ...@@ -66,90 +68,118 @@ std::string spgwu_profile::get_nf_instance_name() const {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_type(const std::string &type) { nf_type = type; } void spgwu_profile::set_nf_type(const std::string& type) {
nf_type = type;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::string spgwu_profile::get_nf_type() const { return nf_type; } std::string spgwu_profile::get_nf_type() const {
return nf_type;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_status(const std::string &status) { void spgwu_profile::set_nf_status(const std::string& status) {
nf_status = status; nf_status = status;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_status(std::string &status) const { void spgwu_profile::get_nf_status(std::string& status) const {
status = nf_status; status = nf_status;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
std::string spgwu_profile::get_nf_status() const { return nf_status; } std::string spgwu_profile::get_nf_status() const {
return nf_status;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_heartBeat_timer(const int32_t &timer) { void spgwu_profile::set_nf_heartBeat_timer(const int32_t& timer) {
heartBeat_timer = timer; heartBeat_timer = timer;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_heartBeat_timer(int32_t &timer) const { void spgwu_profile::get_nf_heartBeat_timer(int32_t& timer) const {
timer = heartBeat_timer; timer = heartBeat_timer;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int32_t spgwu_profile::get_nf_heartBeat_timer() const { return heartBeat_timer; } int32_t spgwu_profile::get_nf_heartBeat_timer() const {
return heartBeat_timer;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_priority(const uint16_t &p) { priority = p; } void spgwu_profile::set_nf_priority(const uint16_t& p) {
priority = p;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_priority(uint16_t &p) const { p = priority; } void spgwu_profile::get_nf_priority(uint16_t& p) const {
p = priority;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
uint16_t spgwu_profile::get_nf_priority() const { return priority; } uint16_t spgwu_profile::get_nf_priority() const {
return priority;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_capacity(const uint16_t &c) { capacity = c; } void spgwu_profile::set_nf_capacity(const uint16_t& c) {
capacity = c;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_capacity(uint16_t &c) const { c = capacity; } void spgwu_profile::get_nf_capacity(uint16_t& c) const {
c = capacity;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
uint16_t spgwu_profile::get_nf_capacity() const { return capacity; } uint16_t spgwu_profile::get_nf_capacity() const {
return capacity;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_snssais(const std::vector<snssai_t> &s) { void spgwu_profile::set_nf_snssais(const std::vector<snssai_t>& s) {
snssais = s; snssais = s;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_snssais(std::vector<snssai_t> &s) const { void spgwu_profile::get_nf_snssais(std::vector<snssai_t>& s) const {
s = snssais; s = snssais;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::add_snssai(const snssai_t &s) { snssais.push_back(s); } void spgwu_profile::add_snssai(const snssai_t& s) {
snssais.push_back(s);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_nf_ipv4_addresses(const std::vector<struct in_addr> &a) { void spgwu_profile::set_nf_ipv4_addresses(
const std::vector<struct in_addr>& a) {
ipv4_addresses = a; ipv4_addresses = a;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::add_nf_ipv4_addresses(const struct in_addr &a) { void spgwu_profile::add_nf_ipv4_addresses(const struct in_addr& a) {
ipv4_addresses.push_back(a); ipv4_addresses.push_back(a);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_nf_ipv4_addresses(std::vector<struct in_addr> &a) const { void spgwu_profile::get_nf_ipv4_addresses(
std::vector<struct in_addr>& a) const {
a = ipv4_addresses; a = ipv4_addresses;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::set_upf_info(const upf_info_t &s) { upf_info = s; } void spgwu_profile::set_upf_info(const upf_info_t& s) {
upf_info = s;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::add_upf_info_item(const snssai_upf_info_item_t &s) { void spgwu_profile::add_upf_info_item(const snssai_upf_info_item_t& s) {
upf_info.snssai_upf_info_list.push_back(s); upf_info.snssai_upf_info_list.push_back(s);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::get_upf_info(upf_info_t &s) const { s = upf_info; } void spgwu_profile::get_upf_info(upf_info_t& s) const {
s = upf_info;
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::display() const { void spgwu_profile::display() const {
...@@ -185,8 +215,8 @@ void spgwu_profile::display() const { ...@@ -185,8 +215,8 @@ void spgwu_profile::display() const {
} }
for (auto s : upf_info.snssai_upf_info_list) { for (auto s : upf_info.snssai_upf_info_list) {
Logger::spgwu_app().debug("\t\tParameters supported by the UPF:"); Logger::spgwu_app().debug("\t\tParameters supported by the UPF:");
Logger::spgwu_app().debug("\t\t\tSNSSAI (SST %d, SD %s)", s.snssai.sST, Logger::spgwu_app().debug(
s.snssai.sD.c_str()); "\t\t\tSNSSAI (SST %d, SD %s)", s.snssai.sST, s.snssai.sD.c_str());
for (auto d : s.dnn_upf_info_list) { for (auto d : s.dnn_upf_info_list) {
Logger::spgwu_app().debug("\t\t\tDNN %s", d.dnn.c_str()); Logger::spgwu_app().debug("\t\t\tDNN %s", d.dnn.c_str());
} }
...@@ -194,7 +224,7 @@ void spgwu_profile::display() const { ...@@ -194,7 +224,7 @@ void spgwu_profile::display() const {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::to_json(nlohmann::json &data) const { void spgwu_profile::to_json(nlohmann::json& data) const {
data["nfInstanceId"] = nf_instance_id; data["nfInstanceId"] = nf_instance_id;
data["nfInstanceName"] = nf_instance_name; data["nfInstanceName"] = nf_instance_name;
data["nfType"] = nf_type; data["nfType"] = nf_type;
...@@ -239,7 +269,7 @@ void spgwu_profile::to_json(nlohmann::json &data) const { ...@@ -239,7 +269,7 @@ void spgwu_profile::to_json(nlohmann::json &data) const {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::from_json(const nlohmann::json &data) { void spgwu_profile::from_json(const nlohmann::json& data) {
if (data.find("nfInstanceId") != data.end()) { if (data.find("nfInstanceId") != data.end()) {
nf_instance_id = data["nfInstanceId"].get<std::string>(); nf_instance_id = data["nfInstanceId"].get<std::string>();
} }
...@@ -281,8 +311,8 @@ void spgwu_profile::from_json(const nlohmann::json &data) { ...@@ -281,8 +311,8 @@ void spgwu_profile::from_json(const nlohmann::json &data) {
if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) == 1) { if (inet_pton(AF_INET, util::trim(address).c_str(), buf_in_addr) == 1) {
memcpy(&addr4, buf_in_addr, sizeof(struct in_addr)); memcpy(&addr4, buf_in_addr, sizeof(struct in_addr));
} else { } else {
Logger::spgwu_app().warn("Address conversion: Bad value %s", Logger::spgwu_app().warn(
util::trim(address).c_str()); "Address conversion: Bad value %s", util::trim(address).c_str());
} }
// Logger::spgwu_app().debug("\tIPv4 Addr: %s", address.c_str()); // Logger::spgwu_app().debug("\tIPv4 Addr: %s", address.c_str());
add_nf_ipv4_addresses(addr4); add_nf_ipv4_addresses(addr4);
...@@ -333,7 +363,8 @@ void spgwu_profile::from_json(const nlohmann::json &data) { ...@@ -333,7 +363,8 @@ void spgwu_profile::from_json(const nlohmann::json &data) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void spgwu_profile::handle_heartbeart_timeout(uint64_t ms) { void spgwu_profile::handle_heartbeart_timeout(uint64_t ms) {
Logger::spgwu_app().info("Handle heartbeart timeout profile %s, time %d", Logger::spgwu_app().info(
nf_instance_id.c_str(), ms); "Handle heartbeart timeout profile %s, time %d", nf_instance_id.c_str(),
ms);
set_nf_status("SUSPENDED"); set_nf_status("SUSPENDED");
} }
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
namespace spgwu { namespace spgwu {
//using namespace std; // using namespace std;
class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
public: public:
...@@ -59,7 +59,7 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -59,7 +59,7 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
nf_status = ""; nf_status = "";
} }
spgwu_profile(const std::string &id) spgwu_profile(const std::string& id)
: nf_instance_id(id), : nf_instance_id(id),
heartBeat_timer(0), heartBeat_timer(0),
snssais(), snssais(),
...@@ -71,7 +71,7 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -71,7 +71,7 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
nf_status = ""; nf_status = "";
} }
spgwu_profile &operator=(const spgwu_profile &s) { spgwu_profile& operator=(const spgwu_profile& s) {
nf_instance_id = s.nf_instance_id; nf_instance_id = s.nf_instance_id;
heartBeat_timer = s.heartBeat_timer; heartBeat_timer = s.heartBeat_timer;
snssais = s.snssais; snssais = s.snssais;
...@@ -94,13 +94,13 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -94,13 +94,13 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [const std::string &] instance_id: instance id * @param [const std::string &] instance_id: instance id
* @return void * @return void
*/ */
void set_nf_instance_id(const std::string &instance_id); void set_nf_instance_id(const std::string& instance_id);
/* /*
* Get NF instance ID * Get NF instance ID
* @param [std::string &] instance_id: store instance id * @param [std::string &] instance_id: store instance id
* @return void: * @return void:
*/ */
void get_nf_instance_id(std::string &instance_id) const; void get_nf_instance_id(std::string& instance_id) const;
/* /*
* Get NF instance ID * Get NF instance ID
...@@ -114,14 +114,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -114,14 +114,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [const std::string &] instance_name: instance name * @param [const std::string &] instance_name: instance name
* @return void * @return void
*/ */
void set_nf_instance_name(const std::string &instance_name); void set_nf_instance_name(const std::string& instance_name);
/* /*
* Get NF instance ID * Get NF instance ID
* @param [std::string &] instance_name: store instance name * @param [std::string &] instance_name: store instance name
* @return void: * @return void:
*/ */
void get_nf_instance_name(std::string &instance_name) const; void get_nf_instance_name(std::string& instance_name) const;
/* /*
* Get NF instance name * Get NF instance name
...@@ -135,14 +135,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -135,14 +135,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [const std::string &] status: instance status * @param [const std::string &] status: instance status
* @return void * @return void
*/ */
void set_nf_status(const std::string &status); void set_nf_status(const std::string& status);
/* /*
* Get NF instance status * Get NF instance status
* @param [std::string &] status: store instance status * @param [std::string &] status: store instance status
* @return void: * @return void:
*/ */
void get_nf_status(std::string &status) const; void get_nf_status(std::string& status) const;
/* /*
* Get NF status * Get NF status
...@@ -163,21 +163,21 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -163,21 +163,21 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [const nf_type_t &] type: nf type * @param [const nf_type_t &] type: nf type
* @return void * @return void
*/ */
void set_nf_type(const std::string &type); void set_nf_type(const std::string& type);
/* /*
* Set NF instance heartBeat_timer * Set NF instance heartBeat_timer
* @param [const std::string &] timer: heartBeat_timer * @param [const std::string &] timer: heartBeat_timer
* @return void * @return void
*/ */
void set_nf_heartBeat_timer(const int32_t &timer); void set_nf_heartBeat_timer(const int32_t& timer);
/* /*
* Get NF instance heartBeat_timer * Get NF instance heartBeat_timer
* @param [std::string &] timer: store heartBeat_timer * @param [std::string &] timer: store heartBeat_timer
* @return void: * @return void:
*/ */
void get_nf_heartBeat_timer(int32_t &timer) const; void get_nf_heartBeat_timer(int32_t& timer) const;
/* /*
* Get NF heartBeat_timer * Get NF heartBeat_timer
...@@ -191,14 +191,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -191,14 +191,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [const uint16_t] p: instance priority * @param [const uint16_t] p: instance priority
* @return void * @return void
*/ */
void set_nf_priority(const uint16_t &p); void set_nf_priority(const uint16_t& p);
/* /*
* Get NF instance priority * Get NF instance priority
* @param [uint16_t] p: store instance priority * @param [uint16_t] p: store instance priority
* @return void: * @return void:
*/ */
void get_nf_priority(uint16_t &p) const; void get_nf_priority(uint16_t& p) const;
/* /*
* Get NF instance priority * Get NF instance priority
...@@ -212,14 +212,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -212,14 +212,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [const uint16_t] c: instance capacity * @param [const uint16_t] c: instance capacity
* @return void * @return void
*/ */
void set_nf_capacity(const uint16_t &c); void set_nf_capacity(const uint16_t& c);
/* /*
* Get NF instance priority * Get NF instance priority
* @param [uint16_t ] c: store instance capacity * @param [uint16_t ] c: store instance capacity
* @return void: * @return void:
*/ */
void get_nf_capacity(uint16_t &c) const; void get_nf_capacity(uint16_t& c) const;
/* /*
* Get NF instance priority * Get NF instance priority
...@@ -233,63 +233,63 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -233,63 +233,63 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [std::vector<snssai_t> &] s: SNSSAIs * @param [std::vector<snssai_t> &] s: SNSSAIs
* @return void * @return void
*/ */
void set_nf_snssais(const std::vector<snssai_t> &s); void set_nf_snssais(const std::vector<snssai_t>& s);
/* /*
* Add SNSSAI * Add SNSSAI
* @param [snssai_t &] s: SNSSAI * @param [snssai_t &] s: SNSSAI
* @return void * @return void
*/ */
void add_snssai(const snssai_t &s); void add_snssai(const snssai_t& s);
/* /*
* Get NF instance SNSSAIs * Get NF instance SNSSAIs
* @param [std::vector<snssai_t> &] s: store instance's SNSSAIs * @param [std::vector<snssai_t> &] s: store instance's SNSSAIs
* @return void: * @return void:
*/ */
void get_nf_snssais(std::vector<snssai_t> &s) const; void get_nf_snssais(std::vector<snssai_t>& s) const;
/* /*
* Set NF instance ipv4_addresses * Set NF instance ipv4_addresses
* @param [std::vector<struct in_addr> &] a: ipv4_addresses * @param [std::vector<struct in_addr> &] a: ipv4_addresses
* @return void * @return void
*/ */
void set_nf_ipv4_addresses(const std::vector<struct in_addr> &a); void set_nf_ipv4_addresses(const std::vector<struct in_addr>& a);
/* /*
* Add an IPv4 address to the list of addresses * Add an IPv4 address to the list of addresses
* @param [const struct in_addr &] a: ipv4_address * @param [const struct in_addr &] a: ipv4_address
* @return void * @return void
*/ */
void add_nf_ipv4_addresses(const struct in_addr &a); void add_nf_ipv4_addresses(const struct in_addr& a);
/* /*
* Get NF instance ipv4_addresses * Get NF instance ipv4_addresses
* @param [std::vector<struct in_addr> &] a: store instance's ipv4_addresses * @param [std::vector<struct in_addr> &] a: store instance's ipv4_addresses
* @return void: * @return void:
*/ */
void get_nf_ipv4_addresses(std::vector<struct in_addr> &a) const; void get_nf_ipv4_addresses(std::vector<struct in_addr>& a) const;
/* /*
* Set upf info * Set upf info
* @param [upf_info_t &] s: upf info * @param [upf_info_t &] s: upf info
* @return void * @return void
*/ */
void set_upf_info(const upf_info_t &s); void set_upf_info(const upf_info_t& s);
/* /*
* Add an snssai_upf_info_item to the upf info * Add an snssai_upf_info_item to the upf info
* @param [const snssai_upf_info_item_t &] s: snssai_smf_info_item * @param [const snssai_upf_info_item_t &] s: snssai_smf_info_item
* @return void * @return void
*/ */
void add_upf_info_item(const snssai_upf_info_item_t &s); void add_upf_info_item(const snssai_upf_info_item_t& s);
/* /*
* Get NF instance smf info * Get NF instance smf info
* @param [smf_info_t &] s: store instance's smf info * @param [smf_info_t &] s: store instance's smf info
* @return void: * @return void:
*/ */
void get_upf_info(upf_info_t &s) const; void get_upf_info(upf_info_t& s) const;
/* /*
* Print related-information for NF profile * Print related-information for NF profile
...@@ -303,14 +303,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> { ...@@ -303,14 +303,14 @@ class spgwu_profile : public std::enable_shared_from_this<spgwu_profile> {
* @param [nlohmann::json &] data: Json data * @param [nlohmann::json &] data: Json data
* @return void * @return void
*/ */
void to_json(nlohmann::json &data) const; void to_json(nlohmann::json& data) const;
/* /*
* Covert from a json represetation to SMF profile * Covert from a json represetation to SMF profile
* @param [nlohmann::json &] data: Json data * @param [nlohmann::json &] data: Json data
* @return void * @return void
*/ */
void from_json(const nlohmann::json &data); void from_json(const nlohmann::json& data);
/* /*
* Handle heartbeart timeout event * Handle heartbeart timeout event
......
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