pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38648?usp=email )
Change subject: sigtran: Add API osmo_ss7_instance_get_id() ......................................................................
sigtran: Add API osmo_ss7_instance_get_id()
This allows getting the ID of an osmo_ss7_instance without having to access its structs fields directly.
Change-Id: Id7b6f23a1a223fb232238b624eb4f3295790bcb1 --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 3 files changed, 9 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE index 06ae923..5ede826 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +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() diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 898c903..896a677 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -86,6 +86,9 @@ struct osmo_ss7_instance * osmo_ss7_instance_find_or_create(void *ctx, uint32_t id); void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst); + +uint32_t osmo_ss7_instance_get_id(const struct osmo_ss7_instance *inst); + int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2);
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index c1de76a..3393369 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -391,6 +391,11 @@ talloc_free(inst); }
+uint32_t osmo_ss7_instance_get_id(const struct osmo_ss7_instance *inst) +{ + return inst->cfg.id; +} + /*! \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)