Change in osmo-bsc[master]: Introduce nm_fail_rep_signal_data for "SS_NM, S_NM_FAIL_REP" signal

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
Mon Jan 6 10:28:18 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/14176 )

Change subject: Introduce nm_fail_rep_signal_data for "SS_NM, S_NM_FAIL_REP" signal
......................................................................

Introduce nm_fail_rep_signal_data for "SS_NM, S_NM_FAIL_REP" signal

Let's not just pass around the raw msgb, but also all other metadata,
such as the decoded parts of the TS 12.21 message.

As there's no current consumer of that signal, this creates no
compatibility issues.

Change-Id: I5d4d9d422b4e23348ffbe69c6e87a31d5574f90d
---
M include/osmocom/bsc/signal.h
M src/osmo-bsc/abis_nm.c
2 files changed, 33 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index 62a3d2c..10200d7 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -149,6 +149,20 @@
 	uint8_t mt;
 };
 
+struct nm_fail_rep_signal_data {
+	struct gsm_bts *bts;
+	/* raw data */
+	struct msgb *msg;
+	struct tlv_parsed *tp;
+	/* parsed data */
+	struct {
+		const char *event_type;
+		const char *severity;
+		const char *additional_text;
+		const uint8_t *probable_cause;
+	} parsed;
+};
+
 struct challoc_signal_data {
 	struct gsm_bts *bts;
 	struct gsm_lchan *lchan;
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index 7ca4e79..a874b53 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -358,6 +358,7 @@
 	struct abis_om_hdr *oh = msgb_l2(mb);
 	struct abis_om_fom_hdr *foh = msgb_l3(mb);
 	struct e1inp_sign_link *sign_link = mb->dst;
+	struct nm_fail_rep_signal_data sd;
 	struct tlv_parsed tp;
 	int rc = 0;
 	const uint8_t *p_val = NULL;
@@ -398,6 +399,24 @@
 		rc = -EINVAL;
 	}
 
+	sd.bts = mb->trx->bts;
+	sd.msg = mb;
+	sd.tp = &tp;
+	if (e_type)
+		sd.parsed.event_type = e_type;
+	else
+		sd.parsed.event_type = "<none>";
+	if (severity)
+		sd.parsed.severity = severity;
+	else
+		sd.parsed.severity = "<none>";
+	if (p_text)
+		sd.parsed.additional_text = p_text;
+	else
+		sd.parsed.additional_text = "<none>";
+	sd.parsed.probable_cause = p_val;
+	osmo_signal_dispatch(SS_NM, S_NM_FAIL_REP, &sd);
+
 	if (p_text)
 		talloc_free(p_text);
 
@@ -419,7 +438,6 @@
 		break;
 	case NM_MT_FAILURE_EVENT_REP:
 		rx_fail_evt_rep(mb, bts);
-		osmo_signal_dispatch(SS_NM, S_NM_FAIL_REP, mb);
 		break;
 	case NM_MT_TEST_REP:
 		DEBUGPFOH(DNM, foh, "Test Report\n");

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5d4d9d422b4e23348ffbe69c6e87a31d5574f90d
Gerrit-Change-Number: 14176
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200106/a34a7b9f/attachment.htm>


More information about the gerrit-log mailing list