pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38717?usp=email )
Change subject: sigtran: Add API osmo_ss7_as_get_asp_protocol() ......................................................................
sigtran: Add API osmo_ss7_as_get_asp_protocol()
This is currently needed for osmo-bsc, otherwise it's accessing the struct field of osmo_ss7-as directly.
Change-Id: I6171287c9bc76db6561f8ff92c4aebe453efaa7d --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_as.c 2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/17/38717/1
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index d4fb87b..83956d8 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -268,6 +268,7 @@ struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto); +enum osmo_ss7_asp_protocol osmo_ss7_as_get_asp_protocol(const struct osmo_ss7_as *as); int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name); int osmo_ss7_as_del_asp(struct osmo_ss7_as *as, const char *asp_name); void osmo_ss7_as_destroy(struct osmo_ss7_as *as); diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c index cc61b12..5af7098 100644 --- a/src/osmo_ss7_as.c +++ b/src/osmo_ss7_as.c @@ -95,6 +95,14 @@ return as; }
+/*! \brief Get asp_protocol configuration of a given AS + * \param[in] as Application Server in which to look for \ref asp_protocol + * \returns The asp_protocol this AS is configured with */ +enum osmo_ss7_asp_protocol osmo_ss7_as_get_asp_protocol(const struct osmo_ss7_as *as) +{ + return as->cfg.proto; +} + /*! \brief Add given ASP to given AS * \param[in] as Application Server to which \ref asp is added * \param[in] asp Application Server Process to be added to \ref as