diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2017-01-31 18:13:15 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-02-07 00:41:32 +0000 |
commit | 17a29ef3118d2c5b8a48e82b9f9bd9ca8cf5248d (patch) | |
tree | d0a3d5267b24192a47e5d07c7945d68f8b225705 /openbsc/src/gprs | |
parent | 2b5fb8ed66feaea181b8882ec31b67f606e5ab4f (diff) |
gprs/gprs_mm: add value_strings for PMM & MM states
Change-Id: I4e34dcd5e48c4dd73d63c6f865298ee7d9c864be
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r-- | openbsc/src/gprs/gprs_gmm.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index db272766a..1026474a1 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -105,6 +105,15 @@ static const struct tlv_definition gsm48_sm_att_tlvdef = { }, }; +static const struct value_string gprs_pmm_state_names[] = { + { PMM_DETACHED, "PMM DETACH" }, + { PMM_CONNECTED, "PMM CONNECTED" }, + { PMM_IDLE, "PMM IDLE" }, + { MM_IDLE, "MM IDLE" }, + { MM_READY, "MM READY" }, + { MM_STANDBY, "MM STANDBY" }, +}; + static int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx); static void mmctx_change_gtpu_endpoints_to_sgsn(struct sgsn_mm_ctx *mm_ctx) @@ -125,7 +134,9 @@ void mmctx_set_pmm_state(struct sgsn_mm_ctx *ctx, enum gprs_pmm_state state) if (ctx->pmm_state == state) return; - LOGMMCTXP(LOGL_INFO, ctx, "Changing PMM state from %i to %i\n", ctx->pmm_state, state); + LOGMMCTXP(LOGL_INFO, ctx, "Changing PMM state from %s to %s\n", + get_value_string(gprs_pmm_state_names, ctx->pmm_state), + get_value_string(gprs_pmm_state_names, state)); switch (state) { case PMM_IDLE: @@ -149,7 +160,9 @@ void mmctx_set_mm_state(struct sgsn_mm_ctx *ctx, enum gprs_pmm_state state) if (ctx->pmm_state == state) return; - LOGMMCTXP(LOGL_INFO, ctx, "Changing MM state from %i to %i\n", ctx->pmm_state, state); + LOGMMCTXP(LOGL_INFO, ctx, "Changing MM state from %s to %s\n", + get_value_string(gprs_pmm_state_names, ctx->pmm_state), + get_value_string(gprs_pmm_state_names, state)); ctx->pmm_state = state; } |