SMS: Add value_string for TS 04.11 CP and RP state

Change-Id: I1b2f6fc6f455b0ba2a5732c567a4867bca97c3b0
This commit is contained in:
Harald Welte 2018-01-24 16:50:11 +01:00
parent ea0bc9608c
commit d60e17ab0e
5 changed files with 27 additions and 0 deletions

View File

@ -64,4 +64,9 @@ int gsm411_smc_send(struct gsm411_smc_inst *inst, int msg_type,
int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg, int cp_msg_type);
extern const struct value_string gsm411_cp_state_names[];
static inline const char *gsm411_cp_state_name(enum gsm411_cp_state cp_state) {
return get_value_string(gsm411_cp_state_names, cp_state);
}
/*! @} */

View File

@ -45,4 +45,10 @@ int gsm411_smr_send(struct gsm411_smr_inst *inst, int msg_type,
int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type,
struct msgb *msg);
extern const struct value_string gsm411_rp_state_names[];
static inline const char *gsm411_rp_state_name(enum gsm411_rp_state rp_state) {
return get_value_string(gsm411_rp_state_names, rp_state);
}
/*! @} */

View File

@ -578,4 +578,11 @@ int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type,
return rc;
}
const struct value_string gsm411_cp_state_names[] = {
{ GSM411_CPS_IDLE, "IDLE" },
{ GSM411_CPS_MM_CONN_PENDING, "MM_CONN_PENDING" },
{ GSM411_CPS_WAIT_CP_ACK, "WAIT_CP_ACK" },
{ GSM411_CPS_MM_ESTABLISHED, "ESTABLISHD" },
{ 0, NULL }
};
/*! @} */

View File

@ -492,4 +492,11 @@ int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type,
return rc;
}
const struct value_string gsm411_rp_state_names[] = {
{ GSM411_RPS_IDLE, "IDLE" },
{ GSM411_RPS_WAIT_FOR_RP_ACK, "WAIT_FOR_RP_ACK" },
{ GSM411_RPS_WAIT_TO_TX_RP_ACK, "WAIT_TO_TX_RP_ACK" },
{ GSM411_RPS_WAIT_FOR_RETRANS_T,"WAIT_FOR_RETRANS_T" },
{ 0, NULL }
};
/*! @} */

View File

@ -197,7 +197,9 @@ gsm411_smr_recv;
gsm411_smr_send;
gsm411_unbcdify;
gsm411_cp_cause_strs;
gsm411_cp_state_names;
gsm411_rp_cause_strs;
gsm411_rp_state_names;
gsm414_msgt_names;