pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38653?usp=email )
Change subject: sigtran: Add API osmo_ss7_instance_get_primary_pc() ......................................................................
sigtran: Add API osmo_ss7_instance_get_primary_pc()
This allows getting the primary PC of an osmo_ss7_instance without having to access its structs fields directly
Change-Id: I617e58f5f3f5420accbfe8b81ee8b3eb553330bf --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 3 files changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/53/38653/1
diff --git a/TODO-RELEASE b/TODO-RELEASE index df47c0f..0275805 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() +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() diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index eaf3855..4da77e9 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -102,6 +102,8 @@ const struct osmo_ss7_pc_fmt * osmo_ss7_instance_get_pc_fmt(const struct osmo_ss7_instance *inst);
+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);
uint8_t osmo_ss7_pc_width(const struct osmo_ss7_pc_fmt *pc_fmt); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 667d1ad..e578787 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -395,6 +395,11 @@ return inst->cfg.name; }
+uint32_t osmo_ss7_instance_get_primary_pc(const struct osmo_ss7_instance *inst) +{ + return inst->cfg.primary_pc; +} + /*! \brief Set the point code format used in given SS7 instance */ int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2)