aboutsummaryrefslogtreecommitdiffstats
path: root/src/libvlr/vlr_auth_fsm.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-06-17 00:06:42 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-21 18:32:03 +0200
commitb8b85a1b2ef64f6a0655ce0069686d53b509b66b (patch)
tree5a30e32a8b94f0cbd98e31d58e2412f555614cc0 /src/libvlr/vlr_auth_fsm.h
parent53edff3c70cb2954f80b2d4f2e6e3f9a14e8609e (diff)
Add libvlr implementation
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
Diffstat (limited to 'src/libvlr/vlr_auth_fsm.h')
-rw-r--r--src/libvlr/vlr_auth_fsm.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/libvlr/vlr_auth_fsm.h b/src/libvlr/vlr_auth_fsm.h
new file mode 100644
index 000000000..226435f83
--- /dev/null
+++ b/src/libvlr/vlr_auth_fsm.h
@@ -0,0 +1,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);