blob: 61811316bed24297092541e18b8db61afd7163e6 [file] [log] [blame]
Sylvain Munautd04b9ed2010-06-14 20:52:04 +02001#ifndef _AUTH_H
2#define _AUTH_H
3
Neels Hofmeyr37984bd2016-03-30 11:22:24 +02004#include <osmocom/core/utils.h>
5
Sylvain Munautd04b9ed2010-06-14 20:52:04 +02006struct gsm_auth_tuple;
7struct gsm_subscriber;
8
Harald Welte86dda082010-12-23 18:07:49 +01009enum auth_action {
Neels Hofmeyrf9b212f2016-03-30 11:22:27 +020010 AUTH_ERROR = -1, /* Internal error */
Harald Welte86dda082010-12-23 18:07:49 +010011 AUTH_NOT_AVAIL = 0, /* No auth tuple available */
Neels Hofmeyrd2fa7a52016-03-10 23:30:37 +010012 AUTH_DO_AUTH_THEN_CIPH = 1, /* Firsth authenticate, then cipher */
Harald Welte86dda082010-12-23 18:07:49 +010013 AUTH_DO_CIPH = 2, /* Only ciphering */
14 AUTH_DO_AUTH = 3, /* Only authentication, no ciphering */
15};
16
Neels Hofmeyr37984bd2016-03-30 11:22:24 +020017extern const struct value_string auth_action_names[];
18static inline const char *auth_action_str(enum auth_action a)
19{
20 return get_value_string(auth_action_names, a);
21}
22
Sylvain Munautd04b9ed2010-06-14 20:52:04 +020023int auth_get_tuple_for_subscr(struct gsm_auth_tuple *atuple,
24 struct gsm_subscriber *subscr, int key_seq);
25
26#endif /* _AUTH_H */