From 26e30b1309517183db0ae56620195707f748ced4 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 7 Oct 2017 04:41:22 +0200 Subject: auth: add value_strings for osmo_sub_auth_type, comment on osmo_auth_alg_name() Add osmo_sub_auth_type_names[] and osmo_sub_auth_type_name(). Also add a hint to enum osmo_auth_algo's API doc that osmo_auth_alg_name() already exists (it is defined further below). Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda --- include/osmocom/crypt/auth.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 2f2a8d33..7064c999 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -7,6 +7,7 @@ #include #include +#include #define OSMO_A5_MAX_KEY_LEN_BYTES (128/8) @@ -17,7 +18,12 @@ enum osmo_sub_auth_type { OSMO_AUTH_TYPE_UMTS = 0x02, }; -/*! Authentication Algorithm */ +extern const struct value_string osmo_sub_auth_type_names[]; +static inline const char *osmo_sub_auth_type_name(enum osmo_sub_auth_type val) +{ return get_value_string(osmo_sub_auth_type_names, val); } + +/*! Authentication Algorithm. + * See also osmo_auth_alg_name() and osmo_auth_alg_parse(). */ enum osmo_auth_algo { OSMO_AUTH_ALG_NONE, OSMO_AUTH_ALG_COMP128v1, -- cgit v1.2.3