diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-05-17 11:53:21 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2023-05-19 08:53:50 +0000 |
commit | f05ac96fd6213ddc0705d1cfec1624fb615ff997 (patch) | |
tree | f778901bb34ffab81d4e5ae314b7ca0a6cd17704 /src/host/layer23/include/osmocom/bb/common | |
parent | 4ea84d3ae546bb6243ebe3ee90b4d1e7ded0d5b3 (diff) |
layer23: Migrate sim_ustate to enum + value_string
Change-Id: I83607caa0b76b6b30db59c53438a55726483b85d
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/common')
-rw-r--r-- | src/host/layer23/include/osmocom/bb/common/subscriber.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/subscriber.h b/src/host/layer23/include/osmocom/bb/common/subscriber.h index 1dd1869e..1a9bc6e0 100644 --- a/src/host/layer23/include/osmocom/bb/common/subscriber.h +++ b/src/host/layer23/include/osmocom/bb/common/subscriber.h @@ -1,13 +1,22 @@ #ifndef _SUBSCRIBER_H #define _SUBSCRIBER_H +#include <osmocom/core/utils.h> #include <osmocom/gsm/protocol/gsm_23_003.h> /* GSM 04.08 4.1.2.2 SIM update status */ -#define GSM_SIM_U0_NULL 0 -#define GSM_SIM_U1_UPDATED 1 -#define GSM_SIM_U2_NOT_UPDATED 2 -#define GSM_SIM_U3_ROAMING_NA 3 +enum gsm_sub_sim_ustate { + GSM_SIM_U0_NULL, + GSM_SIM_U1_UPDATED, + GSM_SIM_U2_NOT_UPDATED, + GSM_SIM_U3_ROAMING_NA, +}; +extern const struct value_string gsm_sub_sim_ustate_names[]; +static inline const char *gsm_sub_sim_ustate_name(enum gsm_sub_sim_ustate val) +{ + return get_value_string(gsm_sub_sim_ustate_names, val); +} + struct gsm_sub_plmn_list { struct llist_head entry; @@ -36,7 +45,7 @@ struct gsm_subscriber { /* status */ uint8_t sim_type; /* type of sim */ uint8_t sim_valid; /* sim inserted and valid */ - uint8_t ustate; /* update status */ + enum gsm_sub_sim_ustate ustate; /* update status */ uint8_t imsi_attached; /* attached state */ /* IMSI & co */ |