pespin has submitted this change. ( 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(-)
Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved
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 631ba8f..cd0ddfc 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -98,6 +98,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(const 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 964d280..1876b82 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -442,6 +442,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(const struct osmo_ss7_instance *inst) +{ + return inst->sccp; +} + /*********************************************************************** * MTP Users (Users of MTP, such as SCCP or ISUP) ***********************************************************************/