pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc/+/38722?usp=email )
Change subject: Use new libosmo-sigtran API osmo_ss7_as_select_asp()
......................................................................
Use new libosmo-sigtran API osmo_ss7_as_select_asp()
Depends: libosmo-sigtran.git Change-Id b9f6b542bbae925e23ca7c4de27cdff59021ccb9
Change-Id: I0f2e3d6cbdf443c0194b61df7479aecf4073e19c
---
M src/osmo-bsc/bsc_ctrl.c
1 file changed, 8 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/22/38722/1
diff --git a/src/osmo-bsc/bsc_ctrl.c b/src/osmo-bsc/bsc_ctrl.c
index ff917ce..931a8ae 100644
--- a/src/osmo-bsc/bsc_ctrl.c
+++ b/src/osmo-bsc/bsc_ctrl.c
@@ -643,26 +643,10 @@
return as;
}
-static int _ss7_as_send(struct osmo_ss7_as *as, struct msgb *msg)
-{
- struct osmo_ss7_asp *asp;
- unsigned int i;
-
- /* FIXME: unify with xua_as_transmit_msg() and perform proper ASP lookup */
- for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
- asp = as->cfg.asps[i];
- if (!asp)
- continue;
- /* FIXME: deal with multiple ASPs per AS */
- return osmo_ss7_asp_send(asp, msg);
- }
- msgb_free(msg);
- return -1;
-}
-
int bsc_sccplite_msc_send(struct bsc_msc_data *msc, struct msgb *msg)
{
struct osmo_ss7_as *as;
+ struct osmo_ss7_asp *asp;
as = msc_get_ss7_as(msc);
if (!as) {
@@ -676,7 +660,13 @@
return 0;
}
- return _ss7_as_send(as, msg);
+ asp = osmo_ss7_as_select_asp(as);
+ if (!asp) {
+ LOGP(DCTRL, LOGL_NOTICE, "No ASP found for AS, dropping message\n");
+ msgb_free(msg);
+ return -1;
+ }
+ return osmo_ss7_asp_send(asp, msg);
}
/* Encode a CTRL command and send it to the given ASP
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/38722?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I0f2e3d6cbdf443c0194b61df7479aecf4073e19c
Gerrit-Change-Number: 38722
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>