### in-ntp.tcl  -*- Tcl -*-
## Animate NTP access for the Internet walkthrough.

### Ivan Shmakov, 2020

## To the extent possible under law, the author(s) have dedicated
## all copyright and related and neighboring rights to this software
## to the public domain worldwide.  This software is distributed
## without any warranty.

## You should have received a copy of the CC0 Public Domain Dedication
## along with this software.  If not, see
## <http://creativecommons.org/publicdomain/zero/1.0/>.

### Code:

package require aniputs
package require anisamp

namespace eval anima::ti::in-ntp {
alias kbd   ani_kbd   ev
alias samp  ani_samp  ev
}

proc anima::segment::in-ntp::animate { varn { pre-samp 0 } { pre-kbd 2500 } } {
    upvar $varn ev
    if { ${pre-samp} >= 0 } { samp {[ivan@fable] ~$ } ${pre-samp} }

    kbd "ntpq -pn -- wata.am-1.org \n" ${pre-kbd}
    samp {     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 1.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 2.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 3.debian.pool.n .POOL.          16 p    -   64    0    0.000   +0.000   0.000
 ff05::101       .MCST.          16 M    -   64    0    0.000   +0.000   0.000
-92.243.6.5      85.199.214.98    2 u  333 1024  367   15.402   -0.357   0.294
*81.21.65.168    85.199.214.99    2 u  515 1024  377    7.086   +0.311   0.186
-139.162.192.13  119.204.103.137  3 u 1024 1024  377    2.553   -2.778   2.417
+178.62.250.107  131.176.107.13   2 u  802 1024  377    7.488   +0.504   0.654
+134.0.16.1      194.35.252.7     2 u  896 1024  377    4.138   -0.002   0.243
[ivan@fable] ~$ }
}

### in-ntp.tcl ends here
