[PATCH] libosmo-sccp[master]: xua: report N-ERROR and N-NOTIFY primitives to layer manager

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Apr 9 16:57:02 UTC 2017


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

xua: report N-ERROR and N-NOTIFY primitives to layer manager

Change-Id: I5c2060f0397d2bf510b085a5bb07e7ab176f2742
---
M src/m3ua.c
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/62/2262/1

diff --git a/src/m3ua.c b/src/m3ua.c
index 96991a7..25fb3aa 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -526,10 +526,16 @@
 static int m3ua_rx_mgmt_err(struct osmo_ss7_asp *asp, struct xua_msg *xua)
 {
 	uint32_t err_code = xua_msg_get_u32(xua, M3UA_IEI_ERR_CODE);
+	struct osmo_xlm_prim *prim;
 
 	LOGPASP(asp, DLM3UA, LOGL_ERROR, "Received MGMT_ERR '%s': %s\n",
 		get_value_string(m3ua_err_names, err_code),
 		xua_msg_dump(xua, &xua_dialect_m3ua));
+
+	/* report this to layer manager */
+	prim = xua_xlm_prim_alloc(OSMO_XLM_PRIM_M_ERROR, PRIM_OP_INDICATION);
+	prim->u.error.code = err_code;
+	xua_asp_send_xlm_prim(asp, prim);
 
 	/* NEVER return != 0 here, as we cannot respont to an ERR
 	 * message with another ERR! */
@@ -540,6 +546,7 @@
 {
 	struct osmo_xlm_prim_notify ntfy;
 	const char *type_name, *info_name;
+	struct osmo_xlm_prim *prim;
 
 	m3ua_decode_notify(&ntfy, asp, xua);
 
@@ -562,10 +569,14 @@
 		type_name, info_name,
 		ntfy.info_string ? ntfy.info_string : "");
 
+	/* report this to layer manager */
+	prim = xua_xlm_prim_alloc(OSMO_XLM_PRIM_M_NOTIFY, PRIM_OP_INDICATION);
+	prim->u.notify = ntfy;
+	xua_asp_send_xlm_prim(asp,prim);
+
 	if (ntfy.info_string)
 		talloc_free(ntfy.info_string);
 
-	/* TODO: should we report this soemwhere? */
 	return 0;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c2060f0397d2bf510b085a5bb07e7ab176f2742
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list