aboutsummaryrefslogtreecommitdiffstats
path: root/src/sgsn/sgsn_libgtp.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-09-02 16:45:27 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-09-03 15:22:12 +0200
commit31c4657c971e40407163034526aafeb9b5a83460 (patch)
tree3f034b28108531fdbc6c1911b12c4572690b96a2 /src/sgsn/sgsn_libgtp.c
parent2e91fee1ad5c69f9336716b57979eb7557251778 (diff)
Implement GMM State using osmocom FSM
State machine inspired in the one from TS 24.008 4.1.3.3.1. Some state transitions are inroduced in the code but are still commented out since we lack some functionalitites or improvements in the code to handle different scenarios. Most of the logic is still outside of the FSM, but at least now the states are handled in a sane way triggered by events. Change-Id: Idecb43c10d66224d4f9ba9320825040ce6cf9a07
Diffstat (limited to 'src/sgsn/sgsn_libgtp.c')
-rw-r--r--src/sgsn/sgsn_libgtp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 5e3f48f3..f6d7a690 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -51,6 +51,7 @@
#include <osmocom/sgsn/gprs_subscriber.h>
#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gprs_ranap.h>
+#include <osmocom/sgsn/gprs_gmm_fsm.h>
#include <gtp.h>
#include <pdp.h>
@@ -655,8 +656,8 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
msgb_bvci(msg) = mm->gb.bvci;
msgb_nsei(msg) = mm->gb.nsei;
- switch (mm->gmm_state) {
- case GMM_REGISTERED_SUSPENDED:
+ switch (mm->gmm_fsm->state) {
+ case ST_GMM_REGISTERED_SUSPENDED:
/* initiate PS PAGING procedure */
memset(&pinfo, 0, sizeof(pinfo));
pinfo.mode = BSSGP_PAGING_PS;
@@ -670,11 +671,11 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PAGING_PS]);
/* FIXME: queue the packet we received from GTP */
break;
- case GMM_REGISTERED_NORMAL:
+ case ST_GMM_REGISTERED_NORMAL:
break;
default:
LOGP(DGPRS, LOGL_ERROR, "GTP DATA IND for TLLI %08X in state "
- "%u\n", mm->gb.tlli, mm->gmm_state);
+ "%s\n", mm->gb.tlli, osmo_fsm_inst_state_name(mm->gmm_fsm));
msgb_free(msg);
return -1;
}