[PATCH] openbsc[master]: gprs/gprs_mm: add value_strings for PMM & MM states

lynxis lazus gerrit-no-reply at lists.osmocom.org
Sat Feb 4 05:05:57 UTC 2017


Review at  https://gerrit.osmocom.org/1756

gprs/gprs_mm: add value_strings for PMM & MM states

Change-Id: I4e34dcd5e48c4dd73d63c6f865298ee7d9c864be
---
M openbsc/src/gprs/gprs_gmm.c
1 file changed, 15 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/56/1756/1

diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index db27276..1026474 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -105,6 +105,15 @@
 	},
 };
 
+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 @@
 	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 @@
 	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;
 }

-- 
To view, visit https://gerrit.osmocom.org/1756
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e34dcd5e48c4dd73d63c6f865298ee7d9c864be
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>


More information about the gerrit-log mailing list