pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38660?usp=email )

 (

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: sigtran: Add API osmo_ss7_instances_llist_entry
......................................................................

sigtran: Add API osmo_ss7_instances_llist_entry

This API allows iterating over the public global list of ss7 instances,
without knowing the structure internal layout.

Change-Id: I148438aecd64bdd66848d4b3404d379a380c5e9c
---
M TODO-RELEASE
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
3 files changed, 16 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/TODO-RELEASE b/TODO-RELEASE
index 366c680..f56b4e5 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -12,3 +12,4 @@
 libosmo-sigtran add API osmo_ss7_route_get_dest_as()
 libosmo-sigtran Make private  osmo_ss7_route
 libosmo-sigtran add API osmo_ss7_instance_get_id(), 
osmo_ss7_instance_get_name(), osmo_ss7_instance_get_pc_fmt(), 
osmo_ss7_instance_get_primary_pc(), osmo_ss7_get_sccp()
+libosmo-sigtran add API osmo_ss7_instances_llist_entry()
diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index cd0ddfc..8f33115 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -11,9 +11,12 @@
 #include <osmocom/core/socket.h>
 #include <osmocom/core/rate_ctr.h>

-extern struct llist_head osmo_ss7_instances;
-
 struct osmo_ss7_instance;
+
+extern struct llist_head osmo_ss7_instances;
+/* Get an entry pointer from a list item in osmo_ss7_instances: */
+struct osmo_ss7_instance *osmo_ss7_instances_llist_entry(struct llist_head 
*list);
+
 struct osmo_ss7_user;
 struct osmo_sccp_instance;
 struct osmo_mtp_prim;
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 1876b82..e89f7bd 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -62,6 +62,16 @@
 bool ss7_initialized = false;

 LLIST_HEAD(osmo_ss7_instances);
+/* This API allows iterating over the public global list of ss7 instances,
+ * without knowing the structure internal layout.
+ */
+struct osmo_ss7_instance *osmo_ss7_instances_llist_entry(struct llist_head 
*list)
+{
+       struct osmo_ss7_instance *pos;
+       pos = llist_entry(list, struct osmo_ss7_instance, list);
+       return pos;
+}
+
 static int32_t next_rctx = 1;
 static int32_t next_l_rk_id = 1;


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38660?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I148438aecd64bdd66848d4b3404d379a380c5e9c
Gerrit-Change-Number: 38660
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to