Change in libosmo-sccp[master]: osmo_ss7: Add osmo_ss7_asp_find()

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

laforge gerrit-no-reply at lists.osmocom.org
Tue Nov 19 00:28:33 UTC 2019


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


Change subject: osmo_ss7: Add osmo_ss7_asp_find()
......................................................................

osmo_ss7: Add osmo_ss7_asp_find()

This is like osmo_ss7_asp_find_and_create(), i.e. it's doing a full
match for an ASP within the specified SS7 instance, of the specified
port numbers.  It just doesn't create it if it is missing.

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



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

diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 6778409..de9494b 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -436,6 +436,10 @@
 *osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as,
 			    enum osmo_ss7_asp_protocol proto);
 struct osmo_ss7_asp *
+osmo_ss7_asp_find(struct osmo_ss7_instance *inst, const char *name,
+		  uint16_t remote_port, uint16_t local_port,
+		  enum osmo_ss7_asp_protocol proto);
+struct osmo_ss7_asp *
 osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
 			    uint16_t remote_port, uint16_t local_port,
 			    enum osmo_ss7_asp_protocol proto);
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index d74f8f9..a07fbed 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1226,6 +1226,24 @@
 }
 
 struct osmo_ss7_asp *
+osmo_ss7_asp_find(struct osmo_ss7_instance *inst, const char *name,
+		  uint16_t remote_port, uint16_t local_port,
+		  enum osmo_ss7_asp_protocol proto)
+{
+	struct osmo_ss7_asp *asp;
+
+	OSMO_ASSERT(ss7_initialized);
+	asp = osmo_ss7_asp_find_by_name(inst, name);
+	if (!asp)
+		return NULL;
+
+	if ((asp->cfg.remote.port != remote_port || asp->cfg.local.port != local_port || asp->cfg.proto != proto))
+		return NULL;
+
+	return asp;
+}
+
+struct osmo_ss7_asp *
 osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
 			    uint16_t remote_port, uint16_t local_port,
 			    enum osmo_ss7_asp_protocol proto)

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I1ed3cf2b69ee622d6f9d8b50487f392fe913ae90
Gerrit-Change-Number: 16099
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191119/97625af1/attachment.htm>


More information about the gerrit-log mailing list