Change in libosmo-sccp[master]: sccp_scoc: move sccp_find_user() up

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Apr 11 07:30:22 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13507 )

Change subject: sccp_scoc: move sccp_find_user() up
......................................................................

sccp_scoc: move sccp_find_user() up

Move it before sccp_scoc_rx_scrc_rout_fail(), so it can be used in
the latter function to figure out the local_ref from the user (follow
up commit).

Related: OS#3871
Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855
---
M src/sccp_scoc.c
1 file changed, 25 insertions(+), 25 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c
index 726426c..82590a0 100644
--- a/src/sccp_scoc.c
+++ b/src/sccp_scoc.c
@@ -1329,6 +1329,31 @@
 	return xua;
 }
 
+/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */
+static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst,
+					     struct xua_msg *xua)
+{
+	int rc;
+	struct osmo_sccp_addr called_addr;
+
+	rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR);
+	if (rc < 0) {
+		LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA "
+			"Message %s without valid DEST_ADDR\n",
+			xua_hdr_dump(xua, &xua_dialect_sua));
+		return NULL;
+	}
+
+	if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) {
+		LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for "
+			"XUA Message %s without SSN in CalledAddr\n",
+			xua_hdr_dump(xua, &xua_dialect_sua));
+		return NULL;
+	}
+
+	return sccp_user_find(inst, called_addr.ssn, called_addr.pc);
+}
+
 /*! \brief SCOC: Receive SCRC Routing Failure
  *  \param[in] inst SCCP Instance on which we operate
  *  \param[in] xua SUA message that was failed to route
@@ -1355,31 +1380,6 @@
 	}
 }
 
-/* Find a SCCP user for given SUA message (based on SUA_IEI_DEST_ADDR */
-static struct osmo_sccp_user *sccp_find_user(struct osmo_sccp_instance *inst,
-					     struct xua_msg *xua)
-{
-	int rc;
-	struct osmo_sccp_addr called_addr;
-
-	rc = sua_addr_parse(&called_addr, xua, SUA_IEI_DEST_ADDR);
-	if (rc < 0) {
-		LOGP(DLSCCP, LOGL_ERROR, "Cannot find SCCP User for XUA "
-			"Message %s without valid DEST_ADDR\n",
-			xua_hdr_dump(xua, &xua_dialect_sua));
-		return NULL;
-	}
-
-	if (!(called_addr.presence & OSMO_SCCP_ADDR_T_SSN)) {
-		LOGP(DLSCCP, LOGL_ERROR, "Cannot resolve SCCP User for "
-			"XUA Message %s without SSN in CalledAddr\n",
-			xua_hdr_dump(xua, &xua_dialect_sua));
-		return NULL;
-	}
-
-	return sccp_user_find(inst, called_addr.ssn, called_addr.pc);
-}
-
 /* Generate a COERR based in input arguments */
 static struct xua_msg *gen_coerr(uint32_t route_ctx, uint32_t dest_ref,
 				uint32_t err_cause)

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieabeda3126dcc0349a06c0fc7c9e468b900d7855
Gerrit-Change-Number: 13507
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190411/e746bb8e/attachment.html>


More information about the gerrit-log mailing list