Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common-src
Submodule common-src updated 92 files
+1,474 −241 3gpp/3gpp_29.244.h
+14 −1 3gpp/3gpp_29.510.h
+8 −0 common/common_root_types.h
+163 −0 model/AdditionInfoMsgForwarding.cpp
+97 −0 model/AdditionInfoMsgForwarding.h
+151 −0 model/ApiIeMapping.cpp
+93 −0 model/ApiIeMapping.h
+92 −0 model/ApiSignature.cpp
+77 −0 model/ApiSignature.h
+92 −0 model/CallbackName.cpp
+76 −0 model/CallbackName.h
+117 −0 model/DataToIntegrityProtectAndCipherBlock.cpp
+77 −0 model/DataToIntegrityProtectAndCipherBlock.h
+271 −0 model/DataToIntegrityProtectBlock.cpp
+119 −0 model/DataToIntegrityProtectBlock.h
+106 −0 model/EncodedHttpHeaderValue.cpp
+76 −0 model/EncodedHttpHeaderValue.h
+213 −0 model/ExtRedirectResponse.cpp
+105 −0 model/ExtRedirectResponse.h
+128 −0 model/FailedModificationInfo.cpp
+84 −0 model/FailedModificationInfo.h
+75 −0 model/FailureReason.cpp
+68 −0 model/FailureReason.h
+293 −0 model/FlatJweJson.cpp
+140 −0 model/FlatJweJson.h
+163 −0 model/FlatJwsJson.cpp
+102 −0 model/FlatJwsJson.h
+109 −0 model/HttpHeader.cpp
+84 −0 model/HttpHeader.h
+122 −0 model/HttpPayload.cpp
+92 −0 model/HttpPayload.h
+265 −0 model/IeInfo.cpp
+131 −0 model/IeInfo.h
+75 −0 model/IeLocation.cpp
+68 −0 model/IeLocation.h
+75 −0 model/IeType.cpp
+68 −0 model/IeType.h
+106 −0 model/IndexToEncryptedValue.cpp
+75 −0 model/IndexToEncryptedValue.h
+153 −0 model/IntendedN32Purpose.cpp
+95 −0 model/IntendedN32Purpose.h
+219 −0 model/IpxProviderSecInfo.cpp
+95 −0 model/IpxProviderSecInfo.h
+177 −0 model/MetaData.cpp
+99 −0 model/MetaData.h
+134 −0 model/MlModelInterInd.cpp
+85 −0 model/MlModelInterInd.h
+194 −0 model/Modifications.cpp
+96 −0 model/Modifications.h
+75 −0 model/N32Purpose.cpp
+68 −0 model/N32Purpose.h
+75 −0 model/N32ReleaseIndication.cpp
+68 −0 model/N32ReleaseIndication.h
+101 −0 model/N32fContextInfo.cpp
+76 −0 model/N32fContextInfo.h
+109 −0 model/N32fErrorDetail.cpp
+84 −0 model/N32fErrorDetail.h
+337 −0 model/N32fErrorInfo.cpp
+134 −0 model/N32fErrorInfo.h
+75 −0 model/N32fErrorType.cpp
+68 −0 model/N32fErrorType.h
+149 −0 model/N32fReformattedReqMsg.cpp
+87 −0 model/N32fReformattedReqMsg.h
+149 −0 model/N32fReformattedRspMsg.cpp
+87 −0 model/N32fReformattedRspMsg.h
+615 −0 model/ProblemDetailsMsgForwarding.cpp
+220 −0 model/ProblemDetailsMsgForwarding.h
+171 −0 model/ProtectionPolicy.cpp
+87 −0 model/ProtectionPolicy.h
+126 −0 model/RedirectResponseAddInfo.cpp
+78 −0 model/RedirectResponseAddInfo.h
+242 −0 model/RequestLine.cpp
+126 −0 model/RequestLine.h
+182 −0 model/RiErrorInformation.cpp
+97 −0 model/RiErrorInformation.h
+609 −0 model/SecNegotiateReqData.cpp
+187 −0 model/SecNegotiateReqData.h
+569 −0 model/SecNegotiateRspData.cpp
+178 −0 model/SecNegotiateRspData.h
+398 −0 model/SecParamExchReqData.cpp
+133 −0 model/SecParamExchReqData.h
+348 −0 model/SecParamExchRspData.cpp
+133 −0 model/SecParamExchRspData.h
+75 −0 model/SecurityCapability.cpp
+68 −0 model/SecurityCapability.h
+203 −0 model/TelescopicMapping.cpp
+96 −0 model/TelescopicMapping.h
+83 −0 model/sepp_model.cmake
+16 −4 ngap/ngap_msgs/PduSessionResourceSetupResponse.cpp
+70 −40 pfcp/3gpp_29.244.cpp
+1,389 −237 pfcp/3gpp_29.244.hpp
+845 −49 pfcp/msg_pfcp.hpp
57 changes: 57 additions & 0 deletions src/common/api_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,63 @@ bool api_conv::profile_api_to_nrf_profile(
.get()
->add_pcf_info(info);
} break;
case NF_TYPE_SEPP: {
Logger::nrf_app().debug("\tSEPP profile, SEPP Info");
profile.get()->set_nf_type(NF_TYPE_SEPP);
sepp_info_t info = {};
SeppInfo sepp_info_api = api_profile.getSeppInfo();
// SEPP Prefix
if (sepp_info_api.seppPrefixIsSet()) {
info.sepp_prefix = sepp_info_api.getSeppPrefix();
Logger::nrf_app().debug(
"\t\tSEPP Prefix: %s", info.sepp_prefix.c_str());
}
// SEPP Ports
if (sepp_info_api.seppPortsIsSet()) {
for (const auto& port_entry : sepp_info_api.getSeppPorts()) {
info.sepp_ports[port_entry.first] = port_entry.second;
Logger::nrf_app().debug(
"\t\tInterface: %s - Port: %d", port_entry.first.c_str(),
port_entry.second);
}
}
// Remote PLMN List
if (sepp_info_api.remotePlmnListIsSet()) {
for (const auto& plmn_api : sepp_info_api.getRemotePlmnList()) {
plmn_t plmn = {};
plmn.mcc = plmn_api.getMcc();
plmn.mnc = plmn_api.getMnc();
info.remote_plmn_list.push_back(plmn);
Logger::nrf_app().debug(
"\t\tRemote PLMN (MCC: %s, MNC: %s)", plmn.mcc.c_str(),
plmn.mnc.c_str());
}
}
// Remote SNPN List
if (sepp_info_api.remoteSnpnListIsSet()) {
for (const auto& snpn_api : sepp_info_api.getRemoteSnpnList()) {
snpn_id_t snpn = {};
snpn.plmn_id.mcc = snpn_api.getMcc();
snpn.plmn_id.mnc = snpn_api.getMnc();
snpn.nid = snpn_api.getNid();
info.remote_snpn_list.push_back(snpn);
Logger::nrf_app().debug(
"\t\tRemote SNPN (PLMN - MCC: %s, MNC: %s, NID: %s)",
snpn.plmn_id.mcc.c_str(), snpn.plmn_id.mnc.c_str(),
snpn.nid.c_str());
}
}
// ToDo: N32 Purposes currently not implemented in the model
// if (sepp_info_api.n32PurposesIsSet()) {
// for (const auto& purpose : sepp_info_api.getN32Purposes()) {
// info.n32_purposes.push_back(purpose);
// Logger::nrf_app().debug("\t\tPurpose: %s", purpose.c_str());
// }
// }
(std::static_pointer_cast<sepp_profile>(profile))
.get()
->add_sepp_info(info);
} break;
default: {
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/nrf_app/nrf_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ void nrf_app::handle_register_nf_instance(
sn = std::make_shared<pcf_profile>(m_event_sub);
} break;

case NF_TYPE_SEPP: {
sn = std::make_shared<sepp_profile>(m_event_sub);
} break;

default: {
sn = std::make_shared<nrf_profile>(m_event_sub);
}
Expand Down
173 changes: 171 additions & 2 deletions src/nrf_app/nrf_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ void pcf_profile::get_pcf_info(pcf_info_t& infos) const {
//------------------------------------------------------------------------------
void pcf_profile::display() {
nrf_profile::display();
Logger::nrf_app().debug("\tUDR Info");
Logger::nrf_app().debug("\tPCF Info");
Logger::nrf_app().debug("\t\tGroupId: %s", pcf_info.groupid.c_str());
for (auto dnn : pcf_info.dnn_list) {
Logger::nrf_app().debug("\t\t DNN: %s", dnn.c_str());
Expand Down Expand Up @@ -1790,7 +1790,7 @@ bool pcf_profile::remove_profile_info(const std::string& path) {
//------------------------------------------------------------------------------
void pcf_profile::to_json(nlohmann::json& data) const {
nrf_profile::to_json(data);
// UDR Info
// PCF Info
data["pcfInfo"]["groupId"] = pcf_info.groupid;
data["pcfInfo"]["dnnList"] = nlohmann::json::array();
data["pcfInfo"]["supiRanges"] = nlohmann::json::array();
Expand All @@ -1814,3 +1814,172 @@ void pcf_profile::to_json(nlohmann::json& data) const {
data["pcfInfo"]["dnnList"].push_back(dnn);
}
}

// SEPP INFO
// SEPP INFO
// ------------------------------------------------------------------------------
void sepp_profile::add_sepp_info(const sepp_info_t& info) {
sepp_info = info;
}

//------------------------------------------------------------------------------
void sepp_profile::get_sepp_info(sepp_info_t& infos) const {
infos = sepp_info;
}

//------------------------------------------------------------------------------
void sepp_profile::display() {
nrf_profile::display();
Logger::nrf_app().debug("\tSEPP Info");
if (!sepp_info.sepp_prefix.empty()) {
Logger::nrf_app().debug(
"\t\tSEPP Prefix: %s", sepp_info.sepp_prefix.c_str());
}
if (!sepp_info.sepp_ports.empty()) {
Logger::nrf_app().debug("\t\tSEPP Ports:");
for (const auto& port_entry : sepp_info.sepp_ports) {
Logger::nrf_app().debug(
"\t\t\tInterface: %s - Port: %d", port_entry.first.c_str(),
port_entry.second);
}
}
if (!sepp_info.remote_plmn_list.empty()) {
Logger::nrf_app().debug("\t\tRemote PLMN List:");
for (const auto& plmn : sepp_info.remote_plmn_list) {
Logger::nrf_app().debug(
"\t\t\tPLMN (MCC: %s, MNC: %s)", plmn.mcc.c_str(), plmn.mnc.c_str());
}
}
if (!sepp_info.remote_snpn_list.empty()) {
Logger::nrf_app().debug("\t\tRemote SNPN List:");
for (const auto& snpn : sepp_info.remote_snpn_list) {
Logger::nrf_app().debug(
"\t\t\tSNPN (PLMN - MCC: %s, MNC: %s, NID: %s)",
snpn.plmn_id.mcc.c_str(), snpn.plmn_id.mnc.c_str(), snpn.nid.c_str());
}
}
if (!sepp_info.n32_purposes.empty()) {
Logger::nrf_app().debug("\t\tN32 Purposes:");
for (const auto& purpose : sepp_info.n32_purposes) {
Logger::nrf_app().debug("\t\t\tPurpose: %s", purpose.c_str());
}
}
}

//------------------------------------------------------------------------------
bool sepp_profile::add_profile_info(
const std::string& path, const std::string& value) {
bool result = nrf_profile::add_profile_info(path, value);
if (result) return true;

// add an element to a list of json object
if (path.compare("seppInfo") == 0) {
Logger::nrf_app().info("Does not support this operation for seppInfo");
return false;
}

if ((path.compare("nfInstanceId") != 0) and
(path.compare("nfInstanceName") != 0) and
(path.compare("nfType") != 0) and (path.compare("nfStatus") != 0) and
(path.compare("heartBeatTimer") != 0) and (path.compare("fqdn") != 0) and
(path.compare("plmnList") != 0) and
(path.compare("ipv4Addresses") != 0) and
(path.compare("priority") != 0) and (path.compare("capacity") != 0) and
(path.compare("nfServices") != 0) and (path.compare("seppInfo") != 0)) {
Logger::nrf_app().debug("Add new member: %s", path.c_str());
// add new member
json_data[path] = value;
return true;
}
return false;
}

//------------------------------------------------------------------------------
bool sepp_profile::replace_profile_info(
const std::string& path, const std::string& value) {
bool result = nrf_profile::replace_profile_info(path, value);
if (result) return true;

if (path.compare("seppInfo") == 0) {
Logger::nrf_app().debug("Does not support this operation for seppInfo");
return false;
}

if ((path.compare("nfInstanceId") != 0) and
(path.compare("nfInstanceName") != 0) and
(path.compare("nfType") != 0) and (path.compare("nfStatus") != 0) and
(path.compare("heartBeatTimer") != 0) and (path.compare("fqdn") != 0) and
(path.compare("plmnList") != 0) and
(path.compare("ipv4Addresses") != 0) and
(path.compare("priority") != 0) and (path.compare("capacity") != 0) and
(path.compare("nfServices") != 0) and (path.compare("seppInfo") != 0)) {
Logger::nrf_app().debug("Member (%s) not found!", path.c_str());
return false;
}

return false;
}

//------------------------------------------------------------------------------
bool sepp_profile::remove_profile_info(const std::string& path) {
bool result = nrf_profile::remove_profile_info(path);
if (result) return true;

if (path.compare("seppInfo") == 0) {
Logger::nrf_app().debug("Do not support this operation for seppInfo");
return false;
}

if ((path.compare("nfInstanceId") != 0) and
(path.compare("nfInstanceName") != 0) and
(path.compare("nfType") != 0) and (path.compare("nfStatus") != 0) and
(path.compare("heartBeatTimer") != 0) and (path.compare("fqdn") != 0) and
(path.compare("plmnList") != 0) and
(path.compare("ipv4Addresses") != 0) and
(path.compare("priority") != 0) and (path.compare("capacity") != 0) and
(path.compare("nfServices") != 0) and (path.compare("seppInfo") != 0)) {
Logger::nrf_app().debug("Member (%s) not found!", path.c_str());
return false;
}
return false;
}

//------------------------------------------------------------------------------
void sepp_profile::to_json(nlohmann::json& data) const {
nrf_profile::to_json(data);

if (!sepp_info.sepp_prefix.empty()) {
data["seppInfo"]["seppPrefix"] = sepp_info.sepp_prefix;
}

if (!sepp_info.sepp_ports.empty()) {
data["seppInfo"]["seppPorts"] = nlohmann::json::object();
for (const auto& port_entry : sepp_info.sepp_ports) {
data["seppInfo"]["seppPorts"][port_entry.first] = port_entry.second;
}
}

if (!sepp_info.remote_plmn_list.empty()) {
data["seppInfo"]["remotePlmnList"] = nlohmann::json::array();
for (const auto& plmn : sepp_info.remote_plmn_list) {
nlohmann::json plmn_json;
plmn_json["mcc"] = plmn.mcc;
plmn_json["mnc"] = plmn.mnc;
data["seppInfo"]["remotePlmnList"].push_back(plmn_json);
}
}

if (!sepp_info.remote_snpn_list.empty()) {
data["seppInfo"]["remoteSnpnList"] = nlohmann::json::array();
for (const auto& snpn : sepp_info.remote_snpn_list) {
nlohmann::json snpn_json;
snpn_json["plmnId"]["mcc"] = snpn.plmn_id.mcc;
snpn_json["plmnId"]["mnc"] = snpn.plmn_id.mnc;
snpn_json["nid"] = snpn.nid;
data["seppInfo"]["remoteSnpnList"].push_back(snpn_json);
}
}
if (!sepp_info.n32_purposes.empty()) {
data["seppInfo"]["n32Purposes"] = sepp_info.n32_purposes;
}
}
72 changes: 72 additions & 0 deletions src/nrf_app/nrf_profile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,78 @@ class pcf_profile : public nrf_profile {
pcf_info_t pcf_info;
};

class sepp_profile : public nrf_profile {
public:
sepp_profile(nrf_event& ev) : nrf_profile(ev, NF_TYPE_SEPP) {
sepp_info = {};
}

sepp_profile(nrf_event& ev, const std::string& id) : nrf_profile(ev, id) {
nf_type = NF_TYPE_SEPP;
sepp_info = {};
}

sepp_profile(sepp_profile& b) = delete;

~sepp_profile() {}

/*
* Add SEPP info
* @param [const sepp_info_t &] info: SEPP info
* @return void
*/
void add_sepp_info(const sepp_info_t& info);

/*
* Get SEPP info
* @param [sepp_info_t &] info: SEPP info
* @return void
*/
void get_sepp_info(sepp_info_t& info) const;

/*
* Print related-information for a SEPP profile
* @param void
* @return void
*/
void display() override;

/*
* Update a new value for a member of SEPP profile
* @param [const std::string &] path: member name
* @param [const std::string &] value: new value
* @return true if success, otherwise false
*/
bool replace_profile_info(
const std::string& path, const std::string& value) override;

/*
* Add a new value for a member of SEPP profile
* @param [const std::string &] path: member name
* @param [const std::string &] value: new value
* @return true if success, otherwise false
*/
bool add_profile_info(
const std::string& path, const std::string& value) override;

/*
* Remove value of a member of SEPP profile
* @param [const std::string &] path: member name
* @return true if success, otherwise false
*/
bool remove_profile_info(const std::string& path) override;

/*
* Represent SEPP profile as json object
* @param [nlohmann::json &] data: Json data
* @return void
*/
void to_json(nlohmann::json& data) const override;

private:
sepp_info_t sepp_info;
};

} // namespace app
} // namespace nrf
} // namespace oai
Expand Down