Commit 7f19ae65 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'feature_edge_computing' into 'develop'

Enhance UPF profile in NRF and fix bug in SBI when body is too long

See merge request oai/cn5g/oai-cn5g-nrf!28
parents 05935cf6 e682dd38
...@@ -35,6 +35,8 @@ void to_json(nlohmann::json& j, const DnnUpfInfoItem& o) { ...@@ -35,6 +35,8 @@ void to_json(nlohmann::json& j, const DnnUpfInfoItem& o) {
if (o.dnaiListIsSet() || !o.m_DnaiList.empty()) j["dnaiList"] = o.m_DnaiList; if (o.dnaiListIsSet() || !o.m_DnaiList.empty()) j["dnaiList"] = o.m_DnaiList;
if (o.pduSessionTypesIsSet() || !o.m_PduSessionTypes.empty()) if (o.pduSessionTypesIsSet() || !o.m_PduSessionTypes.empty())
j["pduSessionTypes"] = o.m_PduSessionTypes; j["pduSessionTypes"] = o.m_PduSessionTypes;
if (o.dnaiNwInstanceListIsSet() || !o.m_DnaiNwInstanceList.empty())
j["dnaiNwInstanceList"] = o.m_DnaiNwInstanceList;
} }
void from_json(const nlohmann::json& j, DnnUpfInfoItem& o) { void from_json(const nlohmann::json& j, DnnUpfInfoItem& o) {
...@@ -47,6 +49,10 @@ void from_json(const nlohmann::json& j, DnnUpfInfoItem& o) { ...@@ -47,6 +49,10 @@ void from_json(const nlohmann::json& j, DnnUpfInfoItem& o) {
j.at("pduSessionTypes").get_to(o.m_PduSessionTypes); j.at("pduSessionTypes").get_to(o.m_PduSessionTypes);
o.m_PduSessionTypesIsSet = true; o.m_PduSessionTypesIsSet = true;
} }
if (j.find("dnaiNwInstanceList") != j.end()) {
j.at("dnaiNwInstanceList").get_to(o.m_DnaiNwInstanceList);
o.m_DnaiNwInstanceListIsSet = true;
}
} }
std::string DnnUpfInfoItem::getDnn() const { std::string DnnUpfInfoItem::getDnn() const {
...@@ -83,6 +89,21 @@ void DnnUpfInfoItem::unsetPduSessionTypes() { ...@@ -83,6 +89,21 @@ void DnnUpfInfoItem::unsetPduSessionTypes() {
m_PduSessionTypesIsSet = false; m_PduSessionTypesIsSet = false;
} }
std::map<std::string, std::string>& DnnUpfInfoItem::getDnaiNwInstanceList() {
return m_DnaiNwInstanceList;
}
void DnnUpfInfoItem::setDnaiNwInstanceList(
std::map<std::string, std::string> const& value) {
m_DnaiNwInstanceList = value;
m_DnaiNwInstanceListIsSet = true;
}
bool DnnUpfInfoItem::dnaiNwInstanceListIsSet() const {
return m_DnaiNwInstanceListIsSet;
}
void DnnUpfInfoItem::unsetDnaiNwInstanceList() {
m_DnaiNwInstanceListIsSet = false;
}
} // namespace model } // namespace model
} // namespace nrf } // namespace nrf
} // namespace oai } // namespace oai
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <string> #include <string>
#include "PduSessionType.h" #include "PduSessionType.h"
#include <vector> #include <vector>
#include <map>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai {
...@@ -61,6 +62,11 @@ class DnnUpfInfoItem { ...@@ -61,6 +62,11 @@ class DnnUpfInfoItem {
bool pduSessionTypesIsSet() const; bool pduSessionTypesIsSet() const;
void unsetPduSessionTypes(); void unsetPduSessionTypes();
std::map<std::string, std::string>& getDnaiNwInstanceList();
void setDnaiNwInstanceList(std::map<std::string, std::string> const& value);
bool dnaiNwInstanceListIsSet() const;
void unsetDnaiNwInstanceList();
friend void to_json(nlohmann::json& j, const DnnUpfInfoItem& o); friend void to_json(nlohmann::json& j, const DnnUpfInfoItem& o);
friend void from_json(const nlohmann::json& j, DnnUpfInfoItem& o); friend void from_json(const nlohmann::json& j, DnnUpfInfoItem& o);
...@@ -71,6 +77,9 @@ class DnnUpfInfoItem { ...@@ -71,6 +77,9 @@ class DnnUpfInfoItem {
bool m_DnaiListIsSet; bool m_DnaiListIsSet;
std::vector<PduSessionType> m_PduSessionTypes; std::vector<PduSessionType> m_PduSessionTypes;
bool m_PduSessionTypesIsSet; bool m_PduSessionTypesIsSet;
std::map<std::string, std::string> m_DnaiNwInstanceList;
bool m_DnaiNwInstanceListIsSet;
}; };
} // namespace model } // namespace model
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define FILE_3GPP_29_510_NRF_SEEN #define FILE_3GPP_29_510_NRF_SEEN
#include <vector> #include <vector>
#include <map>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "3gpp_23.003.h" #include "3gpp_23.003.h"
...@@ -65,7 +66,9 @@ typedef struct smf_info_s { ...@@ -65,7 +66,9 @@ typedef struct smf_info_s {
typedef struct dnn_upf_info_item_s { typedef struct dnn_upf_info_item_s {
std::string dnn; std::string dnn;
// std::vector<std::string> dnai_list std::vector<std::string> dnai_list;
// Introduced in R16.8
std::map<std::string, std::string> dnai_nw_instance_list;
// std::vector<std::string> pdu_session_types // std::vector<std::string> pdu_session_types
} dnn_upf_info_item_t; } dnn_upf_info_item_t;
......
...@@ -212,10 +212,12 @@ bool api_conv::profile_api_to_nrf_profile( ...@@ -212,10 +212,12 @@ bool api_conv::profile_api_to_nrf_profile(
"\t\tNSSAI SD: %s, SST: %d", snssai.snssai.sD.c_str(), "\t\tNSSAI SD: %s, SST: %d", snssai.snssai.sD.c_str(),
snssai.snssai.sST); snssai.snssai.sST);
for (auto d : s.getDnnUpfInfoList()) { for (auto d : s.getDnnUpfInfoList()) {
dnn_upf_info_item_t dnn = {}; dnn_upf_info_item_t upf_info = {};
dnn.dnn = d.getDnn(); upf_info.dnn = d.getDnn();
snssai.dnn_upf_info_list.push_back(dnn); upf_info.dnai_list = d.getDnaiList();
Logger::nrf_app().debug("\t\tDNN: %s", dnn.dnn.c_str()); upf_info.dnai_nw_instance_list = d.getDnaiNwInstanceList();
snssai.dnn_upf_info_list.push_back(upf_info);
Logger::nrf_app().debug("\t\tDNN: %s", upf_info.dnn.c_str());
} }
info.snssai_upf_info_list.push_back(snssai); info.snssai_upf_info_list.push_back(snssai);
} }
......
...@@ -66,6 +66,9 @@ nrf_client::nrf_client(nrf_event& ev) : m_event_sub(ev) { ...@@ -66,6 +66,9 @@ nrf_client::nrf_client(nrf_event& ev) : m_event_sub(ev) {
headers = curl_slist_append(headers, "Accept: application/json"); headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json"); headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "charsets: utf-8"); headers = curl_slist_append(headers, "charsets: utf-8");
// to prevent curl from using the Expect: 100-continue feature, which is not
// supported by our servers
headers = curl_slist_append(headers, "Expect:");
// subscribe_task_curl(); // subscribe_task_curl();
} }
......
...@@ -1024,6 +1024,16 @@ void upf_profile::display() { ...@@ -1024,6 +1024,16 @@ void upf_profile::display() {
for (auto d : s.dnn_upf_info_list) { for (auto d : s.dnn_upf_info_list) {
Logger::nrf_app().debug( Logger::nrf_app().debug(
"\t\tSNSSAI UPF Info List, DNN List: %s", d.dnn.c_str()); "\t\tSNSSAI UPF Info List, DNN List: %s", d.dnn.c_str());
for (auto dnai : d.dnai_list) {
Logger::nrf_app().debug(
"\t\tSNSSAI UPF Info List, DNN List, DNAI List: %s", dnai.c_str());
}
for (auto nwinstance : d.dnai_nw_instance_list) {
Logger::nrf_app().debug(
"\t\tSNSSAI UPF Info List, DNN List, DNAI NW Instance List: %s : "
"%s",
nwinstance.first.c_str(), nwinstance.second.c_str());
}
} }
} }
if (!upf_info.interface_upf_info_list.empty()) { if (!upf_info.interface_upf_info_list.empty()) {
...@@ -1129,9 +1139,22 @@ void upf_profile::to_json(nlohmann::json& data) const { ...@@ -1129,9 +1139,22 @@ void upf_profile::to_json(nlohmann::json& data) const {
tmp["sNssai"]["sd"] = snssai.snssai.sD; tmp["sNssai"]["sd"] = snssai.snssai.sD;
tmp["dnnUpfInfoList"] = nlohmann::json::array(); tmp["dnnUpfInfoList"] = nlohmann::json::array();
for (auto d : snssai.dnn_upf_info_list) { for (auto d : snssai.dnn_upf_info_list) {
nlohmann::json tmp_dnn = {}; nlohmann::json tmp_upf_info_item = {};
tmp_dnn["dnn"] = d.dnn; tmp_upf_info_item["dnn"] = d.dnn;
tmp["dnnUpfInfoList"].push_back(tmp_dnn); if (d.dnai_list.size() > 0) {
tmp_upf_info_item["dnaiList"] = nlohmann::json::array();
for (auto dnai : d.dnai_list) {
tmp_upf_info_item["dnaiList"].push_back(dnai);
}
}
if (d.dnai_nw_instance_list.size() > 0) {
for (auto it_dnai_nw : d.dnai_nw_instance_list) {
tmp_upf_info_item["dnaiNwInstanceList"][it_dnai_nw.first] =
it_dnai_nw.second;
}
}
tmp["dnnUpfInfoList"].push_back(tmp_upf_info_item);
} }
data["upfInfo"]["sNssaiUpfInfoList"].push_back(tmp); data["upfInfo"]["sNssaiUpfInfoList"].push_back(tmp);
} }
......
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