Export names for gsm_chan_t and gsm48_chan_mode

This can be used with get_value_string() to improve debugging output.
This commit is contained in:
Max 2016-03-30 21:14:53 +02:00 committed by Harald Welte
parent 92c4ec293d
commit fb348eeff2
4 changed files with 34 additions and 1 deletions

View File

@ -28,6 +28,7 @@
#include <stdint.h>
#include <osmocom/core/defs.h>
#include <osmocom/core/utils.h>
#define ADD_MODULO(sum, delta, modulo) do { \
if ((sum += delta) >= modulo) \
@ -199,6 +200,8 @@ enum gsm_chan_t {
_GSM_LCHAN_MAX
};
extern const struct value_string gsm_chan_t_names[];
/* Deprectated functions */
/* Limit encoding and decoding to use no more than this amount of buffer bytes */
#define GSM_7BIT_LEGACY_MAX_BUFFER_SIZE 0x10000

View File

@ -2,6 +2,8 @@
#include <stdint.h>
#include <osmocom/core/utils.h>
/* GSM TS 04.08 definitions */
struct gsm_lchan;
@ -347,6 +349,8 @@ enum gsm48_chan_mode {
GSM48_CMODE_DATA_3k6 = 0x13,
};
extern const struct value_string gsm48_chan_mode_names[];
/* Chapter 9.1.2 */
struct gsm48_ass_cmd {
/* Semantic is from 10.5.2.5a */

View File

@ -32,7 +32,7 @@
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/gsm48.h>
#include <osmocom/gsm/gsm0502.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
@ -254,6 +254,30 @@ const char *rr_cause_name(uint8_t cause)
return get_value_string(rr_cause_names, cause);
}
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 },
};
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 },
};
static const struct value_string mi_type_names[] = {
{ GSM_MI_TYPE_NONE, "NONE" },
{ GSM_MI_TYPE_IMSI, "IMSI" },

View File

@ -144,6 +144,8 @@ gsm48_rr_att_tlvdef;
gsm48_mi_type_name;
gsm48_mcc_mnc_to_bcd;
gsm48_mcc_mnc_from_bcd;
gsm48_chan_mode_names;
gsm_chan_t_names;
gsm_7bit_decode;
gsm_7bit_decode_ussd;