aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-04-06 04:31:00 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-04-09 02:50:07 +0200
commit7f43f4e21aa63614df815be71b4a1b7d07fe9ce9 (patch)
tree87bda92509def4df606467c5b2639c7835b7b2fb
parent80326ca275012b527f306433d549879518660b23 (diff)
add gsm48_reject_value_namesneels/msc_fsm
There seems to be quite some confusion / overlap between enum gsm48_reject_value, gsm48_gsm_cause and gsm48_gmm_cause. I tried to go with gsm48_gsm_cause_names[], but e.g. GSM48_REJECT_CONGESTION is not represented. Instead of attempting to mix/merge those enums, provide a separate value string array for enum gsm48_reject_value. This will be used by osmo-msc's libvlr (refactoring of FSM result handling), I27bf8d68737ff1f8dc6d11fb1eac3d391aab0cb1. Change-Id: I6661f139e68a498fb1bef10c266c2f064b72774a
-rw-r--r--include/osmocom/gsm/protocol/gsm_04_08.h4
-rw-r--r--src/gsm/gsm48.c33
-rw-r--r--src/gsm/libosmogsm.map1
3 files changed, 38 insertions, 0 deletions
diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h
index 4a821cca..6a5fb3bb 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1509,6 +1509,10 @@ enum gsm48_reject_value {
GSM48_REJECT_MSC_TMP_NOT_REACHABLE = 16,
};
+extern const struct value_string gsm48_reject_value_names[];
+static inline const char *gsm48_reject_value_name(enum gsm48_reject_value val)
+{ return get_value_string(gsm48_reject_value_names, val); }
+
enum chreq_type {
CHREQ_T_EMERG_CALL,
CHREQ_T_CALL_REEST_TCH_F,
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index c2affaeb..468b2a9b 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -980,4 +980,37 @@ const char *gsm48_pdisc_msgtype_name(uint8_t pdisc, uint8_t msg_type)
return namebuf;
}
+const struct value_string gsm48_reject_value_names[] = {
+ { GSM48_REJECT_IMSI_UNKNOWN_IN_HLR, "IMSI_UNKNOWN_IN_HLR" },
+ { GSM48_REJECT_ILLEGAL_MS, "ILLEGAL_MS" },
+ { GSM48_REJECT_IMSI_UNKNOWN_IN_VLR, "IMSI_UNKNOWN_IN_VLR" },
+ { GSM48_REJECT_IMEI_NOT_ACCEPTED, "IMEI_NOT_ACCEPTED" },
+ { GSM48_REJECT_ILLEGAL_ME, "ILLEGAL_ME" },
+ { GSM48_REJECT_PLMN_NOT_ALLOWED, "PLMN_NOT_ALLOWED" },
+ { GSM48_REJECT_LOC_NOT_ALLOWED, "LOC_NOT_ALLOWED" },
+ { GSM48_REJECT_ROAMING_NOT_ALLOWED, "ROAMING_NOT_ALLOWED" },
+ { GSM48_REJECT_NETWORK_FAILURE, "NETWORK_FAILURE" },
+ { GSM48_REJECT_SYNCH_FAILURE, "SYNCH_FAILURE" },
+ { GSM48_REJECT_CONGESTION, "CONGESTION" },
+ { GSM48_REJECT_SRV_OPT_NOT_SUPPORTED, "SRV_OPT_NOT_SUPPORTED" },
+ { GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED, "RQD_SRV_OPT_NOT_SUPPORTED" },
+ { GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER, "SRV_OPT_TMP_OUT_OF_ORDER" },
+ { GSM48_REJECT_CALL_CAN_NOT_BE_IDENTIFIED, "CALL_CAN_NOT_BE_IDENTIFIED" },
+ { GSM48_REJECT_INCORRECT_MESSAGE, "INCORRECT_MESSAGE" },
+ { GSM48_REJECT_INVALID_MANDANTORY_INF, "INVALID_MANDANTORY_INF" },
+ { GSM48_REJECT_MSG_TYPE_NOT_IMPLEMENTED, "MSG_TYPE_NOT_IMPLEMENTED" },
+ { GSM48_REJECT_MSG_TYPE_NOT_COMPATIBLE, "MSG_TYPE_NOT_COMPATIBLE" },
+ { GSM48_REJECT_INF_ELEME_NOT_IMPLEMENTED, "INF_ELEME_NOT_IMPLEMENTED" },
+ { GSM48_REJECT_CONDTIONAL_IE_ERROR, "CONDTIONAL_IE_ERROR" },
+ { GSM48_REJECT_MSG_NOT_COMPATIBLE, "MSG_NOT_COMPATIBLE" },
+ { GSM48_REJECT_PROTOCOL_ERROR, "PROTOCOL_ERROR" },
+ { GSM48_REJECT_GPRS_NOT_ALLOWED, "GPRS_NOT_ALLOWED" },
+ { GSM48_REJECT_SERVICES_NOT_ALLOWED, "SERVICES_NOT_ALLOWED" },
+ { GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE, "MS_IDENTITY_NOT_DERVIVABLE" },
+ { GSM48_REJECT_IMPLICITLY_DETACHED, "IMPLICITLY_DETACHED" },
+ { GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN, "GPRS_NOT_ALLOWED_IN_PLMN" },
+ { GSM48_REJECT_MSC_TMP_NOT_REACHABLE, "MSC_TMP_NOT_REACHABLE" },
+ { 0, NULL }
+};
+
/*! @} */
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index dd4722e3..31717d55 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -287,6 +287,7 @@ gsm48_rr_msgtype_names;
gsm48_mm_msgtype_names;
gsm48_cc_msgtype_names;
gsm48_pdisc_msgtype_name;
+gsm48_reject_value_names;
gsm_7bit_decode;
gsm_7bit_decode_ussd;