aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-02-04 12:30:44 +0100
committerHarald Welte <laforge@gnumonks.org>2019-02-05 09:23:20 +0000
commit57658ecdc74b7072c05cca6c2bc931f23b1460f6 (patch)
treea28ac7bfd80ffa5e5078fbce496e54e2cd09455c
parent761fa134a891c8a5e286fdf7c436a25c36c43831 (diff)
gsm_data: Add gsm_bts_name() just like we have gsm_{trx,ts,lchan}_name()
-rw-r--r--include/osmocom/bsc/gsm_data.h1
-rw-r--r--src/osmo-bsc/gsm_data.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 9f7ce8d..9f2f816 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1215,6 +1215,7 @@ static inline const char *gsm_pchan_id(enum gsm_phys_chan_config c)
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
const char *gsm_lchant_name(enum gsm_chan_t c);
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
+char *gsm_bts_name(const struct gsm_bts *bts);
char *gsm_trx_name(const struct gsm_bts_trx *trx);
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 7eee918..5d667bb 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -996,6 +996,16 @@ struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num)
static char ts2str[255];
+char *gsm_bts_name(const struct gsm_bts *bts)
+{
+ if (!bts)
+ snprintf(ts2str, sizeof(ts2str), "(bts=NULL)");
+ else
+ snprintf(ts2str, sizeof(ts2str), "(bts=%d)", bts->nr);
+
+ return ts2str;
+}
+
char *gsm_trx_name(const struct gsm_bts_trx *trx)
{
if (!trx)