Change in libosmo-sccp[master]: add osmo_sccp_user_find() as public API

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

neels gerrit-no-reply at lists.osmocom.org
Tue May 26 23:57:52 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/18502 )


Change subject: add osmo_sccp_user_find() as public API
......................................................................

add osmo_sccp_user_find() as public API

To allow osmo-bsc to add more than one MSC peer on a single SCCP instance, it
must add a local SCCP user only once per SCCP instance. The first configured
MSC adds a local user, all subsequent MSC should use the same local SCCP user.
So, it is most convenient to provide a public function to return such user if
it exists.

Add as thin wrapper instead of renaming and moving the internal
sccp_user_find(): to keep the patch smaller, and to match the way
osmo_sccp_user_bind_pc() is a 1:1 wrapper for sccp_user_bind_pc().

Related: OS#3682
Change-Id: I9ecbab16b45268f626950303d6ff8296dd6acda0
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_user.c
2 files changed, 18 insertions(+), 0 deletions(-)



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

diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h
index 9d285eb..e012635 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -261,6 +261,8 @@
 struct osmo_sccp_user *
 osmo_sccp_user_bind(struct osmo_sccp_instance *inst, const char *name,
 		    osmo_prim_cb prim_cb, uint16_t ssn);
+struct osmo_sccp_user *
+osmo_sccp_user_find(struct osmo_sccp_instance *inst, uint16_t ssn, uint32_t pc);
 
 int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph);
 int osmo_sccp_user_sap_down_nofree(struct osmo_sccp_user *scu, struct osmo_prim_hdr *oph);
diff --git a/src/sccp_user.c b/src/sccp_user.c
index d85fc1d..a36ac93 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -39,6 +39,8 @@
 #include "xua_internal.h"
 
 /*! \brief Find a SCCP User registered for given PC+SSN or SSN only
+ * First search all users with a valid PC for a full PC+SSN match.
+ * If no such match was found, search all users with an invalid PC for an SSN-only match.
  *  \param[in] inst SCCP Instance in which to search
  *  \param[in] ssn Sub-System Number to search for
  *  \param[in] pc Point Code to search for
@@ -63,6 +65,20 @@
 	return NULL;
 }
 
+/*! Find a SCCP User registered for given PC+SSN or SSN only.
+ * First search all users with a valid PC for a full PC+SSN match.
+ * If no match was found, search all users with an invalid PC for an SSN-only match.
+ *  \param[in] inst SCCP Instance in which to search.
+ *  \param[in] ssn Sub-System Number to search for.
+ *  \param[in] pc Point Code to search for.
+ *  \returns Matching SCCP User; NULL if none found.
+ */
+struct osmo_sccp_user *
+osmo_sccp_user_find(struct osmo_sccp_instance *inst, uint16_t ssn, uint32_t pc)
+{
+	return sccp_user_find(inst, ssn, pc);
+}
+
 /*! \brief Bind a SCCP User to a given Point Code
  *  \param[in] inst SCCP Instance
  *  \param[in] name human-readable name

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9ecbab16b45268f626950303d6ff8296dd6acda0
Gerrit-Change-Number: 18502
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200526/38f596f3/attachment.htm>


More information about the gerrit-log mailing list