pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38651?usp=email )
Change subject: sigtran: Add API osmo_ss7_instance_get_name() ......................................................................
sigtran: Add API osmo_ss7_instance_get_name()
This allows getting the name of an osmo_ss7_instance without having to access its structs fields directly.
Change-Id: I521b0b140c600dbd8d32721329ea02668ceac576 --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c 3 files changed, 7 insertions(+), 1 deletion(-)
Approvals: fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved Jenkins Builder: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE index 5ede826..e732e2e 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() +libosmo-sigtran add API osmo_ss7_instance_get_id(), osmo_ss7_instance_get_name() diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 896a677..2eb4ede 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -88,6 +88,7 @@ void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst);
uint32_t osmo_ss7_instance_get_id(const struct osmo_ss7_instance *inst); +const char *osmo_ss7_instance_get_name(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 3393369..758f293 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -396,6 +396,11 @@ return inst->cfg.id; }
+const char *osmo_ss7_instance_get_name(const struct osmo_ss7_instance *inst) +{ + return inst->cfg.name; +} + /*! \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)