bssgp: Compute and transmit queue delay

The specification 28.018,  allows to transmit the average LLC downlink
queueing delay in FLOW CONTROL BVC messages (BVC Measurement IE, see
GSM 28.018, 10.4.4 and 11.3.7).

This commit extends gprs_bssgp_pcu.cpp to compute the average delay
time between two subsequent FLOW CONTROL BVC messages. The average is
implemented as an arithmetic average without any weighting.

Ticket: OW#1432
Sponsored-by: On-Waves ehf
diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h
index 32b6728..aaaff7f 100644
--- a/src/gprs_bssgp_pcu.h
+++ b/src/gprs_bssgp_pcu.h
@@ -58,6 +58,10 @@
 	int bvc_reset;
 	int bvc_unblocked;
 
+	/* Flow control */
+	struct timeval queue_delay_sum;
+	unsigned queue_delay_count;
+
 	/** callbacks below */
 
 	/* The BSSGP has been unblocked */
@@ -78,4 +82,7 @@
 
 struct bssgp_bvc_ctx *gprs_bssgp_pcu_current_bctx(void);
 
+void gprs_bssgp_update_queue_delay(struct timeval *tv_recv,
+		struct timeval *tv_now);
+
 #endif // GPRS_BSSGP_PCU_H