summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-17 17:58:24 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-18 15:57:42 +0100
commit182adecb983aeb632315871e0f5d47472d1e19db (patch)
tree2b20f2fd23fcfe5bdd735dfc85bdcee1e5d491c5
parent3d0a500f2d184884ead6064b4852000f3317266f (diff)
debug: log list of subscribers upon lookup
-rw-r--r--openbsc/src/libmsc/iu_cs.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/iu_cs.c b/openbsc/src/libmsc/iu_cs.c
index 4ff7416f9..bc37d2c92 100644
--- a/openbsc/src/libmsc/iu_cs.c
+++ b/openbsc/src/libmsc/iu_cs.c
@@ -36,6 +36,40 @@ static int same_ue_conn(struct ue_conn_ctx *a, struct ue_conn_ctx *b)
&& (a->conn_id == b->conn_id);
}
+static inline void log_subscribers(struct gsm_network *network)
+{
+ if (!log_check_level(DIUCS, LOGL_DEBUG))
+ return;
+
+ struct gsm_subscriber_connection *conn;
+ int i = 0;
+ llist_for_each_entry(conn, &network->subscr_conns, entry) {
+ DEBUGP(DIUCS, "%3d: %s", i++, subscr_name(conn->subscr));
+ switch (conn->via_iface) {
+ case IFACE_IU:
+ DEBUGPC(DIUCS, " Iu");
+ if (conn->iu.ue_ctx) {
+ DEBUGPC(DIUCS, " link %p, conn_id %d",
+ conn->iu.ue_ctx->link,
+ conn->iu.ue_ctx->conn_id
+ );
+ }
+ break;
+ case IFACE_A:
+ DEBUGPC(DIUCS, " A");
+ break;
+ case IFACE_UNKNOWN:
+ DEBUGPC(DIUCS, " ?");
+ break;
+ default:
+ DEBUGPC(DIUCS, " invalid");
+ break;
+ }
+ DEBUGPC(DIUCS, "\n");
+ }
+ DEBUGP(DIUCS, "subscribers registered: %d\n", i);
+}
+
/* Return an existing IuCS subscriber connection record for the given link and
* connection IDs, or return NULL if not found. */
static struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network,
@@ -43,6 +77,8 @@ static struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_networ
{
struct gsm_subscriber_connection *conn;
+ log_subscribers(network);
+
llist_for_each_entry(conn, &network->subscr_conns, entry) {
if (conn->via_iface != IFACE_IU)
continue;