<p>Vadim Yanitskiy <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/14069">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libmsc/msc_vty.c: refactor 'show subscr / conn / trans' commands<br><br>The current way of printing subscriber, connection, and transaction<br>info is ugly (sorry) and has several problems:<br><br>  - the terminal width should be large enough to fit quite long lines,<br>    otherwise the output is unreadable and looks misaligned;<br><br>  - some fields (such as subscriber name) can be larger than it's<br>    expected, so either they're getting truncated, or again, the<br>    output is misaligned and unreadable;<br><br>  - adding new info fields would require one to think about the<br>    alignment and would make the output even more cumbersome.<br><br>Here is an example output of 'show connection' command:<br><br>  _Subscriber_______________________________________ _LAC_ _RAN___________________ _MSC-A_state_________ _MSC-A_use_<br>  IMSI-123456789012345:MSISDN-12345:TMSI-0x12345678      1 GERAN-A-4294967295:A5-3 WAIT_CLASSMARK_UPDATE 2=cm_service,trans_cc<br>  IMSI-123456789012356:MSISDN-234567:TMSI-0x123ABC78 65535     UTRAN-Iu-4294967295         COMMUNICATING 2=cm_service,trans_sms<br>  IMSI-262073993158656:MSISDN-123456:TMSI-0x493026BA     1               GERAN-A-1 MSC_A_ST_COMMUNICATING 1=1 (silent_call)<br><br>Another 'show subscriber' command mixes the information about<br>subscriber, its connections and transactions without any alignment,<br>what also decreases the readability.<br><br>This change introduces a hierarchical approach, based on the old<br>'field per line' formatting. First of all, the VTY commands were<br>extended with optional flags:<br><br>  show connection [trans]<br>  show subscriber cache [(conn|trans|conn+trans)]<br>  show subscriber TYPE ID [(conn|trans|conn+trans)]<br><br>so it can be decided, whether to print child connections and/or<br>transaction, or not. For example:<br><br>  show connection trans<br><br>would print all connections and their child transactions with<br>hierarchical alignment:<br><br>  Connection #00:<br>    Subscriber: IMSI-262073993158656:MSISDN-123456:TMSI-0x76760B75<br>    RAN connection: GERAN-A-1<br>    RAN connection state: MSC_A_ST_COMMUNICATING<br>    LAC / cell ID: 1 / 0<br>    Use count total: 1<br>    Use count: 1 (silent_call)<br>    Transaction #00:<br>      Unique (global) identifier: 0x00000000<br>      GSM 04.07 identifier (MT): 0<br>      Type: silent-call<br><br>another example is:<br><br>  show subscriber cache conn+trans<br><br>which would print all known subscribers,<br>their active connections and transactions:<br><br>  Subscriber #00:<br>    MSISDN: 123456<br>    LAC / cell ID: 1 / 0<br>    RAN type: GERAN-A<br>    IMSI: 262073993158656<br>    TMSI: 76760B75<br>    ...<br>    Connection:<br>      RAN connection: GERAN-A-1<br>      RAN connection state: MSC_A_ST_COMMUNICATING<br>      ...<br>      Transaction #00:<br>        Unique (global) identifier: 0x00000000<br>       GSM 04.07 identifier (MT): 0<br>  Type: silent-call<br>      Transaction #01:<br>        Unique (global) identifier: 0x00000001<br>     GSM 04.07 identifier (MO): 0<br>  Type: SMS<br>      Transaction #02:<br>        Unique (global) identifier: 0x00000002<br>     GSM 04.07 identifier (MT): 0<br>  Type: SMS<br><br>Please note that we don't print redundant info in child nodes<br>(i.e. connection and transaction info), such as subscriber name<br>in connection info, nor connection name in transaction info - it<br>is clear from the hierarchical formatting.<br><br>Change-Id: I5e58b56204c3f3d019e8d4c3c96cefdbb4af4d47<br>---<br>M src/libmsc/msc_vty.c<br>1 file changed, 291 insertions(+), 170 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/69/14069/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/14069">change 14069</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/14069"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I5e58b56204c3f3d019e8d4c3c96cefdbb4af4d47 </div>
<div style="display:none"> Gerrit-Change-Number: 14069 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>