Change in libosmocore[master]: gprs_bssgp_rim: add value strings for enum bssgp_nacc_cause

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

laforge gerrit-no-reply at lists.osmocom.org
Fri Jan 22 19:59:31 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22380 )

Change subject: gprs_bssgp_rim: add value strings for enum bssgp_nacc_cause
......................................................................

gprs_bssgp_rim: add value strings for enum bssgp_nacc_cause

Change-Id: I3354699555569c2b0bd1b4313cffd32a0cbeffe9
Related: SYS#5103
---
M include/osmocom/gprs/gprs_bssgp_rim.h
M src/gb/gprs_bssgp_rim.c
M src/gb/libosmogb.map
3 files changed, 18 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/include/osmocom/gprs/gprs_bssgp_rim.h b/include/osmocom/gprs/gprs_bssgp_rim.h
index 7e9efcd..5e5966e 100644
--- a/include/osmocom/gprs/gprs_bssgp_rim.h
+++ b/include/osmocom/gprs/gprs_bssgp_rim.h
@@ -96,6 +96,12 @@
 	BSSGP_NACC_CAUSE_SIPSI_SET_ERR,
 };
 
+extern const struct value_string bssgp_nacc_cause_strs[];
+
+/*! Obtain a human-readable string for NACC Cause code */
+static inline const char *bssgp_nacc_cause_str(enum bssgp_nacc_cause val)
+{ return get_value_string(bssgp_nacc_cause_strs, val); }
+
 /* 3GPP TS 48.018, table 11.3.64.1.a, Application Error Container coding for NACC */
 struct bssgp_app_err_cont_nacc {
 	enum bssgp_nacc_cause nacc_cause;
diff --git a/src/gb/gprs_bssgp_rim.c b/src/gb/gprs_bssgp_rim.c
index 23fb3a0..67e0116 100644
--- a/src/gb/gprs_bssgp_rim.c
+++ b/src/gb/gprs_bssgp_rim.c
@@ -270,6 +270,17 @@
 	return (int)(buf_ptr - buf);
 }
 
+/* 3GPP TS 48.018, table 11.3.64.1.b, NACC Cause coding */
+const struct value_string bssgp_nacc_cause_strs[] = {
+	{ BSSGP_NACC_CAUSE_UNSPEC,		"unspecified error" },
+	{ BSSGP_NACC_CAUSE_SYNTAX_ERR,		"syntax error in app container" },
+	{ BSSGP_NACC_CAUSE_RPRT_CELL_MISSMTCH,  "reporting cell id mismatch" },
+	{ BSSGP_NACC_CAUSE_SIPSI_TYPE_ERR,	"SI/PSI type error" },
+	{ BSSGP_NACC_CAUSE_SIPSI_LEN_ERR,	"SI/PSI inconsistent length" },
+	{ BSSGP_NACC_CAUSE_SIPSI_SET_ERR,	"inconsistent set of msg" },
+	{ 0, NULL }
+};
+
 /*! Decode a Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).
  *  \param[out] user provided memory for decoded data struct.
  *  \param[in] buf user provided memory with the encoded value data of the IE.
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index 763ddc6..dc9df3a 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -29,6 +29,7 @@
 bssgp_msgb_copy;
 bssgp_msgb_tlli_put;
 bssgp_msgb_ra_put;
+bssgp_nacc_cause_strs;
 bssgp_parse_cell_id;
 bssgp_parse_rim_pdu;
 bssgp_parse_rim_ri;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3354699555569c2b0bd1b4313cffd32a0cbeffe9
Gerrit-Change-Number: 22380
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210122/43d6ebcf/attachment.htm>


More information about the gerrit-log mailing list