summaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-nitb/bsc_hack.c
diff options
context:
space:
mode:
authorJan Luebbe <jluebbe@debian.org>2012-12-27 00:40:32 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-01-01 17:19:47 +0100
commit1c201c6055c67c8a082f647021e994b271028c68 (patch)
tree24172b4d605cd2903bf62f26d4f9df8811472d8e /openbsc/src/osmo-nitb/bsc_hack.c
parentbfbdeec714dc798eaa4bc398589efcf02be40138 (diff)
osmo-nitb: Add a timer to regularly expire
Diffstat (limited to 'openbsc/src/osmo-nitb/bsc_hack.c')
-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 40c6f4337..93630ae6a 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);