laforge submitted this change.
umts_cell_id_name: Use 3-digit MCC and 2/3-digit MNC based on VTY config
Printing the PLMN 001-01 as "1-1" like the existing code is just weird,
and also doesn't differentiate between 2-digit and 3-digit MNC in the
output.
Change-Id: I015ad84a6f61b4420f6bfdaa60e8e1b53a71589c
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 33353f2..82ae279 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -193,7 +193,12 @@
const char *umts_cell_id_name(const struct umts_cell_id *ucid)
{
- return talloc_asprintf(OTC_SELECT, "%u-%u-L%u-R%u-S%u-C%u", ucid->mcc, ucid->mnc, ucid->lac, ucid->rac,
+ const char *fmtstr = "%03u-%02u-L%u-R%u-S%u-C%u";
+
+ if (g_hnbgw->config.plmn.mnc_3_digits)
+ fmtstr = "%03u-%03u-L%u-R%u-S%u-C%u";
+
+ return talloc_asprintf(OTC_SELECT, fmtstr, ucid->mcc, ucid->mnc, ucid->lac, ucid->rac,
ucid->sac, ucid->cid);
}
To view, visit change 36202. To unsubscribe, or for help writing mail filters, visit settings.