From 4335badd0e85341a2515c00e5b73d6a921ecdd1b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 7 Oct 2017 04:39:14 +0200 Subject: utils: add osmo_is_hexstr(), add unit test Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a --- include/osmocom/core/utils.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/osmocom/core') diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 855e6539..5f412139 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include @@ -89,4 +91,7 @@ uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); size_t osmo_strlcpy(char *dst, const char *src, size_t siz); +bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, + bool require_even); + /*! @} */ -- cgit v1.2.3