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/.
Harald Welte gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/7463 RSL_Emulation: Introduce LastActTable The LastActTable stores a copy of the decoded RSL CHAN_ACT for each channel number. This can be used by a RSL_DchanHandler to learn parameters of its own activation. Change-Id: I629d66e27cbe4c8b02e704a7181b3bff843e9aa4 --- M library/RSL_Emulation.ttcn 1 file changed, 65 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/63/7463/1 diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 635ee42..55f8942 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -10,7 +10,13 @@ * Outbound RSL connections are initiated by sending a RSLDC_ChanRqd primitive * to the component running the RSL_Emulation.main() function. * - * (C) 2017 by Harald Welte <laforge at gnumonks.org> + * in case we're emulating the BTS-side of RSL: We have no clue as to which particular logical + * channel the BSC may decide to activate at which point, so we have to blindly acknowledge all + * channel activations. Still, a test case might be interested in the exact assignment message to + * determine the type of activation, encryption, codec flags etc. at some later point, when it's + * clear for which transaction this activation happened. We keep this in the LastChanAct table. + * + * (C) 2017-2018 by Harald Welte <laforge at gnumonks.org> * All rights reserved. * * Released under the terms of GNU General Public License, Version 2 or @@ -60,9 +66,10 @@ signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); signature RSLEM_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); signature RSLEM_suspend(boolean suspend); +signature RSLEM_get_last_act(in RslChannelNr chan_nr, out RSL_Message chan_act); type port RSLEM_PROC_PT procedure { - inout RSLEM_register, RSLEM_unregister, RSLEM_suspend; + inout RSLEM_register, RSLEM_unregister, RSLEM_suspend, RSLEM_get_last_act; } with { extension "internal" }; /*********************************************************************** @@ -240,6 +247,42 @@ ConnectionTable[cid].comp_ref := null; } +/* last activation for a given channel number */ +type record LastActData { + RslChannelNr chan_nr optional, + RSL_Message chan_act optional +} + +private function f_store_last_act_data(RslChannelNr chan_nr, RSL_Message chan_act) +runs on RSL_Emulation_CT { + for (var integer i := 0; i < sizeof(LastActTable); i := i+1) { + if (not ispresent(LastActTable[i].chan_nr) or LastActTable[i].chan_nr == chan_nr) { + LastActTable[i].chan_nr := chan_nr; + LastActTable[i].chan_act := chan_act; + return; + } + } + setverdict(fail, "No space left in LastActTable to store chan_act for ", chan_nr); + self.stop; +} + +private function f_lookup_last_act(RslChannelNr chan_nr) +runs on RSL_Emulation_CT return RSL_Message { + for (var integer i := 0; i < sizeof(LastActTable); i := i+1) { + if (ispresent(LastActTable[i].chan_nr) and LastActTable[i].chan_nr == chan_nr) { + return LastActTable[i].chan_act; + } + } + setverdict(fail, "No LastActTable entry found for ", chan_nr); + self.stop; +} + +private function f_last_act_table_init() runs on RSL_Emulation_CT { + for (var integer i := 0; i < sizeof(LastActTable); i := i+1) { + LastActTable[i] := { omit, omit }; + } +} + type component RSL_Emulation_CT { /* port facing down towards IPA emulation */ port IPA_RSL_PT IPA_PT; @@ -252,6 +295,9 @@ /* state of all concurrent connections / dedicated channels */ var ConnectionData ConnectionTable[64]; + + /* last RSL CHAN ACT for each chan_nr */ + var LastActData LastActTable[64]; } @@ -290,6 +336,7 @@ var boolean dchan_suspended := false; f_conn_table_init(); + f_last_act_table_init(); while (true) { alt { @@ -364,6 +411,7 @@ /* blindly acknowledge all channel activations */ [bts_role] IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) -> value rx_rsl { chan_nr := rx_rsl.rsl.ies[0].body.chan_nr; + f_store_last_act_data(chan_nr, rx_rsl.rsl); IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.streamId, ts_RSL_CHAN_ACT_ACK(chan_nr, 23))); } @@ -424,6 +472,10 @@ RSL_PROC.reply(RSLEM_suspend:{false}); } + [] RSL_PROC.getcall(RSLEM_get_last_act:{?,?}) -> param(chan_nr) { + var RSL_Message last_chan_act := f_lookup_last_act(chan_nr); + RSL_PROC.reply(RSLEM_get_last_act:{chan_nr, last_chan_act}); + } } } } @@ -470,6 +522,17 @@ } } +/* obtain the last RSL_CHAN_ACT message for the given chan_nr */ +function f_rslem_get_last_act(RSLEM_PROC_PT PT, RslChannelNr chan_nr) +runs on RSL_DchanHdlr return RSL_Message { + var RSL_Message chan_act; + PT.call(RSLEM_get_last_act:{chan_nr, -}) { + [] PT.getreply(RSLEM_get_last_act:{chan_nr, ?}) -> param(chan_act) {}; + } + return chan_act; +} + + } -- To view, visit https://gerrit.osmocom.org/7463 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I629d66e27cbe4c8b02e704a7181b3bff843e9aa4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte <laforge at gnumonks.org>