pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38656?usp=email )
Change subject: sigtran: Add API osmo_ss7_get_sccp()
......................................................................
sigtran: Add API osmo_ss7_get_sccp()
This allows getting the SCCP instance of an osmo_ss7_instance without having to
access its structs fields directly
Change-Id: I8f09aff41666822f759f99fa91c13e3b9d89d530
---
M TODO-RELEASE
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
3 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/56/38656/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0275805..366c680 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -11,4 +11,4 @@
libosmo-sigtran add API osmo_sccp_{release,return,reset,error,refusal}_cause_name(s),
osmo_sua_sccp_cause_name
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()
+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()
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 4da77e9..8f22b8a 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -105,6 +105,7 @@
uint32_t osmo_ss7_instance_get_primary_pc(const struct osmo_ss7_instance *inst);
struct osmo_sccp_instance *osmo_ss7_ensure_sccp(struct osmo_ss7_instance *inst);
+struct osmo_sccp_instance *osmo_ss7_get_sccp(struct osmo_ss7_instance *inst);
uint8_t osmo_ss7_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt);
uint32_t osmo_ss7_pc_normalize(const struct osmo_ss7_pc_fmt *pc_fmt, uint32_t pc);
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index e578787..fb9c0fe 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -436,6 +436,15 @@
return inst->sccp;
}
+/*! Get the SCCP instance, if present.
+ * \param[in] inst SS7 Instance on which we operate
+ * \returns inst->sccp, may be NULL if no SCCP instance was created yet (see
osmo_ss7_ensure_sccp()).
+ */
+struct osmo_sccp_instance *osmo_ss7_get_sccp(struct osmo_ss7_instance *inst)
+{
+ return inst->sccp;
+}
+
/***********************************************************************
* SS7 Application Server
***********************************************************************/
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/38656?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I8f09aff41666822f759f99fa91c13e3b9d89d530
Gerrit-Change-Number: 38656
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>