[PATCH 6/6] Introduce a standard way for printing a subscriber's info.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Alexander Chemeris alexander.chemeris at gmail.com
Fri Oct 4 00:42:29 UTC 2013


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.
---
 openbsc/include/openbsc/gsm_subscriber.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 78f9710..f21b3e6 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -15,6 +15,10 @@
 #define GSM_SUBSCRIBER_FIRST_CONTACT	0x00000001
 #define tmsi_from_string(str) strtoul(str, NULL, 10)
 
+#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 {
-- 
1.7.9.5





More information about the OpenBSC mailing list