aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libvlr/vlr_auth_fsm.h
blob: 226435f830a52deccdb99013d3b6694daf389370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once

#include <osmocom/core/utils.h>

/* Parameters to VLR_AUTH_E_MS_AUTH_RESP */
struct vlr_auth_resp_par {
	bool is_r99;
	bool is_utran;
	const uint8_t *res;
	unsigned int res_len;
	const uint8_t *auts;
};

/* Result communicated back to parent FMS */
enum vlr_auth_fsm_result {
	VLR_AUTH_RES_ABORTED,
	VLR_AUTH_RES_UNKNOWN_SUBSCR,
	VLR_AUTH_RES_PROC_ERR,
	VLR_AUTH_RES_AUTH_FAILED,
	VLR_AUTH_RES_PASSED,
};

extern const struct value_string vlr_auth_fsm_result_names[];
static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val)
{
	return get_value_string(vlr_auth_fsm_result_names, val);
}

enum vlr_fsm_auth_event {
	VLR_AUTH_E_START,
	/* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */
	VLR_AUTH_E_HLR_SAI_ACK,
	/* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */
	VLR_AUTH_E_HLR_SAI_NACK,
	/* FIXME: merge with NACK? */
	VLR_AUTH_E_HLR_SAI_ABORT,
	/* Authentication Response from MS */
	VLR_AUTH_E_MS_AUTH_RESP,
	/* Authentication Failure from MS */
	VLR_AUTH_E_MS_AUTH_FAIL,
	/* Identity Response (IMSI) from MS */
	VLR_AUTH_E_MS_ID_IMSI,
};

struct osmo_fsm vlr_auth_fsm;

struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub,
				     uint32_t log_level,
				     struct osmo_fsm_inst *parent,
				     uint32_t parent_term_event,
				     bool is_r99,
				     bool is_utran);