implement support for 3-digit MNC with leading zeros

Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout
the code base to be able to handle an MNC < 100 that has three digits (leading
zeros).

Note that in gbproxy_test.ok, 0-0 changes to 000-000 instead of 000-00, because
the parsed ra buffer is 000000 which results in 000-000, while 00f000 would
result in 000-00. IOW this is expected.

Change-Id: I7437dfaa586689e2bef0d4be6537e5577a8f6c26
diff --git a/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c
index 92712ef..6fb32b7 100644
--- a/src/gprs/sgsn_auth.c
+++ b/src/gprs/sgsn_auth.c
@@ -133,9 +133,10 @@
 	if (check_net) {
 		/* We simply assume that the IMSI exists, as long as it is part
 		 * of 'our' network */
-		snprintf(mccmnc, sizeof(mccmnc), "%03d%02d",
-			 mmctx->ra.mcc, mmctx->ra.mnc);
-		if (strncmp(mccmnc, mmctx->imsi, 5) == 0)
+		snprintf(mccmnc, sizeof(mccmnc), "%s%s",
+			 osmo_mcc_name(mmctx->ra.mcc),
+			 osmo_mnc_name(mmctx->ra.mnc, mmctx->ra.mnc_3_digits));
+		if (strncmp(mccmnc, mmctx->imsi, mmctx->ra.mnc_3_digits ? 6 : 5) == 0)
 			return SGSN_AUTH_ACCEPTED;
 	}