Commit 1fb86a55 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

code cleanup

parent 8b47068f
...@@ -84,80 +84,4 @@ void xgpp_conv::pdn_ip_to_pfcp_ue_ip_address( ...@@ -84,80 +84,4 @@ void xgpp_conv::pdn_ip_to_pfcp_ue_ip_address(
; ;
} }
} }
//------------------------------------------------------------------------------
void xgpp_conv::pfcp_to_core_fteid(const pfcp::fteid_t &pfteid,
fteid_t &fteid) {
fteid.v4 = pfteid.v4;
fteid.v6 = pfteid.v6;
fteid.ipv4_address.s_addr = pfteid.ipv4_address.s_addr;
fteid.ipv6_address = pfteid.ipv6_address;
fteid.teid_gre_key = pfteid.teid;
}
//------------------------------------------------------------------------------
void xgpp_conv::pfcp_from_core_fteid(pfcp::fteid_t &pfteid,
const fteid_t &fteid) {
pfteid.chid = 0;
pfteid.ch = 0;
pfteid.choose_id = 0;
pfteid.v4 = fteid.v4;
pfteid.v6 = fteid.v6;
pfteid.ipv4_address.s_addr = fteid.ipv4_address.s_addr;
pfteid.ipv6_address = fteid.ipv6_address;
pfteid.teid = fteid.teid_gre_key;
}
//------------------------------------------------------------------------------
void xgpp_conv::pfcp_cause_to_core_cause(const pfcp::cause_t &pc, cause_t &c) {
switch (pc.cause_value) {
case pfcp::CAUSE_VALUE_REQUEST_ACCEPTED:
c.cause_value = REQUEST_ACCEPTED;
break;
case pfcp::CAUSE_VALUE_REQUEST_REJECTED:
c.cause_value = REQUEST_REJECTED;
break;
case pfcp::CAUSE_VALUE_SESSION_CONTEXT_NOT_FOUND:
case pfcp::CAUSE_VALUE_MANDATORY_IE_MISSING:
case pfcp::CAUSE_VALUE_CONDITIONAL_IE_MISSING:
case pfcp::CAUSE_VALUE_INVALID_LENGTH:
case pfcp::CAUSE_VALUE_MANDATORY_IE_INCORRECT:
case pfcp::CAUSE_VALUE_INVALID_FORWARDING_POLICY:
case pfcp::CAUSE_VALUE_INVALID_FTEID_ALLOCATION_OPTION:
case pfcp::CAUSE_VALUE_NO_ESTABLISHED_PFCP_ASSOCIATION:
case pfcp::CAUSE_VALUE_RULE_CREATION_MODIFICATION_FAILURE:
c.cause_value = SYSTEM_FAILURE; // ?
break;
case pfcp::CAUSE_VALUE_PFCP_ENTITY_IN_CONGESTION:
c.cause_value = APN_CONGESTION; // ? ...
break;
case pfcp::CAUSE_VALUE_NO_RESOURCES_AVAILABLE:
case pfcp::CAUSE_VALUE_SERVICE_NOT_SUPPORTED:
case pfcp::CAUSE_VALUE_SYSTEM_FAILURE:
default:
c.cause_value = SYSTEM_FAILURE; // ? ...
}
}
//------------------------------------------------------------------------------
bool xgpp_conv::endpoint_to_gtp_u_peer_address(
const endpoint &ep, gtp_u_peer_address_t &peer_address) {
switch (ep.family()) {
case AF_INET: {
const struct sockaddr_in *const sin =
reinterpret_cast<const sockaddr_in* const >(&ep.addr_storage);
peer_address.ipv4_address.s_addr = sin->sin_addr.s_addr;
peer_address.is_v4 = true;
return true;
}
break;
case AF_INET6: {
const struct sockaddr_in6 *const sin6 =
reinterpret_cast<const sockaddr_in6* const >(&ep.addr_storage);
peer_address.ipv6_address = sin6->sin6_addr;
peer_address.is_v4 = false;
return true;
}
break;
default:
return false;
}
}
...@@ -42,11 +42,6 @@ void pdn_ip_to_pfcp_ue_ip_address(const pdu_session_type_t &pdu_session_type, ...@@ -42,11 +42,6 @@ void pdn_ip_to_pfcp_ue_ip_address(const pdu_session_type_t &pdu_session_type,
const struct in_addr &ipv4_address, const struct in_addr &ipv4_address,
const struct in6_addr ipv6_address, const struct in6_addr ipv6_address,
pfcp::ue_ip_address_t &ue_ip_address); pfcp::ue_ip_address_t &ue_ip_address);
void pfcp_to_core_fteid(const pfcp::fteid_t &pfteid, fteid_t &fteid);
void pfcp_from_core_fteid(pfcp::fteid_t &pfteid, const fteid_t &fteid);
void pfcp_cause_to_core_cause(const pfcp::cause_t &pc, cause_t &c);
bool endpoint_to_gtp_u_peer_address(const endpoint &ep,
gtp_u_peer_address_t &gpa);
} }
#endif /* FILE_3GPP_CONVERSIONS_HPP_SEEN */ #endif /* FILE_3GPP_CONVERSIONS_HPP_SEEN */
...@@ -850,12 +850,7 @@ void session_update_sm_context_procedure::handle_itti_msg( ...@@ -850,12 +850,7 @@ void session_update_sm_context_procedure::handle_itti_msg(
n11_trigger.get()->req.get_pdu_session_id()); n11_trigger.get()->req.get_pdu_session_id());
pfcp::cause_t cause = { }; pfcp::cause_t cause = { };
::cause_t cause_gtp = { .cause_value = REQUEST_ACCEPTED }; resp.pfcp_ies.get(cause);
// must be there
if (resp.pfcp_ies.get(cause)) {
xgpp_conv::pfcp_cause_to_core_cause(cause, cause_gtp);
}
//list of accepted QFI(s) and AN Tunnel Info corresponding to the PDU Session //list of accepted QFI(s) and AN Tunnel Info corresponding to the PDU Session
std::vector<pfcp::qfi_t> list_of_qfis_to_be_modified = { }; std::vector<pfcp::qfi_t> list_of_qfis_to_be_modified = { };
...@@ -1246,12 +1241,7 @@ void session_release_sm_context_procedure::handle_itti_msg( ...@@ -1246,12 +1241,7 @@ void session_release_sm_context_procedure::handle_itti_msg(
n11_trigger.get()->req.get_pdu_session_id()); n11_trigger.get()->req.get_pdu_session_id());
pfcp::cause_t cause = { }; pfcp::cause_t cause = { };
::cause_t cause_gtp = { .cause_value = REQUEST_ACCEPTED }; resp.pfcp_ies.get(cause);
// must be there
if (resp.pfcp_ies.get(cause)) {
xgpp_conv::pfcp_cause_to_core_cause(cause, cause_gtp);
}
if (cause.cause_value == CAUSE_VALUE_REQUEST_ACCEPTED) { if (cause.cause_value == CAUSE_VALUE_REQUEST_ACCEPTED) {
Logger::smf_app().info("PDU Session Release SM Context accepted by UPF"); Logger::smf_app().info("PDU Session Release SM Context accepted by UPF");
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include <set> #include <set>
#include "3gpp_29.244.hpp" #include "3gpp_29.244.hpp"
//#include "3gpp_29.274.hpp"
#include "itti_msg_n11.hpp" #include "itti_msg_n11.hpp"
#include "itti_msg_n4.hpp" #include "itti_msg_n4.hpp"
#include "itti_msg_n4_restore.hpp" #include "itti_msg_n4_restore.hpp"
......
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