summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/common
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-05-17 11:53:21 +0200
committerlaforge <laforge@osmocom.org>2023-05-19 08:53:50 +0000
commitf05ac96fd6213ddc0705d1cfec1624fb615ff997 (patch)
treef778901bb34ffab81d4e5ae314b7ca0a6cd17704 /src/host/layer23/include/osmocom/bb/common
parent4ea84d3ae546bb6243ebe3ee90b4d1e7ded0d5b3 (diff)
layer23: Migrate sim_ustate to enum + value_string
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/common')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/subscriber.h19
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 */