This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/16389 ) Change subject: xua_asp_fsm: Ensure xUA client includes traffic-mode if configured ...................................................................... xua_asp_fsm: Ensure xUA client includes traffic-mode if configured When a client (ASP) sends an ASPAC to the server (SG), it should include the traffic-mode configured for it's ASs, if any. Change-Id: Ia850df22df529dab74959e8666f85976002c482c Related: OS#4285 --- M src/xua_asp_fsm.c 1 file changed, 31 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index e09c46c..ff81edd 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -141,6 +141,33 @@ xua_asp_send_xlm_prim_simple(asp, prim_type, op); } +/* determine the osmo_ss7_as_traffic_mode to be used by this ASP; will + * iterate over all AS configured for this ASP. If they're compatible, + * a single traffic mode is returned as enum osmo_ss7_as_traffic_mode. + * If they're incompatible, -EINVAL is returned. If there is none + * configured, -1 is returned */ +static int determine_traf_mode(struct osmo_ss7_asp *asp) +{ + struct osmo_ss7_as *as; + int tmode = -1; + + llist_for_each_entry(as, &asp->inst->as_list, list) { + if (!osmo_ss7_as_has_asp(as, asp)) + continue; + /* we only care about traffic modes explicitly set */ + if (!as->cfg.mode_set_by_vty) + continue; + if (tmode == -1) { + /* this is the first AS; we use this traffic mode */ + tmode = as->cfg.mode; + } else { + if (tmode != as->cfg.mode) + return -EINVAL; + } + } + return tmode; +} + /* ask the xUA implementation to transmit a specific message */ static int peer_send(struct osmo_fsm_inst *fi, int out_event, struct xua_msg *in) { @@ -148,6 +175,7 @@ struct osmo_ss7_asp *asp = xafp->asp; struct xua_msg *xua = xua_msg_alloc(); struct msgb *msg; + int rc; switch (out_event) { case XUA_ASP_E_ASPSM_ASPUP: @@ -188,6 +216,9 @@ /* RFC3868 Ch. 3.6.1 */ xua->hdr = XUA_HDR(SUA_MSGC_ASPTM, SUA_ASPTM_ACTIVE); /* Optional: Traffic Mode Type */ + rc = determine_traf_mode(asp); + if (rc >= 0) + xua_msg_add_u32(xua, M3UA_IEI_TRAF_MODE_TYP, osmo_ss7_tmode_to_xua(rc)); /* Optional: Routing Context */ /* Optional: TID Label */ /* Optional: DRN Label */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/16389 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: Ia850df22df529dab74959e8666f85976002c482c Gerrit-Change-Number: 16389 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge at osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191202/bccad72a/attachment.htm>