aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h2
-rw-r--r--openbsc/src/gsm_subscriber.c11
-rw-r--r--openbsc/src/vty_interface_layer3.c9
3 files changed, 19 insertions, 3 deletions
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 1318ae8fc..0f44a101e 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -88,6 +88,8 @@ struct gsm_subscriber *subscr_active_by_tmsi(struct gsm_network *net,
struct gsm_subscriber *subscr_active_by_imsi(struct gsm_network *net,
const char *imsi);
+int subscr_pending_requests(struct gsm_subscriber *subscr);
+
char *subscr_name(struct gsm_subscriber *subscr);
int subscr_purge_inactive(struct gsm_network *net);
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index 13260216e..f42c68868 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -345,3 +345,14 @@ void subscr_update_from_db(struct gsm_subscriber *sub)
{
db_subscriber_update(sub);
}
+
+int subscr_pending_requests(struct gsm_subscriber *sub)
+{
+ struct subscr_request *req;
+ int pending = 0;
+
+ llist_for_each_entry(req, &sub->requests, entry)
+ pending += 1;
+
+ return pending;
+}
diff --git a/openbsc/src/vty_interface_layer3.c b/openbsc/src/vty_interface_layer3.c
index a26f2e32e..4cba8c278 100644
--- a/openbsc/src/vty_interface_layer3.c
+++ b/openbsc/src/vty_interface_layer3.c
@@ -49,7 +49,7 @@
extern struct gsm_network *gsmnet_from_vty(struct vty *v);
-static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr)
+static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr, int pending)
{
int rc;
struct gsm_auth_info ainfo;
@@ -95,6 +95,9 @@ static void subscr_dump_full_vty(struct vty *vty, struct gsm_subscriber *subscr)
hexdump(atuple.kc, sizeof(atuple.kc)),
VTY_NEWLINE);
}
+ if (pending)
+ vty_out(vty, " Pending: %d%s",
+ subscr_pending_requests(subscr), VTY_NEWLINE);
vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE);
}
@@ -110,7 +113,7 @@ DEFUN(show_subscr_cache,
llist_for_each_entry(subscr, &active_subscribers, entry) {
vty_out(vty, " Subscriber:%s", VTY_NEWLINE);
- subscr_dump_full_vty(vty, subscr);
+ subscr_dump_full_vty(vty, subscr, 0);
}
return CMD_SUCCESS;
@@ -220,7 +223,7 @@ DEFUN(show_subscr,
return CMD_WARNING;
}
- subscr_dump_full_vty(vty, subscr);
+ subscr_dump_full_vty(vty, subscr, 1);
subscr_put(subscr);