Closed mogaika closed 6 months ago
The meat of this PR seems to be the recording of OVER_QUOTA and THRESHOLD_REACHED state in the URR. Tat seems resonable. But almost everything else looks to be to be just noise that is not doing anything useful.
Use union of array to access fields of urr_volume_counter_t in more straightforward way
I'm not convicend that this actually an improvement. The static function accessing the URRs will most likes be inlined (or can be force to be inline) in which case the compiler is high likely to generate almost the same or at least very similar code for the old and the new version. Changing the datastructur from an plain struct to an union where an array aliases the structure member makes this more error prone without adding any benefit.
Rename urr_measure_t to urr_volume_measure_t
Seems reasonable, but for the sake of reviewing this, it would be much easier to have a separate commit within the PR for the rename only.
Instead of trying to catch moment when traffic counter is stepped over quota/threshold, track quota/threshold statuses to more reliably catch case when we out of quota/threshold after URR update.