Commit 2b79bfb1 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'measurement_period_ie_fix' into 'develop'

IE Measurement Period Fix

See merge request oai/cn5g/oai-cn5g-smf!117
parents 173c9bad ca3cf99e
...@@ -3653,52 +3653,58 @@ class pfcp_measurement_method_ie : public pfcp_ie { ...@@ -3653,52 +3653,58 @@ class pfcp_measurement_method_ie : public pfcp_ie {
// s.set(usage_report_trigger); // s.set(usage_report_trigger);
// } // }
//}; //};
////------------------------------------- //-------------------------------------
//// IE MEASUREMENT_PERIOD // IE MEASUREMENT_PERIOD
// class pfcp_measurement_period_ie : public pfcp_ie { class pfcp_measurement_period_ie : public pfcp_ie {
// public: public:
// uint8_t todo; uint32_t measurement_period;
//
// //-------- //--------
// pfcp_measurement_period_ie(const pfcp::measurement_period_t& b) : explicit pfcp_measurement_period_ie(const pfcp::measurement_period_t& b)
// pfcp_ie(PFCP_IE_MEASUREMENT_PERIOD){ : pfcp_ie(PFCP_IE_MEASUREMENT_PERIOD) {
// todo = 0; measurement_period = b.measurement_period;
// tlv.set_length(1); tlv.set_length(sizeof(measurement_period));
// } }
// //-------- //--------
// pfcp_measurement_period_ie() : pfcp_ie(PFCP_IE_MEASUREMENT_PERIOD){ pfcp_measurement_period_ie() : pfcp_ie(PFCP_IE_MEASUREMENT_PERIOD) {
// todo = 0; measurement_period = 0;
// tlv.set_length(1); tlv.set_length(sizeof(measurement_period));
// } }
// //-------- //--------
// pfcp_measurement_period_ie(const pfcp_tlv& t) : pfcp_ie(t) { explicit pfcp_measurement_period_ie(const pfcp_tlv& t) : pfcp_ie(t) {
// todo = 0; measurement_period = 0;
// }; };
// //-------- //--------
// void to_core_type(pfcp::measurement_period_t& b) { void to_core_type(pfcp::measurement_period_t& b) {
// b.todo = todo; b.measurement_period = measurement_period;
// } }
// //-------- //--------
// void dump_to(std::ostream& os) { void dump_to(std::ostream& os) {
// tlv.dump_to(os); tlv.dump_to(os);
// os.write(reinterpret_cast<const char*>(&todo), sizeof(todo)); auto be_measurement_period = htobe32(measurement_period);
// } os.write(
// //-------- reinterpret_cast<const char*>(&be_measurement_period),
// void load_from(std::istream& is) { sizeof(be_measurement_period));
// //tlv.load_from(is); }
// if (tlv.get_length() != 1) { //--------
// throw pfcp_tlv_bad_length_exception(tlv.type, tlv.get_length(), void load_from(std::istream& is) {
// __FILE__, __LINE__); // tlv.load_from(is);
// } if (tlv.get_length() != sizeof(measurement_period)) {
// is.read(reinterpret_cast<char*>(&todo), sizeof(todo)); throw pfcp_tlv_bad_length_exception(
// } tlv.type, tlv.get_length(), __FILE__, __LINE__);
// //-------- }
// void to_core_type(pfcp_ies_container& s) { is.read(
// pfcp::measurement_period_t measurement_period = {}; reinterpret_cast<char*>(&measurement_period),
// to_core_type(measurement_period); sizeof(measurement_period));
// s.set(measurement_period); measurement_period = be32toh(measurement_period);
// } }
//}; //--------
void to_core_type(pfcp_ies_container& s) {
pfcp::measurement_period_t v = {};
to_core_type(v);
s.set(v);
}
};
////------------------------------------- ////-------------------------------------
//// IE FQ_CSID //// IE FQ_CSID
// class pfcp_fq_csid_ie : public pfcp_ie { // class pfcp_fq_csid_ie : public pfcp_ie {
...@@ -8836,6 +8842,11 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie { ...@@ -8836,6 +8842,11 @@ class pfcp_create_urr_ie : public pfcp_grouped_ie {
new pfcp_reporting_triggers_ie(b.reporting_triggers.second)); new pfcp_reporting_triggers_ie(b.reporting_triggers.second));
add_ie(sie); add_ie(sie);
} }
if (b.urr_id.first) {
std::shared_ptr<pfcp_measurement_period_ie> sie(
new pfcp_measurement_period_ie(b.measurement_period.second));
add_ie(sie);
}
// ToDo: Optional IEs // ToDo: Optional IEs
} }
pfcp_create_urr_ie() : pfcp_grouped_ie(PFCP_IE_CREATE_URR) {} pfcp_create_urr_ie() : pfcp_grouped_ie(PFCP_IE_CREATE_URR) {}
......
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