Commit a7c8a089 authored by Rohan's avatar Rohan Committed by Rohan

IE Enterprise Specific - optional decoding in pfcp asscociation req/resp

parent ba332d2a
......@@ -5566,13 +5566,15 @@ class pfcp_association_setup_request : public pfcp_ies_container {
std::pair<bool, pfcp::cp_function_features_t> cp_function_features;
std::pair<bool, pfcp::user_plane_ip_resource_information_t>
user_plane_ip_resource_information;
std::pair<bool, pfcp::enterprise_specific_t> enterprise_specific;
pfcp_association_setup_request()
: node_id(),
recovery_time_stamp(),
up_function_features(),
cp_function_features(),
user_plane_ip_resource_information() {}
user_plane_ip_resource_information(),
enterprise_specific () {}
pfcp_association_setup_request(const pfcp_association_setup_request& i) {
node_id = i.node_id;
......@@ -5580,6 +5582,7 @@ class pfcp_association_setup_request : public pfcp_ies_container {
up_function_features = i.up_function_features;
cp_function_features = i.cp_function_features;
user_plane_ip_resource_information = i.user_plane_ip_resource_information;
enterprise_specific = i.enterprise_specific;
}
const char* get_msg_name() const { return "PFCP_ASSOCIATION_SETUP_REQUEST"; };
......@@ -5618,6 +5621,13 @@ class pfcp_association_setup_request : public pfcp_ies_container {
}
return false;
}
bool get(pfcp::enterprise_specific_t& v) const {
if (enterprise_specific.first) {
v = enterprise_specific.second;
return true;
}
return false;
}
void set(const pfcp::node_id_t& v) {
node_id.first = true;
......@@ -5639,6 +5649,10 @@ class pfcp_association_setup_request : public pfcp_ies_container {
user_plane_ip_resource_information.first = true;
user_plane_ip_resource_information.second = v;
}
void set(const pfcp::enterprise_specific_t& v) {
enterprise_specific.first = true;
enterprise_specific.second = v;
}
};
//------------------------------------------------------------------------------
......@@ -5653,6 +5667,7 @@ class pfcp_association_setup_response : public pfcp_ies_container {
std::pair<bool, pfcp::cp_function_features_t> cp_function_features;
std::pair<bool, pfcp::user_plane_ip_resource_information_t>
user_plane_ip_resource_information;
std::pair<bool, pfcp::enterprise_specific_t> enterprise_specific;
pfcp_association_setup_response()
: node_id(),
......@@ -5660,7 +5675,8 @@ class pfcp_association_setup_response : public pfcp_ies_container {
recovery_time_stamp(),
up_function_features(),
cp_function_features(),
user_plane_ip_resource_information() {}
user_plane_ip_resource_information(),
enterprise_specific () {}
pfcp_association_setup_response(const pfcp_association_setup_response& i) {
node_id = i.node_id;
......@@ -5669,6 +5685,7 @@ class pfcp_association_setup_response : public pfcp_ies_container {
up_function_features = i.up_function_features;
cp_function_features = i.cp_function_features;
user_plane_ip_resource_information = i.user_plane_ip_resource_information;
enterprise_specific = i.enterprise_specific;
}
const char* get_msg_name() const {
return "PFCP_ASSOCIATION_SETUP_RESPONSE";
......@@ -5716,6 +5733,13 @@ class pfcp_association_setup_response : public pfcp_ies_container {
}
return false;
}
bool get(pfcp::enterprise_specific_t& v) const {
if (enterprise_specific.first) {
v = enterprise_specific.second;
return true;
}
return false;
}
void set(const pfcp::node_id_t& v) {
node_id.first = true;
......@@ -5741,6 +5765,10 @@ class pfcp_association_setup_response : public pfcp_ies_container {
user_plane_ip_resource_information.first = true;
user_plane_ip_resource_information.second = v;
}
void set(const pfcp::enterprise_specific_t& v) {
enterprise_specific.first = true;
enterprise_specific.second = v;
}
};
//------------------------------------------------------------------------------
......
......@@ -372,6 +372,12 @@ void smf_n4::handle_receive_association_setup_request(
msg_ies_container.node_id.second,
msg_ies_container.recovery_time_stamp.second,
msg_ies_container.up_function_features.second, restore_n4_sessions);
} else if (msg_ies_container.enterprise_specific.first) {
pfcp_associations::get_instance().add_association(
msg_ies_container.node_id.second,
msg_ies_container.recovery_time_stamp.second,
msg_ies_container.up_function_features.second,
msg_ies_container.enterprise_specific.second, restore_n4_sessions);
} else {
pfcp_associations::get_instance().add_association(
msg_ies_container.node_id.second,
......@@ -446,6 +452,12 @@ void smf_n4::handle_receive_association_setup_response(
msg_ies_container.node_id.second,
msg_ies_container.recovery_time_stamp.second,
msg_ies_container.up_function_features.second, restore_n4_sessions);
} else if (msg_ies_container.enterprise_specific.first) {
pfcp_associations::get_instance().add_association(
msg_ies_container.node_id.second,
msg_ies_container.recovery_time_stamp.second,
msg_ies_container.up_function_features.second,
msg_ies_container.enterprise_specific.second, restore_n4_sessions);
} else {
pfcp_associations::get_instance().add_association(
msg_ies_container.node_id.second,
......
......@@ -215,6 +215,38 @@ bool pfcp_associations::add_association(
}
return true;
}
//------------------------------------------------------------------------------
bool pfcp_associations::add_association(
pfcp::node_id_t& node_id, pfcp::recovery_time_stamp_t& recovery_time_stamp,
pfcp::up_function_features_s& function_features,
pfcp::enterprise_specific_s& enterprise_specific,
bool& restore_n4_sessions) {
std::shared_ptr<pfcp_association> sa =
std::shared_ptr<pfcp_association>(nullptr);
if (get_association(node_id, sa)) {
itti_inst->timer_remove(sa->timer_heartbeat);
if (sa->recovery_time_stamp == recovery_time_stamp) {
restore_n4_sessions = false;
} else {
restore_n4_sessions = true;
}
sa->recovery_time_stamp = recovery_time_stamp;
sa->function_features.first = true;
sa->function_features.second = function_features;
} else {
restore_n4_sessions = false;
pfcp_association* association =
new pfcp_association(node_id, recovery_time_stamp, function_features);
sa = std::shared_ptr<pfcp_association>(association);
sa->recovery_time_stamp = recovery_time_stamp;
sa->function_features.first = true;
sa->function_features.second = function_features;
std::size_t hash_node_id = std::hash<pfcp::node_id_t>{}(node_id);
associations.insert((int32_t) hash_node_id, sa);
trigger_heartbeat_request_procedure(sa);
}
return true;
}
//------------------------------------------------------------------------------
bool pfcp_associations::update_association(
......
......@@ -190,6 +190,12 @@ class pfcp_associations {
pfcp::recovery_time_stamp_t& recovery_time_stamp,
pfcp::up_function_features_s& function_features,
bool& restore_n4_sessions);
bool add_association(
pfcp::node_id_t& node_id,
pfcp::recovery_time_stamp_t& recovery_time_stamp,
pfcp::up_function_features_s& function_features,
pfcp::enterprise_specific_s& enterprise_specific,
bool& restore_n4_sessions);
bool update_association(
pfcp::node_id_t& node_id,
pfcp::up_function_features_s& function_features);
......
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