aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/signal.h7
-rw-r--r--openbsc/src/gsm_subscriber.c3
2 files changed, 10 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index 2ce812d10..8f0f8cbd8 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -38,6 +38,7 @@ enum signal_subsystems {
SS_ABISIP,
SS_NM,
SS_LCHAN,
+ SS_SUBSCR,
};
/* SS_PAGING signals */
@@ -69,6 +70,12 @@ enum signal_lchan {
S_LCHAN_UNEXPECTED_RELEASE,
};
+/* SS_SUBSCR signals */
+enum signal_subscr {
+ S_SUBSCR_ATTACHED,
+ S_SUBSCR_DETACHED,
+};
+
typedef int signal_cbfn(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data);
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index 0bcbdf402..fe7bb6aca 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -32,6 +32,7 @@
#include <openbsc/paging.h>
#include <openbsc/debug.h>
#include <openbsc/paging.h>
+#include <openbsc/signal.h>
#include <openbsc/db.h>
LLIST_HEAD(active_subscribers);
@@ -170,11 +171,13 @@ int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)
s->net = bts->network;
/* Indicate "attached to LAC" */
s->lac = bts->location_area_code;
+ dispatch_signal(SS_SUBSCR, S_SUBSCR_ATTACHED, s);
break;
case GSM_SUBSCRIBER_UPDATE_DETACHED:
/* Only detach if we are currently in this area */
if (bts->location_area_code == s->lac)
s->lac = 0;
+ dispatch_signal(SS_SUBSCR, S_SUBSCR_DETACHED, s);
break;
default:
fprintf(stderr, "subscr_update with unknown reason: %d\n",