From 9cd1e7417e76c98094a502131af779145a77c7b9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 4 Oct 2017 03:15:47 +0200 Subject: add osmo_imsi_str_valid() and osmo_msisdn_str_valid() Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522 --- include/osmocom/gsm/gsm23003.h | 4 ++++ include/osmocom/gsm/protocol/gsm_23_003.h | 1 + 2 files changed, 5 insertions(+) (limited to 'include/osmocom') diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h index 2bc75837..dd41bc5b 100644 --- a/include/osmocom/gsm/gsm23003.h +++ b/include/osmocom/gsm/gsm23003.h @@ -3,6 +3,7 @@ #pragma once #include +#include /* 23.003 Chapter 12.1 */ struct osmo_plmn_id { @@ -81,3 +82,6 @@ struct osmo_guti { struct osmo_gummei gummei; uint32_t mtmsi; }; + +bool osmo_imsi_str_valid(const char *imsi); +bool osmo_msisdn_str_valid(const char *msisdn); diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h b/include/osmocom/gsm/protocol/gsm_23_003.h index 94243feb..0e669399 100644 --- a/include/osmocom/gsm/protocol/gsm_23_003.h +++ b/include/osmocom/gsm/protocol/gsm_23_003.h @@ -4,6 +4,7 @@ /* Chapter 2.2 */ #define GSM23003_IMSI_MAX_DIGITS 15 +#define GSM23003_IMSI_MIN_DIGITS 6 /* Chapter 2.4 */ #define GSM23003_TMSI_NUM_BYTES 4 /* Chapter 2.5 */ -- cgit v1.2.3