From d85f6d54da2f45919f0ea4de0ad54562f05b0b20 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 27 Dec 2012 00:40:32 +0100 Subject: osmo-nitb: Add a timer to regularly expire --- openbsc/src/osmo-nitb/bsc_hack.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'openbsc/src/osmo-nitb/bsc_hack.c') 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); -- cgit v1.2.3