[PATCH] libosmocore[master]: rsl: add rsl_act_type_name()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sat Jul 23 13:34:51 UTC 2016


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

rsl: add rsl_act_type_name()

Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
---
M include/osmocom/gsm/rsl.h
M src/gsm/libosmogsm.map
M src/gsm/rsl.c
3 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/561/1

diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h
index b140d48..5da6180 100644
--- a/include/osmocom/gsm/rsl.h
+++ b/include/osmocom/gsm/rsl.h
@@ -56,4 +56,12 @@
 struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr,
 			    uint8_t link_id, int transparent);
 
+extern const struct value_string rsl_act_type_names[];
+
+/*! \brief Return a human readable name for GSM 08.58 RSL_ACT_* constants. */
+static inline const char *rsl_act_type_name(uint8_t act_type)
+{
+	return get_value_string(rsl_act_type_names, act_type);
+}
+
 /*! @} */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index d597f10..9667ea0 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -276,6 +276,7 @@
 rsl_rll_push_l3;
 rsl_rll_simple;
 rsl_rlm_cause_name;
+rsl_act_type_names;
 
 rxlev2dbm;
 rxlev_stat_dump;
diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c
index c3c32a9..910e848 100644
--- a/src/gsm/rsl.c
+++ b/src/gsm/rsl.c
@@ -541,4 +541,17 @@
 	},
 };
 
+const struct value_string rsl_act_type_names[] = {
+	{ RSL_ACT_TYPE_INITIAL,	"INITIAL" },
+	{ RSL_ACT_TYPE_REACT,	"REACT" },
+	{ RSL_ACT_INTRA_IMM_ASS,	"INTRA_IMM_ASS" },
+	{ RSL_ACT_INTRA_NORM_ASS,	"INTRA_NORM_ASS" },
+	{ RSL_ACT_INTER_ASYNC,	"INTER_ASYNC" },
+	{ RSL_ACT_INTER_SYNC,	"INTER_SYNC" },
+	{ RSL_ACT_SECOND_ADD,	"SECOND_ADD" },
+	{ RSL_ACT_SECOND_MULTI,	"SECOND_MULTI" },
+	{ RSL_ACT_OSMO_PDCH,	"OSMO_PDCH" },
+	{ 0, NULL }
+};
+
 /*! @} */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list