pespin has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/48/38648/1
diff --git a/TODO-RELEASE b/TODO-RELEASE index 06ae923..4122d15 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() \ No newline at end of file diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 67f4e99..d9d62a8 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -93,6 +93,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 40bf0b1..ff771cb 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -385,6 +385,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)