summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/gsm_utils.h
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-12-26 18:03:17 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2019-01-03 02:21:23 +0100
commit5b5c3499cfd9b001215ae23ca86ba04c780abb46 (patch)
treef0b81967b281a9846c48d2e4cbae900e9286b681 /include/osmocom/gsm/gsm_utils.h
parent691ba52194e5b76a1da00a7e91d0370af69b4220 (diff)
gsm_utils: add enum osmo_rat_type, from osmo-msc enum ran_type
In the MSC, we have RAN types GERAN_A and UTRAN_IU, now we need a similar enum in osmo-hlr's GSUP client. Naming: in the MAP specifications, the RAN type is mostly called RAT type, (Radio Access Network vs. Radio Access Technology?). Since GSUP is more about MAP messages, I'm calling the enum osmo_rat_type. Rationale: osmo-msc and osmo-sgsn want to tell the osmo-hlr which RAT a subscriber is calling on. A subsequent patch will extend the GSUP protocol and add a RAT types IE. Change-Id: I659687aef7a4d67ca372a39fef31dee07aed7631
Diffstat (limited to 'include/osmocom/gsm/gsm_utils.h')
-rw-r--r--include/osmocom/gsm/gsm_utils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
index fe5903db..095ac41a 100644
--- a/include/osmocom/gsm/gsm_utils.h
+++ b/include/osmocom/gsm/gsm_utils.h
@@ -241,3 +241,16 @@ int gsm_7bit_decode_ussd(char *decoded, const uint8_t *user_data, uint8_t length
int gsm_7bit_encode(uint8_t *result, const char *data) OSMO_DEPRECATED("Use gsm_7bit_encode_n() instead");
int gsm_7bit_encode_ussd(uint8_t *result, const char *data, int *octets_written) OSMO_DEPRECATED("Use gsm_7bit_encode_n_ussd() instead");
int gsm_7bit_encode_oct(uint8_t *result, const char *data, int *octets_written) OSMO_DEPRECATED("Use gsm_7bit_encode_n() instead");
+
+enum osmo_rat_type {
+ OSMO_RAT_UNKNOWN = 0,
+ OSMO_RAT_GERAN_A,
+ OSMO_RAT_UTRAN_IU,
+
+ /* keep this last */
+ OSMO_RAT_COUNT
+};
+
+extern const struct value_string osmo_rat_type_names[];
+inline static const char *osmo_rat_type_name(enum osmo_rat_type val)
+{ return get_value_string(osmo_rat_type_names, val); }