Change in libosmocore[master]: gsm_utils: add enum osmo_rat_type, from osmo-msc enum ran_type

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jan 3 01:21:35 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/12451


Change subject: gsm_utils: add enum osmo_rat_type, from osmo-msc enum ran_type
......................................................................

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
---
M include/osmocom/gsm/gsm_utils.h
M src/gsm/gsm_utils.c
M src/gsm/libosmogsm.map
3 files changed, 23 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/12451/1

diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
index fe5903d..095ac41 100644
--- a/include/osmocom/gsm/gsm_utils.h
+++ b/include/osmocom/gsm/gsm_utils.h
@@ -241,3 +241,16 @@
 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); }
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 8b4b558..3862047 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -997,3 +997,11 @@
 	return gsm_7bit_encode_n(result, GSM_7BIT_LEGACY_MAX_BUFFER_SIZE,
 				 data, octets);
 }
+
+/* This is also used by osmo-hlr's db schema */
+const struct value_string osmo_rat_type_names[] = {
+	{ OSMO_RAT_UNKNOWN, "unknown" },
+	{ OSMO_RAT_GERAN_A, "GERAN-A" },
+	{ OSMO_RAT_UTRAN_IU, "UTRAN-Iu" },
+	{}
+};
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 76b3fd0..bb97878 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -553,5 +553,7 @@
 sgsap_ue_emm_mode_names;
 sgsap_ie_tlvdef;
 
+osmo_rat_type_names;
+
 local: *;
 };

-- 
To view, visit https://gerrit.osmocom.org/12451
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I659687aef7a4d67ca372a39fef31dee07aed7631
Gerrit-Change-Number: 12451
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190103/f908d902/attachment.htm>


More information about the gerrit-log mailing list