diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-10-07 04:39:14 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-10-09 16:30:45 +0200 |
commit | 4335badd0e85341a2515c00e5b73d6a921ecdd1b (patch) | |
tree | c08b51738fc0e134af7fc7fbb9f9f274851a40b1 /include/osmocom/core | |
parent | 1a02e36c4c940d7b326fa58a9f8080f79b558bba (diff) |
utils: add osmo_is_hexstr(), add unit test
Will be used by OsmoHLR to validate VTY and CTRL input.
Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a
Diffstat (limited to 'include/osmocom/core')
-rw-r--r-- | include/osmocom/core/utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 <stdbool.h> + #include <osmocom/core/backtrace.h> #include <osmocom/core/talloc.h> @@ -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); + /*! @} */ |