[PATCH] libosmocore[master]: abis_nm: Add abis_nm_admin_name() API

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Oct 19 15:25:10 UTC 2017


Review at  https://gerrit.osmocom.org/4355

abis_nm: Add abis_nm_admin_name() API

Similar APIs exist for opstate and availability status.

This patch does not break backward compatibility because osmo-bsc still
requires direct use of the structure in get_string_value().

Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6
---
M include/osmocom/gsm/abis_nm.h
M src/gsm/abis_nm.c
M src/gsm/libosmogsm.map
3 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/4355/1

diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h
index e031ee1..70d8134 100644
--- a/include/osmocom/gsm/abis_nm.h
+++ b/include/osmocom/gsm/abis_nm.h
@@ -30,6 +30,7 @@
 extern const struct tlv_definition abis_nm_att_tlvdef;
 const char *abis_nm_opstate_name(uint8_t os);
 const char *abis_nm_avail_name(uint8_t avail);
+const char *abis_nm_admin_name(uint8_t admin);
 const char *abis_nm_test_name(uint8_t test);
 extern const struct tlv_definition abis_nm_osmo_att_tlvdef;
 extern const struct tlv_definition abis_nm_att_tlvdef_ipa;
diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c
index 7207fb9..3dab705 100644
--- a/src/gsm/abis_nm.c
+++ b/src/gsm/abis_nm.c
@@ -684,6 +684,12 @@
 	{ 0, NULL }
 };
 
+/*! Get human-readable string for OML administrative state */
+const char *abis_nm_admin_name(uint8_t admin)
+{
+	return get_value_string(abis_nm_adm_state_names, admin);
+}
+
 static const enum abis_nm_chan_comb chcomb4pchan[] = {
 	[GSM_PCHAN_NONE]	= 0xff,
 	[GSM_PCHAN_CCCH]	= NM_CHANC_mainBCCH,
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index a72db52..c7369d8 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -1,6 +1,7 @@
 LIBOSMOGSM_1.0 {
 global:
 
+abis_nm_admin_name;
 abis_nm_adm_state_names;
 abis_nm_att_settable;
 abis_nm_avail_name;

-- 
To view, visit https://gerrit.osmocom.org/4355
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list