<p>Neels Hofmeyr <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/12717">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">add osmo_tdef API, moved from osmo-bsc T_def<br><br>Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more<br>consistent. Upgrade to first class API: add mising API doc, add both a C test<br>and a VTY transcript test.<br><br>From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API.<br><br>The root reason for moving to libosmocore is that I want to use the<br>mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the<br>FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the<br>mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API<br>in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible<br>place for this.<br><br>osmo_tdef provides:<br><br>- a list of Tnnnn (GSM) timers with description, unit and default value.<br>- vty UI to allow users to configure non-default timeouts.<br>- API to tie T timers to osmo_fsm states and set them on state transitions.<br><br>- a few standard units (minute, second, millisecond) as well as a custom unit<br>  (which relies on the timer's human readable description to indicate the<br>  meaning of the value).<br>- conversion for standard units: for example, some GSM timers are defined in<br>  minutes, while our FSM definitions need timeouts in seconds. Conversion is<br>  for convenience only and can be easily avoided via the custom unit.<br><br>T_def was introduced during the recent osmo-bsc refactoring for inter-BSC<br>handover, and has proven useful:<br><br>- without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be<br>  programmed with the right timeout value, for all code paths that invoke this<br>  state change. It is a likely source of errors to get one of them wrong.  By<br>  defining a T timer exactly for an FSM state, the caller can merely invoke the<br>  state change and trust on the original state definition to apply the correct<br>  timeout.<br><br>- it is helpful to have a standardized config file UI to provide user<br>  configurable timeouts, instead of inventing new VTY commands for each<br>  separate application of T timer numbers.<br><br>Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5<br>---<br>M include/Makefile.am<br>A include/osmocom/core/tdef.h<br>A include/osmocom/vty/tdef.h<br>M src/Makefile.am<br>M src/fsm.c<br>A src/tdef.c<br>M src/vty/Makefile.am<br>A src/vty/tdef_vty.c<br>M tests/Makefile.am<br>A tests/tdef/tdef_test.c<br>A tests/tdef/tdef_test.ok<br>A tests/tdef/tdef_vty_test.c<br>A tests/tdef/tdef_vty_test.vty<br>M tests/testsuite.at<br>14 files changed, 1,540 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/12717/3</pre><p>To view, visit <a href="https://gerrit.osmocom.org/12717">change 12717</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12717"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5 </div>
<div style="display:none"> Gerrit-Change-Number: 12717 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>