gbproxy: Add VTY parameter: link stored-msgs-max-length

It was discovered in some prod setups that some TLLIs can maintain quite
long queues of msgb in case its IMSI is not acquired and the tlli is not
pruned due to link-list max-{age,length} being set to 0. As a result,
the osmo-gpbroxy steadly increases the list size of maintained TLLIs, and
some TLLI was found without IMSI catching already 1211 msgb.

Let's allow setting a maxiumum length for the queue storing those msgb
in a per TLLI base. If the limit is reached, oldest msgb are removed
before adding a new one.

Depends: libosmocore Change-Id I33b501e89a8f29e4aa121696bcbb13d4b83db40f

Related: SYS#4297

Change-Id: I4473be8604f80302df03ffdd5a13280dc072f824
diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index 70de3d7..16082fc 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -105,8 +105,12 @@
 	struct osmo_plmn_id core_plmn;
 	uint8_t* core_apn;
 	size_t core_apn_size;
+	/* If !0, Max age to consider a struct gbproxy_link_info as stale */
 	int tlli_max_age;
+	/* If !0, Max len of gbproxy_peer->list (list of struct gbproxy_link_info) */
 	int tlli_max_len;
+	/* If !0, Max len of gbproxy_link_info->stored_msgs (list of msgb) */
+	uint32_t stored_msgs_max_len;
 
 	/* Experimental config */
 	int patch_ptmsi;
@@ -171,6 +175,7 @@
 
 	int imsi_acq_pending;
 	struct llist_head stored_msgs;
+	uint32_t stored_msgs_len;
 	unsigned vu_gen_tx_bss;
 
 	int is_deregistered;