summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-04 01:50:38 +0200
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-10-06 23:37:05 +0200
commit5f3218ea68ba71145e171be5f06015651a081e1e (patch)
tree99ff58a6a854d56b493681c20d54ea6e07f8990e
parentcf7766763017920227e59d1174a46f082a52fa7d (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 6b577b0bf..1b74256cd 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 {