rsl: add rsl_act_type_name()

Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
This commit is contained in:
Neels Hofmeyr 2016-07-18 23:54:01 +02:00
parent fd80f5a042
commit 47390764dd
3 changed files with 22 additions and 0 deletions

View File

@ -56,4 +56,12 @@ void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
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);
}
/*! @} */

View File

@ -276,6 +276,7 @@ rsl_rll_push_hdr;
rsl_rll_push_l3;
rsl_rll_simple;
rsl_rlm_cause_name;
rsl_act_type_names;
rxlev2dbm;
rxlev_stat_dump;

View File

@ -541,4 +541,17 @@ const struct tlv_definition rsl_ipac_eie_tlvdef = {
},
};
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 }
};
/*! @} */