summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2017-01-31 18:13:15 +0100
committerAlexander Couzens <lynxis@fe80.eu>2017-01-31 18:17:07 +0100
commit96cb26b555dda6fae9e3e96cc05cc551bd2978d5 (patch)
tree18d2e95f8aadbd0fa9086bd607d1c3cb85f9915a
parent0858c6e32f81b8caa82602024efe03630abb18b4 (diff)
gprs/gprs_mm: add value_strings for PMM & MM stateslynxis/sgsn
-rw-r--r--openbsc/src/gprs/gprs_gmm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 9f1e9f0..1718861 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_timer_cb(void *_mm);
@@ -129,7 +138,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:
@@ -153,7 +164,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));
switch (state) {
case MM_READY: