[PATCH] libosmo-sccp[master]: sccp: function to get sccp instance from sccp user

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

dexter gerrit-no-reply at lists.osmocom.org
Fri Aug 11 15:51:52 UTC 2017


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

sccp: function to get sccp instance from sccp user

It is currently impossible to find out which SCCP instance handles
a particular user.

Introduce function to lookup the SCCP instance from a given SCCP
user.

Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_user.c
2 files changed, 11 insertions(+), 0 deletions(-)


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

diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h
index 796597f..bf1b368 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -247,6 +247,7 @@
 osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv);
 void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst);
 struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp);
+struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu);
 
 void osmo_sccp_user_unbind(struct osmo_sccp_user *scu);
 void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv);
diff --git a/src/sccp_user.c b/src/sccp_user.c
index c0e2b5a..a4568cf 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -602,3 +602,13 @@
 {
 	return sccp->ss7;
 }
+
+/*! \brief get the SCCP instance that is related to the given sccp user
+ *  \param[in] scu SCCP user
+ *  \returns SCCP instance; NULL if scu was NULL */
+struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu)
+{
+	if (!scu)
+		return NULL;
+	return scu->inst;
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list