pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/38654?usp=email )
Change subject: Use new libosmo-sigtran APIs to access osmo_ss7_instance ......................................................................
Use new libosmo-sigtran APIs to access osmo_ss7_instance
Depends: libsomo-sigtran.git Change-Id I617e58f5f3f5420accbfe8b81ee8b3eb553330bf Change-Id: I4c4f833cfcc4e65ee5372e7736dbef9c65c2f3de --- M TODO-RELEASE M src/libmsc/transaction.c M src/osmo-msc/msc_main.c 3 files changed, 13 insertions(+), 6 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE index 0ed7189..35467f3 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libosmo-sigtran >2.0.1 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/src/libmsc/transaction.c b/src/libmsc/transaction.c index b7c7beb..19ffcb9 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -124,7 +124,8 @@
struct osmo_ss7_instance *ss7 = osmo_sccp_get_ss7(trans->net->a.sri->sccp); struct osmo_lcls *lcls; - uint8_t w = osmo_ss7_pc_width(&ss7->cfg.pc_fmt); + const struct osmo_ss7_pc_fmt *pc_fmt = osmo_ss7_instance_get_pc_fmt(ss7); + uint8_t w = osmo_ss7_pc_width(pc_fmt);
if (!trans->net->lcls_permitted) { LOGP(DCC, LOGL_NOTICE, "LCLS disabled globally\n"); @@ -150,7 +151,7 @@ LOGP(DCC, LOGL_INFO, "LCLS: using %u bits (%u bytes) for node ID\n", w, w / 8);
lcls->gcr.net_len = 3; - lcls->gcr.node = ss7->cfg.primary_pc; + lcls->gcr.node = osmo_ss7_instance_get_primary_pc(ss7);
/* net id from Q.1902.3 3-5 bytes, this function gives 3 bytes exactly */ osmo_plmn_to_bcd(lcls->gcr.net, &trans->msc_a->via_cell.lai.plmn); diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index a4b2ded..5e99b4d 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -625,6 +625,7 @@
struct osmo_sccp_instance *sccp_a; struct osmo_sccp_instance *sccp_iu; + const struct osmo_ss7_instance *ss7;
/* Track the use of talloc NULL memory contexts */ talloc_enable_null_tracking(); @@ -803,10 +804,13 @@ ret = 10; goto error; } + + ss7 = osmo_sccp_get_ss7(msc_network->a.sri->sccp); + OSMO_ASSERT(ss7); LOGP(DMSC, LOGL_NOTICE, "A-interface: SCCP user %s, cs7-instance %u (%s)\n", osmo_sccp_user_name(msc_network->a.sri->scu), - osmo_sccp_get_ss7(msc_network->a.sri->sccp)->cfg.id, - osmo_sccp_get_ss7(msc_network->a.sri->sccp)->cfg.name); + osmo_ss7_instance_get_id(ss7), + osmo_ss7_instance_get_name(ss7));
#ifdef BUILD_IU talloc_asn1_ctx = talloc_named_const(tall_msc_ctx, 0, "asn1"); @@ -823,10 +827,11 @@ /* Compatibility with legacy osmo-hnbgw that was unable to properly handle RESET messages. */ msc_network->iu.sri->ignore_missing_reset = true;
+ ss7 = osmo_sccp_get_ss7(msc_network->iu.sri->sccp); LOGP(DMSC, LOGL_NOTICE, "Iu-interface: SCCP user %s, cs7-instance %u (%s)\n", osmo_sccp_user_name(msc_network->iu.sri->scu), - osmo_sccp_get_ss7(msc_network->iu.sri->sccp)->cfg.id, - osmo_sccp_get_ss7(msc_network->iu.sri->sccp)->cfg.name); + osmo_ss7_instance_get_id(ss7), + osmo_ss7_instance_get_name(ss7)); #endif
/* Init RRLP handlers */