Unverified Commit a0e5b73d authored by kharade's avatar kharade

Fix IE Usage Report in SRR

parent 2f1802ec
......@@ -1169,6 +1169,8 @@ typedef struct usage_report_trigger_s {
uint16_t liusa : 1;
uint16_t timqu : 1;
uint16_t volqu : 1;
uint16_t tebur : 1;
uint16_t evequ : 1;
} usage_report_trigger_t;
//-------------------------------------
......@@ -1181,16 +1183,23 @@ typedef struct measurement_period_s {
// 8.2.43 Fully qualified PDN Connection Set Identifier (FQ-CSID)
// typedef fq_csid_t fq_csid_t;
// Extended as per Release 16.5.0, to handle stats related to packet count
//-------------------------------------
// 8.2.44 Volume Measurement
typedef struct volume_measurement_s {
uint8_t spare : 5;
uint8_t spare : 2;
uint8_t dlnop : 1;
uint8_t ulnop : 1;
uint8_t tonop : 1;
uint8_t dlvol : 1;
uint8_t ulvol : 1;
uint8_t tovol : 1;
uint64_t total_volume;
uint64_t uplink_volume;
uint64_t downlink_volume;
uint64_t total_nop;
uint64_t uplink_nop;
uint64_t downlink_nop;
} volume_measurement_t;
//-------------------------------------
......
......@@ -378,34 +378,34 @@ pfcp_ie* pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
// pfcp_measurement_method_ie(tlv); ie->load_from(is); return ie;
// }
// break;
// case PFCP_IE_USAGE_REPORT_TRIGGER: {
// pfcp_usage_report_trigger_ie *ie = new
// pfcp_usage_report_trigger_ie(tlv); ie->load_from(is); return
// ie;
// }
// break;
// case PFCP_IE_MEASUREMENT_PERIOD: {
// pfcp_measurement_period_ie *ie = new
// pfcp_measurement_period_ie(tlv); ie->load_from(is); return ie;
// }
// break;
case PFCP_IE_USAGE_REPORT_TRIGGER: {
pfcp_usage_report_trigger_ie* ie =
new pfcp_usage_report_trigger_ie(tlv);
ie->load_from(is);
return ie;
} break;
case PFCP_IE_MEASUREMENT_PERIOD: {
pfcp_measurement_period_ie* ie = new pfcp_measurement_period_ie(tlv);
ie->load_from(is);
return ie;
} break;
// case PFCP_IE_FQ_CSID: {
// pfcp_fq_csid_ie *ie = new pfcp_fq_csid_ie(tlv);
// ie->load_from(is);
// return ie;
// }
// break;
// case PFCP_IE_VOLUME_MEASUREMENT: {
// pfcp_volume_measurement_ie *ie = new
// pfcp_volume_measurement_ie(tlv); ie->load_from(is); return ie;
// }
// break;
// case PFCP_IE_DURATION_MEASUREMENT: {
// pfcp_duration_measurement_ie *ie = new
// pfcp_duration_measurement_ie(tlv); ie->load_from(is); return
// ie;
// }
// break;
case PFCP_IE_VOLUME_MEASUREMENT: {
pfcp_volume_measurement_ie* ie = new pfcp_volume_measurement_ie(tlv);
ie->load_from(is);
return ie;
} break;
case PFCP_IE_DURATION_MEASUREMENT: {
pfcp_duration_measurement_ie* ie =
new pfcp_duration_measurement_ie(tlv);
ie->load_from(is);
return ie;
} break;
// case PFCP_IE_APPLICATION_DETECTION_INFORMATION: {
// pfcp_application_detection_information_ie *ie = new
// pfcp_application_detection_information_ie(tlv);
......@@ -413,18 +413,17 @@ pfcp_ie* pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
// return ie;
// }
// break;
// case PFCP_IE_TIME_OF_FIRST_PACKET: {
// pfcp_time_of_first_packet_ie *ie = new
// pfcp_time_of_first_packet_ie(tlv); ie->load_from(is); return
// ie;
// }
// break;
// case PFCP_IE_TIME_OF_LAST_PACKET: {
// pfcp_time_of_last_packet_ie *ie = new
// pfcp_time_of_last_packet_ie(tlv); ie->load_from(is); return
// ie;
// }
// break;
case PFCP_IE_TIME_OF_FIRST_PACKET: {
pfcp_time_of_first_packet_ie* ie =
new pfcp_time_of_first_packet_ie(tlv);
ie->load_from(is);
return ie;
} break;
case PFCP_IE_TIME_OF_LAST_PACKET: {
pfcp_time_of_last_packet_ie* ie = new pfcp_time_of_last_packet_ie(tlv);
ie->load_from(is);
return ie;
} break;
// case PFCP_IE_QUOTA_HOLDING_TIME: {
// pfcp_quota_holding_time_ie *ie = new
// pfcp_quota_holding_time_ie(tlv); ie->load_from(is); return ie;
......@@ -448,18 +447,16 @@ pfcp_ie* pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
// return ie;
// }
// break;
// case PFCP_IE_START_TIME: {
// pfcp_start_time_ie *ie = new pfcp_start_time_ie(tlv);
// ie->load_from(is);
// return ie;
// }
// break;
// case PFCP_IE_END_TIME: {
// pfcp_end_time_ie *ie = new pfcp_end_time_ie(tlv);
// ie->load_from(is);
// return ie;
// }
// break;
case PFCP_IE_START_TIME: {
pfcp_start_time_ie* ie = new pfcp_start_time_ie(tlv);
ie->load_from(is);
return ie;
} break;
case PFCP_IE_END_TIME: {
pfcp_end_time_ie* ie = new pfcp_end_time_ie(tlv);
ie->load_from(is);
return ie;
} break;
// case PFCP_IE_QUERY_URR: {
// pfcp_query_urr_ie *ie = new pfcp_query_urr_ie(tlv);
// ie->load_from(is);
......@@ -482,13 +479,12 @@ pfcp_ie* pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
// return ie;
// }
// break;
// case PFCP_IE_USAGE_REPORT_WITHIN_SESSION_REPORT_REQUEST: {
// pfcp_usage_report_within_session_report_request_ie *ie = new
// pfcp_usage_report_within_session_report_request_ie(tlv);
// ie->load_from(is);
// return ie;
// }
// break;
case PFCP_IE_USAGE_REPORT_WITHIN_SESSION_REPORT_REQUEST: {
pfcp_usage_report_within_session_report_request_ie* ie =
new pfcp_usage_report_within_session_report_request_ie(tlv);
ie->load_from(is);
return ie;
} break;
case PFCP_IE_URR_ID: {
pfcp_urr_id_ie* ie = new pfcp_urr_id_ie(tlv);
ie->load_from(is);
......@@ -622,12 +618,11 @@ pfcp_ie* pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
// pfcp_remote_gtp_u_peer_ie(tlv); ie->load_from(is); return ie;
// }
// break;
// case PFCP_IE_UR_SEQN: {
// pfcp_ur_seqn_ie *ie = new pfcp_ur_seqn_ie(tlv);
// ie->load_from(is);
// return ie;
// }
// break;
case PFCP_IE_UR_SEQN: {
pfcp_ur_seqn_ie* ie = new pfcp_ur_seqn_ie(tlv);
ie->load_from(is);
return ie;
} break;
// case PFCP_IE_UPDATE_DUPLICATING_PARAMETERS: {
// pfcp_update_duplicating_parameters_ie *ie = new
// pfcp_update_duplicating_parameters_ie(tlv); ie->load_from(is);
......@@ -1411,6 +1406,12 @@ pfcp_msg::pfcp_msg(const pfcp_session_report_request& pfcp_ies)
new pfcp_downlink_data_report_ie(pfcp_ies.downlink_data_report.second));
add_ie(sie);
}
if (pfcp_ies.usage_report.first) {
std::shared_ptr<pfcp_usage_report_within_session_report_request_ie> sie(
new pfcp_usage_report_within_session_report_request_ie(
pfcp_ies.usage_report.second));
add_ie(sie);
}
// TODO std::pair<bool, pfcp::usage_report_within_pfcp_session_report_request>
// usage_report;
// TODO std::pair<bool, pfcp::error_indication_report>
......
This diff is collapsed.
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