path: root/include
diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2018-08-17 13:13:27 +0200
committerHarald Welte <laforge@gnumonks.org>2018-08-17 14:13:47 +0000
commit82f13612ce63b863d22bc28eaf3dcc25c364fb6c (patch)
treeb7aa36532abc0758928ec6b637b479a4e3f54c48 /include
parent67f1d1edf49258f37b021357b00c25c79d973ae8 (diff)
gbproxy: Add new VTY-managed timer: link-list clean-stale-timer
This timer allows periodically cleaning up stale links in link-list of each gbproxy_peer. Previous to this patch, this kind of cleanup (gbproxy_remove_stale_link_infos) was being done only as a consequence of external events being triggered, such as a message from that peer being received. It was found in a production network agreggating several BSS that some of them were offline for a longtime but gbproxy was still caching big amounts of really old link_info for the NSEI assigned to those BSS, because since they were probably turned off abruptely, no new messages were received from it which would trigger the cleanup. As a consequence, it has been observed that a timer to periodically clean up old entries (link-list max-age) is requird in case w don't receive messages from that NSEI periodically. Related: SYS#4431 Change-Id: Ic777016f6d4f0e30fb736484774ca46878f17b7a
Diffstat (limited to 'include')
1 files changed, 5 insertions, 0 deletions
diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
index 16082fcd..7e2ae42f 100644
--- a/include/osmocom/sgsn/gb_proxy.h
+++ b/include/osmocom/sgsn/gb_proxy.h
@@ -105,6 +105,8 @@ struct gbproxy_config {
struct osmo_plmn_id core_plmn;
uint8_t* core_apn;
size_t core_apn_size;
+ /* Frequency (sec) at which timer to clean stale links is fired (0 disabled) */
+ unsigned int clean_stale_timer_freq;
/* 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) */
@@ -151,6 +153,9 @@ struct gbproxy_peer {
struct rate_ctr_group *ctrg;
struct gbproxy_patch_state patch_state;
+ /* Fired periodically to clean up stale links from list */
+ struct osmo_timer_list clean_stale_timer;
struct gbproxy_tlli_state {