aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/sgsn/gprs_gmm_attach.h
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2018-05-22 18:29:14 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-13 13:51:37 +0000
commitf7198d7dbb84d038a82eec5ad0b86f7f29ca411e (patch)
treeba6bdf8dbe9055009459ba28c900c98b5590656f /include/osmocom/sgsn/gprs_gmm_attach.h
parent941ee147f92b6064b5e5feff166ecfb97cea85b1 (diff)
gprs_gmm: introduce a GMM Attach Request FSM
The old GMM Attach Request handling used a recursive function which can not handle certain states and is quite complex and hard to extend. The new FSM handles such request in a FSM and can be called multiple times. Change-Id: I58b9c17be9776a03bb2a5b21e99135cfefc8c912
Diffstat (limited to 'include/osmocom/sgsn/gprs_gmm_attach.h')
-rw-r--r--include/osmocom/sgsn/gprs_gmm_attach.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/osmocom/sgsn/gprs_gmm_attach.h b/include/osmocom/sgsn/gprs_gmm_attach.h
new file mode 100644
index 000000000..22fbd6f9d
--- /dev/null
+++ b/include/osmocom/sgsn/gprs_gmm_attach.h
@@ -0,0 +1,37 @@
+#ifndef GPRS_GMM_ATTACH_H
+#define GPRS_GMM_ATTACH_H
+
+#include <osmocom/core/fsm.h>
+
+struct sgsn_mm_ctx;
+
+enum gmm_attach_req_fsm_states {
+ ST_INIT,
+ ST_IDENTIY,
+ ST_RETRIEVE_AUTH,
+ ST_AUTH,
+ ST_ASK_VLR,
+ ST_ACCEPT,
+ ST_REJECT
+};
+
+enum gmm_attach_req_fsm_events {
+ E_ATTACH_REQ_RECV,
+ E_IDEN_RESP_RECV,
+ E_AUTH_RESP_RECV_SUCCESS,
+ E_AUTH_RESP_RECV_RESYNC,
+ E_ATTACH_ACCEPTED,
+ E_ATTACH_ACCEPT_SENT,
+ E_ATTACH_COMPLETE_RECV,
+ E_REJECT,
+ E_VLR_ANSWERED,
+};
+
+#define GMM_DISCARD_MS_WITHOUT_REJECT -1
+
+extern const struct value_string gmm_attach_req_fsm_event_names[];
+extern struct osmo_fsm gmm_attach_req_fsm;
+
+void gmm_att_req_free(struct sgsn_mm_ctx *mm);
+
+#endif // GPRS_GMM_ATTACH_H