Change in libosmo-sccp[master]: add osmo_ss7_asp_get_as()

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
Thu Jun 25 17:55:09 UTC 2020


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


Change subject: add osmo_ss7_asp_get_as()
......................................................................

add osmo_ss7_asp_get_as()

For 'cs7' auto configuration, we want to pick up an ASP that is not yet
associated with any AS. For that we need to find out whether a given ASP is set
up with an AS yet.

Related: OS#4635
Change-Id: Ia028625c5e8fab4f2683d05f78a9a1c0092a2cac
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
2 files changed, 16 insertions(+), 0 deletions(-)



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

diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 06cc43c..b7c59c3 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -454,6 +454,7 @@
 int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp);
 int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level);
 bool osmo_ss7_asp_active(const struct osmo_ss7_asp *asp);
+struct osmo_ss7_as *osmo_ss7_asp_get_as(struct osmo_ss7_asp *asp);
 
 /*! Weak function to handle payload for unknown/unsupported PPID or IPA StreamID.
  *  This function can be overridden by application code to implement whatever handling
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index ad6f171..8e1fece 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1469,6 +1469,21 @@
 	return asp->fi->state == XUA_ASP_S_ACTIVE;
 }
 
+/* Get the AS that the given ASP is added on, if any.
+ * \param[in] asp  ASP to get the AS for.
+ * \return AS instance, or NULL if the ASP is not added on any AS.
+ */
+struct osmo_ss7_as *osmo_ss7_asp_get_as(struct osmo_ss7_asp *asp)
+{
+	struct osmo_ss7_as *as;
+	OSMO_ASSERT(ss7_initialized);
+	llist_for_each_entry(as, &asp->inst->as_list, list) {
+		if (osmo_ss7_as_has_asp(as, asp))
+			return as;
+	}
+	return NULL;
+}
+
 /***********************************************************************
  * libosmo-netif integration for SCTP stream server/client
  ***********************************************************************/

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ia028625c5e8fab4f2683d05f78a9a1c0092a2cac
Gerrit-Change-Number: 19013
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/20200625/756c32d5/attachment.htm>


More information about the gerrit-log mailing list