aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-05-15 14:48:04 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-05-23 14:55:00 +0200
commitdefc3c8caf518306637ac579ec9b856f50dbb8ec (patch)
tree71d14ec1340b9231eb0497dce43f26cec7138563 /include
parent2d95ab67d100a4747f7965b5be07e00453222f87 (diff)
implement periodic Location Update expiry in the VLR
Remove subscribers which fail to send periodic Location Updates from the list of subscribers known to the VLR. This complements the IMSI detach procedure: periodic LU expiry triggers an implicit IMSI detach. Expired subscribers are purged from a periodic timer which iterates over all subscribers once per minute. Subscribers with an active connection do not expire. This is controlled by the subscriber conn FSM which sets a subscriber's the LU expiry timeout value to GSM_SUBSCRIBER_NO_EXPIRATION while a connection is active. Add support for fake time with osmo_clock_gettime() to msc_vlr tests. This functionality existed in OpenBSC but was lost during the nitb split. This code took some inspiration from the OpenBSC implementation. Related: OS#1976 Change-Id: Iebdee8b12d22acfcfb265ee41e71cfc8d9eb3ba9
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/msc/gsm_subscriber.h2
-rw-r--r--include/osmocom/msc/vlr.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/include/osmocom/msc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h
index 16e1037c0..01d9c582c 100644
--- a/include/osmocom/msc/gsm_subscriber.h
+++ b/include/osmocom/msc/gsm_subscriber.h
@@ -17,8 +17,6 @@
#define GSM_SUBSCRIBER_FIRST_CONTACT 0x00000001
/* gprs_sgsn.h defines additional flags including and above bit 16 (0x10000) */
-#define GSM_SUBSCRIBER_NO_EXPIRATION 0x0
-
enum gsm_subscriber_field {
GSM_SUBSCRIBER_IMSI,
GSM_SUBSCRIBER_TMSI,
diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index 0a9ef6fb5..f12d75882 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -20,6 +20,9 @@
struct log_target;
+#define VLR_SUBSCRIBER_NO_EXPIRATION 0
+#define VLR_SUBSCRIBER_LU_EXPIRATION_INTERVAL 60 /* in seconds */
+
/* from 3s to 10s */
#define GSM_29002_TIMER_S 10
/* from 15s to 30s */
@@ -148,6 +151,7 @@ struct vlr_subscr {
struct osmo_fsm_inst *proc_arq_fsm;
bool lu_complete;
+ time_t expire_lu;
void *msc_conn_ref;
@@ -237,6 +241,7 @@ struct vlr_instance {
struct llist_head operations;
struct gsup_client *gsup_client;
struct vlr_ops ops;
+ struct osmo_timer_list lu_expire_timer;
struct {
bool retrieve_imeisv_early;
bool retrieve_imeisv_ciphered;
@@ -379,6 +384,7 @@ void vlr_subscr_cancel_attach_fsm(struct vlr_subscr *vsub,
enum osmo_fsm_term_cause fsm_cause,
uint8_t gsm48_cause);
+void vlr_subscr_enable_expire_lu(struct vlr_subscr *vsub);
/* Process Acccess Request FSM */