diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2018-05-22 18:29:14 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-09-13 13:51:37 +0000 |
commit | f7198d7dbb84d038a82eec5ad0b86f7f29ca411e (patch) | |
tree | ba6bdf8dbe9055009459ba28c900c98b5590656f /src/gprs/gprs_sgsn.c | |
parent | 941ee147f92b6064b5e5feff166ecfb97cea85b1 (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 'src/gprs/gprs_sgsn.c')
-rw-r--r-- | src/gprs/gprs_sgsn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index d8bca8577..977ae4898 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -40,6 +40,7 @@ #include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/gprs_utils.h> #include <osmocom/sgsn/signal.h> +#include <osmocom/sgsn/gprs_gmm_attach.h> #include <osmocom/sgsn/gprs_llc.h> #include <pdp.h> @@ -241,6 +242,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli, talloc_free(ctx); return NULL; } + ctx->gmm_att_req.fsm = osmo_fsm_inst_alloc(&gmm_attach_req_fsm, ctx, ctx, LOGL_DEBUG, "gb_gmm_req"); INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -273,6 +275,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx) talloc_free(ctx); return NULL; } + ctx->gmm_att_req.fsm = osmo_fsm_inst_alloc(&gmm_attach_req_fsm, ctx, ctx, LOGL_DEBUG, "gb_gmm_req"); /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -350,6 +353,9 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm) gprs_subscr_put(subscr); } + if (mm->gmm_att_req.fsm) + gmm_att_req_free(mm); + sgsn_mm_ctx_free(mm); mm = NULL; |