[PFCP] Support multiple Usage Report IEs in all messages (#1461)

* [PFCP] Properly check down_data_report inclusion building SessionReportRequest

* [PFCP] Support multiple Usage Report IEs in all messages
This commit is contained in:
Pau Espin 2022-03-31 02:43:35 +02:00 committed by GitHub
parent 038fb680f4
commit fbfb72c1b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 70 additions and 57 deletions

View File

@ -718,8 +718,8 @@ ogs_pkbuf_t *ogs_pfcp_build_session_report_request(
{
ogs_pfcp_message_t pfcp_message;
ogs_pfcp_session_report_request_t *req = NULL;
ogs_pfcp_downlink_data_service_information_t info;
unsigned int i;
ogs_assert(report);
@ -731,7 +731,7 @@ ogs_pkbuf_t *ogs_pfcp_build_session_report_request(
req->report_type.presence = 1;
req->report_type.u8 = report->type.value;
if (report->downlink_data.pdr_id) {
if (report->type.downlink_data_report) {
int info_len = 0;
req->downlink_data_report.presence = 1;
@ -776,54 +776,56 @@ ogs_pkbuf_t *ogs_pfcp_build_session_report_request(
}
if (report->type.usage_report) {
req->usage_report.presence = 1;
req->usage_report.urr_id.presence = 1;
req->usage_report.urr_id.u32 = report->usage_report.id;
req->usage_report.ur_seqn.presence = 1;
req->usage_report.ur_seqn.u32 = report->usage_report.seqn;
req->usage_report.usage_report_trigger.presence = 1;
req->usage_report.usage_report_trigger.u24 =
(report->usage_report.rep_triggers.reptri_5 << 16)
| (report->usage_report.rep_triggers.reptri_6 << 8)
| (report->usage_report.rep_triggers.reptri_7);
ogs_assert(report->num_of_usage_report > 0);
for (i = 0; i < report->num_of_usage_report; i++) {
req->usage_report[i].presence = 1;
req->usage_report[i].urr_id.presence = 1;
req->usage_report[i].urr_id.u32 = report->usage_report[i].id;
req->usage_report[i].ur_seqn.presence = 1;
req->usage_report[i].ur_seqn.u32 = report->usage_report[i].seqn;
req->usage_report[i].usage_report_trigger.presence = 1;
req->usage_report[i].usage_report_trigger.u24 =
(report->usage_report[i].rep_triggers.reptri_5 << 16)
| (report->usage_report[i].rep_triggers.reptri_6 << 8)
| (report->usage_report[i].rep_triggers.reptri_7);
if (report->usage_report.start_time) {
req->usage_report.start_time.presence = 1;
req->usage_report.start_time.u32 = report->usage_report.start_time;
if (report->usage_report[i].start_time) {
req->usage_report[i].start_time.presence = 1;
req->usage_report[i].start_time.u32 = report->usage_report[i].start_time;
}
if (report->usage_report[i].end_time) {
req->usage_report[i].end_time.presence = 1;
req->usage_report[i].end_time.u32 = report->usage_report[i].end_time;
}
if (report->usage_report[i].vol_measurement.flags) {
req->usage_report[i].volume_measurement.presence = 1;
ogs_pfcp_build_volume_measurement(
&req->usage_report[i].volume_measurement,
&report->usage_report[i].vol_measurement,
&usage_report_buf.vol_meas,
sizeof(usage_report_buf.vol_meas));
}
if (report->usage_report[i].dur_measurement) {
req->usage_report[i].duration_measurement.presence = 1;
req->usage_report[i].duration_measurement.u32 =
report->usage_report[i].dur_measurement;
}
if (report->usage_report[i].time_of_first_packet) {
req->usage_report[i].time_of_first_packet.presence = 1;
req->usage_report[i].time_of_first_packet.u32 =
report->usage_report[i].time_of_first_packet;
}
if (report->usage_report[i].time_of_last_packet) {
req->usage_report[i].time_of_last_packet.presence = 1;
req->usage_report[i].time_of_last_packet.u32 =
report->usage_report[i].time_of_last_packet;
}
}
if (report->usage_report.end_time) {
req->usage_report.end_time.presence = 1;
req->usage_report.end_time.u32 = report->usage_report.end_time;
}
if (report->usage_report.vol_measurement.flags) {
req->usage_report.volume_measurement.presence = 1;
ogs_pfcp_build_volume_measurement(
&req->usage_report.volume_measurement,
&report->usage_report.vol_measurement,
&usage_report_buf.vol_meas,
sizeof(usage_report_buf.vol_meas));
}
if (report->usage_report.dur_measurement) {
req->usage_report.duration_measurement.presence = 1;
req->usage_report.duration_measurement.u32 =
report->usage_report.dur_measurement;
}
if (report->usage_report.time_of_first_packet) {
req->usage_report.time_of_first_packet.presence = 1;
req->usage_report.time_of_first_packet.u32 =
report->usage_report.time_of_first_packet;
}
if (report->usage_report.time_of_last_packet) {
req->usage_report.time_of_last_packet.presence = 1;
req->usage_report.time_of_last_packet.u32 =
report->usage_report.time_of_last_packet;
}
}
if (report->error_indication.remote_f_teid_len) {

View File

@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by pfcp-tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2022-03-28 12:29:26.113044 by pespin
* Created on: 2022-03-30 17:00:53.610079 by pespin
* from 29244-g10.docx
******************************************************************************/
@ -2684,6 +2684,7 @@ ogs_tlv_desc_t ogs_pfcp_msg_desc_pfcp_session_modification_response =
&ogs_pfcp_tlv_desc_load_control_information,
&ogs_pfcp_tlv_desc_overload_control_information,
&ogs_pfcp_tlv_desc_usage_report_session_modification_response,
&ogs_tlv_desc_more8,
&ogs_pfcp_tlv_desc_failed_rule_id,
&ogs_pfcp_tlv_desc_additional_usage_reports_information,
&ogs_pfcp_tlv_desc_created_traffic_endpoint,
@ -2708,6 +2709,7 @@ ogs_tlv_desc_t ogs_pfcp_msg_desc_pfcp_session_deletion_response =
&ogs_pfcp_tlv_desc_load_control_information,
&ogs_pfcp_tlv_desc_overload_control_information,
&ogs_pfcp_tlv_desc_usage_report_session_deletion_response,
&ogs_tlv_desc_more8,
NULL,
}};
@ -2719,6 +2721,7 @@ ogs_tlv_desc_t ogs_pfcp_msg_desc_pfcp_session_report_request =
&ogs_pfcp_tlv_desc_report_type,
&ogs_pfcp_tlv_desc_downlink_data_report,
&ogs_pfcp_tlv_desc_usage_report_session_report_request,
&ogs_tlv_desc_more8,
&ogs_pfcp_tlv_desc_error_indication_report,
&ogs_pfcp_tlv_desc_load_control_information,
&ogs_pfcp_tlv_desc_overload_control_information,

View File

@ -20,7 +20,7 @@
/*******************************************************************************
* This file had been created by pfcp-tlv.py script v0.1.0
* Please do not modify this file but regenerate it via script.
* Created on: 2022-03-28 12:29:26.101574 by pespin
* Created on: 2022-03-30 17:00:53.600137 by pespin
* from 29244-g10.docx
******************************************************************************/
@ -1257,7 +1257,7 @@ typedef struct ogs_pfcp_session_modification_response_s {
ogs_pfcp_tlv_created_pdr_t created_pdr[8];
ogs_pfcp_tlv_load_control_information_t load_control_information;
ogs_pfcp_tlv_overload_control_information_t overload_control_information;
ogs_pfcp_tlv_usage_report_session_modification_response_t usage_report;
ogs_pfcp_tlv_usage_report_session_modification_response_t usage_report[8];
ogs_pfcp_tlv_failed_rule_id_t failed_rule_id;
ogs_pfcp_tlv_additional_usage_reports_information_t additional_usage_reports_information;
ogs_pfcp_tlv_created_traffic_endpoint_t created_updated_traffic_endpoint;
@ -1271,13 +1271,13 @@ typedef struct ogs_pfcp_session_deletion_response_s {
ogs_pfcp_tlv_offending_ie_t offending_ie;
ogs_pfcp_tlv_load_control_information_t load_control_information;
ogs_pfcp_tlv_overload_control_information_t overload_control_information;
ogs_pfcp_tlv_usage_report_session_deletion_response_t usage_report;
ogs_pfcp_tlv_usage_report_session_deletion_response_t usage_report[8];
} ogs_pfcp_session_deletion_response_t;
typedef struct ogs_pfcp_session_report_request_s {
ogs_pfcp_tlv_report_type_t report_type;
ogs_pfcp_tlv_downlink_data_report_t downlink_data_report;
ogs_pfcp_tlv_usage_report_session_report_request_t usage_report;
ogs_pfcp_tlv_usage_report_session_report_request_t usage_report[8];
ogs_pfcp_tlv_error_indication_report_t error_indication_report;
ogs_pfcp_tlv_load_control_information_t load_control_information;
ogs_pfcp_tlv_overload_control_information_t overload_control_information;

View File

@ -4,7 +4,8 @@ ies.append({ "ie_type" : "Offending IE", "ie_value" : "Offending IE", "presence"
ies.append({ "ie_type" : "Created PDR", "ie_value" : "Created PDR", "presence" : "C", "tlv_more" : "7", "comment" : "This IE shall be present if the cause is set to success, new PDR(s) were requested to be created and the UP function was requested to allocate the local F-TEID for the PDR(s).When present, this IE shall contain the PDR information associated to the PFCP session.See Table 7.5.3.2-1."})
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "Load Control Information", "presence" : "O", "tlv_more" : "0", "comment" : "The UP function may include this IE if it supports the load control feature and the feature is activated in the network.See Table 7.5.3.3-1."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "Overload Control Information", "presence" : "O", "tlv_more" : "0", "comment" : "During an overload condition, the UP function may include this IE if it supports the overload control feature and the feature is activated in the network."})
ies.append({ "ie_type" : "Usage Report Session Modification Response", "ie_value" : "Usage Report", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if: - the Query URR IE was present or the QAURR flag was set to 1 in the PFCP Session Modification Request, - traffic usage measurements for that URR are available at the UP function, and - the UP function decides to return some or all of the requested usage reports in the PFCP Session Modification Response.This IE shall be also present if: - a URR or the last PDR associated to a URR has been removed, - non-null traffic usage measurements for that URR are available in the UP function, and - the UP function decides to return some or all of the related usage reports in the PFCP Session Modification Response (see clause 5.2.2.3.1).Several IEs within the same IE type may be present to represent a list of Usage Reports."})
type_list["Usage Report Session Modification Response"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Usage Report Session Modification Response", "ie_value" : "Usage Report", "presence" : "C", "tlv_more" : "7", "comment" : "This IE shall be present if: - the Query URR IE was present or the QAURR flag was set to 1 in the PFCP Session Modification Request, - traffic usage measurements for that URR are available at the UP function, and - the UP function decides to return some or all of the requested usage reports in the PFCP Session Modification Response.This IE shall be also present if: - a URR or the last PDR associated to a URR has been removed, - non-null traffic usage measurements for that URR are available in the UP function, and - the UP function decides to return some or all of the related usage reports in the PFCP Session Modification Response (see clause 5.2.2.3.1).Several IEs within the same IE type may be present to represent a list of Usage Reports."})
ies.append({ "ie_type" : "Failed Rule ID", "ie_value" : "Failed Rule ID", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be included if the Cause IE indicates a rejection due to a rule creation or modification failure."})
ies.append({ "ie_type" : "Additional Usage Reports Information", "ie_value" : "Additional Usage Reports Information", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be included if the Query URR IE was present or the QAURR flag was set to 1 in the PFCP Session Modification Request, and usage reports need to be sent in additional PFCP Session Report Request messages (see clause 5.2.2.3.1).When present, this IE shall either indicate that additional usage reports will follow, or indicate the total number of usage reports that need to be sent in PFCP Session Report Request messages. "})
ies.append({ "ie_type" : "Created Traffic Endpoint", "ie_value" : "Created/Updated Traffic Endpoint", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if the cause is set to success, Traffic Endpoint(s) were requested to be created or updated, and the UP function was requested to allocate the local F-TEID for the Traffic Endpoint(s).When present, this IE shall contain the Traffic Endpoint information associated to the PFCP session.See Table 7.5.3.5-1."})

View File

@ -3,5 +3,6 @@ ies.append({ "ie_type" : "Cause", "ie_value" : "Cause", "presence" : "M", "tlv_m
ies.append({ "ie_type" : "Offending IE", "ie_value" : "Offending IE", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be included if the rejection is due to an conditional or mandatory IE missing or faulty."})
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "Load Control Information", "presence" : "O", "tlv_more" : "0", "comment" : "The UP function may include this IE if it supports the load control feature and the feature is activated in the network.See Table 7.5.3.3-1."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "Overload Control Information", "presence" : "O", "tlv_more" : "0", "comment" : "During an overload condition, the UP function may include this IE if it supports the overload control feature and the feature is activated in the network.See Table 7.5.3.4-1."})
ies.append({ "ie_type" : "Usage Report Session Deletion Response", "ie_value" : "Usage Report", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if a URR had been provisioned in the UP function for the PFCP session being deleted and traffic usage measurements for that URR are available at the UP function.Several IEs within the same IE type may be present to represent a list of Usage Reports."})
type_list["Usage Report Session Deletion Response"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Usage Report Session Deletion Response", "ie_value" : "Usage Report", "presence" : "C", "tlv_more" : "7", "comment" : "This IE shall be present if a URR had been provisioned in the UP function for the PFCP session being deleted and traffic usage measurements for that URR are available at the UP function.Several IEs within the same IE type may be present to represent a list of Usage Reports."})
msg_list[key]["ies"] = ies

View File

@ -1,7 +1,8 @@
ies = []
ies.append({ "ie_type" : "Report Type", "ie_value" : "Report Type", "presence" : "M", "tlv_more" : "0", "comment" : "This IE shall indicate the type of the report."})
ies.append({ "ie_type" : "Downlink Data Report", "ie_value" : "Downlink Data Report", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if the Report Type indicates a Downlink Data Report. "})
ies.append({ "ie_type" : "Usage Report Session Report Request", "ie_value" : "Usage Report", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if the Report Type indicates a Usage Report.Several IEs within the same IE type may be present to represent a list of Usage Reports."})
type_list["Usage Report Session Report Request"]["max_tlv_more"] = "7"
ies.append({ "ie_type" : "Usage Report Session Report Request", "ie_value" : "Usage Report", "presence" : "C", "tlv_more" : "7", "comment" : "This IE shall be present if the Report Type indicates a Usage Report.Several IEs within the same IE type may be present to represent a list of Usage Reports."})
ies.append({ "ie_type" : "Error Indication Report", "ie_value" : "Error Indication Report", "presence" : "C", "tlv_more" : "0", "comment" : "This IE shall be present if the Report Type indicates an Error Indication Report. "})
ies.append({ "ie_type" : "Load Control Information", "ie_value" : "Load Control Information", "presence" : "O", "tlv_more" : "0", "comment" : "The UP function may include this IE if it supports the load control feature and the feature is activated in the network.See Table 7.5.3.3-1."})
ies.append({ "ie_type" : "Overload Control Information", "ie_value" : "Overload Control Information", "presence" : "O", "tlv_more" : "0", "comment" : "During an overload condition, the UP function may include this IE if it supports the overload control feature and the feature is activated in the network.See Table 7.5.3.4-1."})

View File

@ -154,6 +154,10 @@ def get_cells(cells):
tlv_more = "3"
if ie_type == 'SDF Filter':
tlv_more = "7"
if (ie_type == 'Usage Report Session Report Request' or
ie_type == 'Usage Report Session Deletion Response' or
ie_type == 'Usage Report Session Modification Response'):
tlv_more = "7"
if ie_type == 'URR ID' and comment.find('Several IEs within the same IE type may be present') != -1:
tlv_more = "7"

View File

@ -1289,7 +1289,8 @@ typedef struct ogs_pfcp_user_plane_report_s {
ogs_pfcp_duration_measurement_t dur_measurement;
ogs_pfcp_time_of_first_packet_t time_of_first_packet;
ogs_pfcp_time_of_last_packet_t time_of_last_packet;
} usage_report;
} usage_report [OGS_MAX_NUM_OF_URR];
unsigned int num_of_usage_report;
struct {
ogs_pfcp_f_teid_t remote_f_teid;
int remote_f_teid_len;