Change in osmo-msc[master]: Use GSM23003_MSISDN_MAX_DIGITS from libosmogsm

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sat May 25 19:01:17 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/14188


Change subject: Use GSM23003_MSISDN_MAX_DIGITS from libosmogsm
......................................................................

Use GSM23003_MSISDN_MAX_DIGITS from libosmogsm

Change-Id: If9eb46b83b6ad45f210b86b46dd416352adcc3ff
Depends on: Idc74f4d94ad44b9fc1b6d43178f5f33d551ebfb1
---
M include/osmocom/msc/vlr.h
M src/libmsc/msc_t.c
M src/libmsc/sms_queue.c
M tests/sms_queue/sms_queue_test.c
4 files changed, 5 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/14188/1

diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index b1c0d5d..56314b7 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -113,7 +113,6 @@
 struct vlr_instance;
 
 #define VLR_NAME_LENGTH 160
-#define VLR_MSISDN_LENGTH 15
 
 /* The VLR subscriber is the part of the GSM subscriber state in VLR (CS) or
  * SGSN (PS), particularly while interacting with the HLR via GSUP */
@@ -127,7 +126,7 @@
 	/* Data from HLR */				/* 3GPP TS 23.008 */
 	/* Always use vlr_subscr_set_imsi() to write to imsi[] */
 	char imsi[GSM23003_IMSI_MAX_DIGITS+1];		/* 2.1.1.1 */
-	char msisdn[VLR_MSISDN_LENGTH+1];		/* 2.1.2 */
+	char msisdn[GSM23003_MSISDN_MAX_DIGITS+1];	/* 2.1.2 */
 	char name[VLR_NAME_LENGTH+1];			/* proprietary */
 	OSMO_LBUF_DECL(hlr, 16);			/* 2.4.7 */
 	uint32_t periodic_lu_timer;			/* 2.4.24 */
diff --git a/src/libmsc/msc_t.c b/src/libmsc/msc_t.c
index 8eefccc..6b96c26 100644
--- a/src/libmsc/msc_t.c
+++ b/src/libmsc/msc_t.c
@@ -75,7 +75,7 @@
 	int rc;
 	uint64_t started_at;
 	uint64_t ho_nr;
-	char ho_nr_str[VLR_MSISDN_LENGTH+1];
+	char ho_nr_str[GSM23003_MSISDN_MAX_DIGITS+1];
 	struct gsm_network *net = msc_t_net(msc_t);
 	bool usable = false;
 
@@ -417,7 +417,7 @@
 	struct rtp_stream *rtp_cn = msc_t->inter_msc.call_leg? msc_t->inter_msc.call_leg->rtp[RTP_TO_CN] : NULL;
 	/* Since it's BCD, it needs rounded-up half the char* length of an MSISDN plus a type byte.
 	 * But no need to introduce obscure math to save a few stack bytes, just have more. */
-	uint8_t msisdn_enc_buf[VLR_MSISDN_LENGTH + 1];
+	uint8_t msisdn_enc_buf[GSM23003_MSISDN_MAX_DIGITS+1];
 	/* Copy an_apdu and an_apdu->e_info in "copy-on-write" method, because they are const and we
 	 * need to add the Handover Number to e_info. */
 	const struct ran_handover_request_ack *r = &ran_dec->handover_request_ack;
diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index 2c380b2..6346c1d 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -66,7 +66,7 @@
 
 	struct llist_head pending_sms;
 
-	char last_msisdn[VLR_MSISDN_LENGTH+1];
+	char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1];
 };
 
 static int sms_subscr_cb(unsigned int, unsigned int, void *, void *);
diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c
index 25fc312..4918be2 100644
--- a/tests/sms_queue/sms_queue_test.c
+++ b/tests/sms_queue/sms_queue_test.c
@@ -158,7 +158,7 @@
 static void test_next_sms()
 {
 	int i;
-	char last_msisdn[VLR_MSISDN_LENGTH+1] = "";
+	char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1] = "";
 
 	printf("Testing smsq_take_next_sms()\n");
 

-- 
To view, visit https://gerrit.osmocom.org/14188
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If9eb46b83b6ad45f210b86b46dd416352adcc3ff
Gerrit-Change-Number: 14188
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190525/e231a3c6/attachment.html>


More information about the gerrit-log mailing list