[PATCH] Export names for gsm_chan_t and gsm48_chan_mode

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/OpenBSC@lists.osmocom.org/.

msuraev at sysmocom.de msuraev at sysmocom.de
Thu Mar 24 09:41:29 UTC 2016


From: Max <msuraev at sysmocom.de>

This can be used with get_value_string() to improve debugging output.
---
 include/osmocom/gsm/gsm_utils.h          | 12 ++++++++++++
 include/osmocom/gsm/protocol/gsm_04_08.h | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
index 6458447..fbe0ba0 100644
--- a/include/osmocom/gsm/gsm_utils.h
+++ b/include/osmocom/gsm/gsm_utils.h
@@ -199,6 +199,18 @@ enum gsm_chan_t {
 	_GSM_LCHAN_MAX
 };
 
+static const struct value_string gsm_chan_t_names[] = {
+	{ GSM_LCHAN_NONE,	"NONE" },
+	{ GSM_LCHAN_SDCCH,	"SDCCH" },
+	{ GSM_LCHAN_TCH_F,	"TCH_F" },
+	{ GSM_LCHAN_TCH_H,	"TCH_H" },
+	{ GSM_LCHAN_UNKNOWN,	"UNKNOWN" },
+	{ GSM_LCHAN_CCCH,	"CCCH" },
+	{ GSM_LCHAN_PDTCH,	"PDTCH" },
+	{ GSM_LCHAN_CBCH,	"CBCH" },
+	{ 0,			NULL },
+};
+
 /* Deprectated functions */
 /* Limit encoding and decoding to use no more than this amount of buffer bytes */
 #define GSM_7BIT_LEGACY_MAX_BUFFER_SIZE  0x10000
diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h
index d49b77f..87748d3 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -347,6 +347,18 @@ enum gsm48_chan_mode {
 	GSM48_CMODE_DATA_3k6	= 0x13,
 };
 
+static const struct value_string gsm48_chan_mode_names[] = {
+	{ GSM48_CMODE_SIGN,		"SIGNALLING" },
+	{ GSM48_CMODE_SPEECH_V1,	"SPEECH_V1" },
+	{ GSM48_CMODE_SPEECH_EFR,	"SPEECH_EFR" },
+	{ GSM48_CMODE_SPEECH_AMR,	"SPEECH_AMR" },
+	{ GSM48_CMODE_DATA_14k5,	"DATA_14k5" },
+	{ GSM48_CMODE_DATA_12k0,	"DATA_12k0" },
+	{ GSM48_CMODE_DATA_6k0,		"DATA_6k0" },
+	{ GSM48_CMODE_DATA_3k6,		"DATA_3k6" },
+	{ 0,				NULL },
+};
+
 /* Chapter 9.1.2 */
 struct gsm48_ass_cmd {
 	/* Semantic is from 10.5.2.5a */
-- 
2.7.4




More information about the OpenBSC mailing list