Harald Welte | b8b85a1 | 2016-06-17 00:06:42 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/utils.h> |
| 4 | |
| 5 | /* Parameters to VLR_AUTH_E_MS_AUTH_RESP */ |
| 6 | struct vlr_auth_resp_par { |
| 7 | bool is_r99; |
| 8 | bool is_utran; |
| 9 | const uint8_t *res; |
| 10 | unsigned int res_len; |
| 11 | const uint8_t *auts; |
| 12 | }; |
| 13 | |
| 14 | /* Result communicated back to parent FMS */ |
| 15 | enum vlr_auth_fsm_result { |
| 16 | VLR_AUTH_RES_ABORTED, |
| 17 | VLR_AUTH_RES_UNKNOWN_SUBSCR, |
| 18 | VLR_AUTH_RES_PROC_ERR, |
| 19 | VLR_AUTH_RES_AUTH_FAILED, |
| 20 | VLR_AUTH_RES_PASSED, |
| 21 | }; |
| 22 | |
| 23 | extern const struct value_string vlr_auth_fsm_result_names[]; |
| 24 | static inline const char *vlr_auth_fsm_result_name(enum vlr_auth_fsm_result val) |
| 25 | { |
| 26 | return get_value_string(vlr_auth_fsm_result_names, val); |
| 27 | } |
| 28 | |
| 29 | enum vlr_fsm_auth_event { |
| 30 | VLR_AUTH_E_START, |
| 31 | /* TS 23.018 OAS_VLR1(2): SendAuthInfo ACK from HLR */ |
| 32 | VLR_AUTH_E_HLR_SAI_ACK, |
| 33 | /* TS 23.018 OAS_VLR1(2): SendAuthInfo NACK from HLR */ |
| 34 | VLR_AUTH_E_HLR_SAI_NACK, |
| 35 | /* FIXME: merge with NACK? */ |
| 36 | VLR_AUTH_E_HLR_SAI_ABORT, |
| 37 | /* Authentication Response from MS */ |
| 38 | VLR_AUTH_E_MS_AUTH_RESP, |
| 39 | /* Authentication Failure from MS */ |
| 40 | VLR_AUTH_E_MS_AUTH_FAIL, |
| 41 | /* Identity Response (IMSI) from MS */ |
| 42 | VLR_AUTH_E_MS_ID_IMSI, |
| 43 | }; |
| 44 | |
| 45 | struct osmo_fsm vlr_auth_fsm; |
| 46 | |
| 47 | struct osmo_fsm_inst *auth_fsm_start(struct vlr_subscr *vsub, |
| 48 | uint32_t log_level, |
| 49 | struct osmo_fsm_inst *parent, |
| 50 | uint32_t parent_term_event, |
| 51 | bool is_r99, |
| 52 | bool is_utran); |