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

Add debug info for UPF Info

parent e1b9699a
......@@ -342,6 +342,22 @@ typedef struct interface_upf_info_item_s {
typedef struct upf_info_s {
std::vector<interface_upf_info_item_t> interface_upf_info_list;
std::vector<snssai_upf_info_item_t> snssai_upf_info_list;
std::string to_string() const {
std::string s = {};
// TODO: Interface UPF Info List
if (!snssai_upf_info_list.empty()) {
s.append("SNSSAI UPF Info: \n");
for (auto sn : snssai_upf_info_list) {
s.append("SNSSAI: " + sn.snssai.toString() + "\n");
s.append("DNN UPF Info: ");
for (auto d : sn.dnn_upf_info_list) {
s.append("," + d.dnn);
}
}
}
return s;
}
} upf_info_t;
typedef struct patch_item_s {
......
......@@ -418,6 +418,7 @@ bool pfcp_associations::select_up_node(
pfcp::node_id_t& node_id, const snssai_t& snssai, const std::string& dnn) {
node_id = {};
if (associations.empty()) {
Logger::smf_app().debug("No UPF available");
return false;
}
folly::AtomicHashMap<int32_t, std::shared_ptr<pfcp_association>>::iterator it;
......@@ -433,7 +434,11 @@ bool pfcp_associations::select_up_node(
// else, verify that UPF belongs to the same slice and supports this dnn
std::vector<snssai_t> snssais = {};
upf_info_t upf_info = {};
a->upf_node_profile.get_upf_info(upf_info);
Logger::smf_app().debug(
"UPF profile info: %s", upf_info.to_string().c_str());
for (auto ui : upf_info.snssai_upf_info_list) {
if (ui.snssai == snssai) {
for (auto d : ui.dnn_upf_info_list) {
......
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