aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-30 11:22:24 +0200
committerHarald Welte <laforge@gnumonks.org>2016-03-31 11:56:00 +0200
commit37984bdb1b507446421e5aa6131ccdf117dd269f (patch)
treee7dea62884366f31181d35f85f9d15b3c5871114 /openbsc/include
parent56ea30ff3f9f98a4903d060196b185ce124d7eaa (diff)
Add MM Auth test; add auth_action_str() function
Add basic MM Authentication test setup, with fake DB access and RAND_bytes(). So far implement simple tests for IO error during DB access and missing auth entry. To print the auth action during tests, add struct auth_action_names and auth_action_str() inline function in auth.[hc].
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/auth.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/auth.h b/openbsc/include/openbsc/auth.h
index d41d1419b..90495bb58 100644
--- a/openbsc/include/openbsc/auth.h
+++ b/openbsc/include/openbsc/auth.h
@@ -1,6 +1,8 @@
#ifndef _AUTH_H
#define _AUTH_H
+#include <osmocom/core/utils.h>
+
struct gsm_auth_tuple;
struct gsm_subscriber;
@@ -11,6 +13,12 @@ enum auth_action {
AUTH_DO_AUTH = 3, /* Only authentication, no ciphering */
};
+extern const struct value_string auth_action_names[];
+static inline const char *auth_action_str(enum auth_action a)
+{
+ return get_value_string(auth_action_names, a);
+}
+
int auth_get_tuple_for_subscr(struct gsm_auth_tuple *atuple,
struct gsm_subscriber *subscr, int key_seq);