use enum for operational state

This commit is contained in:
Harald Welte 2009-12-24 10:06:33 +01:00
parent 026a6c3389
commit d6847a940a
2 changed files with 9 additions and 3 deletions

View File

@ -485,6 +485,12 @@ enum abis_nm_avail_state {
NM_AVSTATE_OK = 0xff,
};
enum abis_nm_op_state {
NM_OPSTATE_DISABLED = 1,
NM_OPSTATE_ENABLED = 2,
NM_OPSTATE_NULL = 0xff,
};
/* Section 9.4.13: Channel Combination */
enum abis_nm_chan_comb {
NM_CHANC_TCHFull = 0x00, /* TCH/F + TCH/H + SACCH/TF */

View File

@ -540,11 +540,11 @@ static const char *obj_class_name(u_int8_t oc)
const char *nm_opstate_name(u_int8_t os)
{
switch (os) {
case 1:
case NM_OPSTATE_DISABLED:
return "Disabled";
case 2:
case NM_OPSTATE_ENABLED:
return "Enabled";
case 0xff:
case NM_OPSTATE_NULL:
return "NULL";
default:
return "RFU";