aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorJan Luebbe <jluebbe@debian.org>2012-12-27 00:27:16 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-01-01 17:19:47 +0100
commitbfbdeec714dc798eaa4bc398589efcf02be40138 (patch)
treeda83e67a334e7fc912dcdecdc488ca0be96f84b2 /openbsc/include
parent4d62d6315132a2961e2f1ff40a08a616c6c02d98 (diff)
libmsc: Track and update the location update expiry
Set the subscriber expiry timeout to twice the duration of the location update period and provide functions subscr_expire() and db_subscriber_expire() to mark subscribers offline that have missed two location update periods. This patch increases the DB revision to 3, so the hlr will be incompatible with prior versions. We should allow 0 for T3212 as well to disable the location update period. In that case we will need a way to indicate that in the database.
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/db.h1
-rw-r--r--openbsc/include/openbsc/gsm_data.h3
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h2
3 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h
index d0c85ea30..25c2aea70 100644
--- a/openbsc/include/openbsc/db.h
+++ b/openbsc/include/openbsc/db.h
@@ -41,6 +41,7 @@ struct gsm_subscriber *db_get_subscriber(struct gsm_network *net,
enum gsm_subscriber_field field,
const char *subscr);
int db_sync_subscriber(struct gsm_subscriber *subscriber);
+int db_subscriber_expire(void *priv, void (*callback)(void *priv, long long unsigned int id));
int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber);
int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index ea9f601ea..feb692f7c 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -247,6 +247,9 @@ struct gsm_network {
int T3122;
int T3141;
+ /* timer to expire old location updates */
+ struct osmo_timer_list subscr_expire_timer;
+
/* Radio Resource Location Protocol (TS 04.31) */
struct {
enum rrlp_mode mode;
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 6cf85731b..78f9710c5 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -38,6 +38,7 @@ struct gsm_subscriber {
char name[GSM_NAME_LENGTH];
char extension[GSM_EXTENSION_LENGTH];
int authorized;
+ time_t expire_lu;
/* Temporary field which is not stored in the DB/HLR */
uint32_t flags;
@@ -98,6 +99,7 @@ char *subscr_name(struct gsm_subscriber *subscr);
int subscr_purge_inactive(struct gsm_network *net);
void subscr_update_from_db(struct gsm_subscriber *subscr);
+void subscr_expire(struct gsm_network *net);
/* internal */
struct gsm_subscriber *subscr_alloc(void);