summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Luebbe <jluebbe@debian.org>2012-12-27 00:40:32 +0100
committerDaniel Willmann <daniel@totalueberwachung.de>2012-12-27 00:53:47 +0100
commitd85f6d54da2f45919f0ea4de0ad54562f05b0b20 (patch)
treea250c17dc6197d89786cf2401f4d1041273d5ad5
parent49c291a574a181a6b4c643865e72558a67c2a4f4 (diff)
osmo-nitb: Add a timer to regularly expiredaniel/t3212-work
-rw-r--r--openbsc/src/osmo-nitb/bsc_hack.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index 40c6f43..93630ae 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -63,6 +63,8 @@ static int use_db_counter = 1;
/* timer to store statistics */
#define DB_SYNC_INTERVAL 60, 0
+#define EXPIRE_INTERVAL 10, 0
+
static struct osmo_timer_list db_sync_timer;
static void create_pcap_file(char *file)
@@ -223,6 +225,12 @@ static void db_sync_timer_cb(void *data)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
}
+static void subscr_expire_cb(void *data)
+{
+ subscr_expire(bsc_gsmnet);
+ osmo_timer_schedule(&bsc_gsmnet->subscr_expire_timer, EXPIRE_INTERVAL);
+}
+
void talloc_ctx_init(void);
extern enum node_type bsc_vty_go_parent(struct vty *vty);
@@ -308,6 +316,10 @@ int main(int argc, char **argv)
if (use_db_counter)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
+ bsc_gsmnet->subscr_expire_timer.cb = subscr_expire_cb;
+ bsc_gsmnet->subscr_expire_timer.data = NULL;
+ osmo_timer_schedule(&bsc_gsmnet->subscr_expire_timer, EXPIRE_INTERVAL);
+
signal(SIGINT, &signal_handler);
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);