aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-04 01:50:38 +0200
committerIvan Kluchnikov <kluchnikovi@gmail.com>2014-04-04 18:47:10 +0400
commit0f07f4c79376de4631ee84d6b639f997b78b0a05 (patch)
treea5d4fc7140f863416e1f560a38d15f08d8db354a
parent444d7d8e65447ca871db00828d2eda1490c2bbe7 (diff)
Introduce a standard way for printing a subscriber's info.
The intention is to standardize subscriber identification output in log files. At this moment we sometimes identify subscriber by id, sometimes by extension, sometimes by IMSI and sometimes do not idenify at all. This makes log analysis hard or impossible. This patch doesn't touch actual log output, as it's a separate thing and requires consideration before checking in.
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 7aae4c332..3dba9c55a 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -17,6 +17,10 @@
#define GSM_SUBSCRIBER_NO_EXPIRATION 0x0
+#define GSM_SUBS_FMT_STR "IMSI %s (id %llu, ext %s%s%s)"
+#define GSM_SUBS_FMT_VAL(x) (x)->imsi, (x)->id, (x)->extension, \
+ strlen((x)->name)?", name ":"", strlen((x)->name)?(x)->name:""
+
struct vty;
struct gsm_equipment {