aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/utils.h
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-01-11 13:13:37 +0100
committerosmith <osmith@sysmocom.de>2019-01-14 14:39:57 +0000
commit894be2d9da60a8e0f7ffc0224e3f294ce49b70be (patch)
treea1dd3ddf90c21f61af54514243ef75071db94835 /include/osmocom/core/utils.h
parentbd6e7a9f2dd5d4e881a0a21ebdb29b7a76ebdc9a (diff)
gsm23003: add osmo_imei_str_valid()
Verify 14 digit and 15 digit IMEI strings. OsmoHLR will use the 14 digit version to check IMEIs before writing them to the DB. Place the Luhn checksum code in a dedicated osmo_luhn() function, so it can be used elsewhere. Related: OS#2541 Change-Id: Id2d2a3a93b033bafc74c62e15297034bf4aafe61
Diffstat (limited to 'include/osmocom/core/utils.h')
-rw-r--r--include/osmocom/core/utils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 04f2fb4b..987080e2 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -140,4 +140,6 @@ const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bu
uint32_t osmo_isqrt32(uint32_t x);
+const char osmo_luhn(const char* in, int in_len);
+
/*! @} */