1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
/* SNFHPILD EXEC: Delta-sniffer for virtual HPIL. MF 25.3.2013 */
/* needs DCF REXX to decode frames */
exIP = 172.18.23.33 /* out IP */
p.in = 60002; p.ex = 60002 /* 1st in and out port */
q.in = 60003; q.ex = 60003 /* 2nd in and out port */
h = 'To quit enter PIPMOD STOP.' /* just a hint */
if arg() > 0 then do /* any argument shows settings */
say 'In1:' p.in || ', out1:' exip || ',' p.ex || '.'
say 'In2:' q.in || ', out2:' exip || ',' q.ex || '.' h
end
else say h /* display hint in any case */
'PIPE(sep | end ?)',
'|a:tcplisten' p.in, /* get client connected */
'| take', /* one only */
'|b:tcpdata linger 1200', /* read in from the loop */
'| fblock 2', /* make single frames */
'|c:fanout', /* get a copy */
'|d:tcpclient' exIP p.ex, /* send it out on the loop */
'?a:', /* errors from TCPLISTEN */
'|e:faninany', /* collect more errors */
'| pipestop', /* in case of error give up */
'| sort uniq', /* if others tell the same */
'|f:chop after blank', /* get leading return code ... */
'| aggrc', /* ... and set RC of this PIPE */
'?b:|e:', /* errors from TCPDATA */
'?c:', /* frames from the loop */
'| dcf', /* decode frame */
'|g:fanout', /* to COMBINE */
'|h:spec *-* 1.19 /:/ nw', /* frame from first station... */
'select 1 *-* nw', /* ... and from second station */
'| term', /* present to user */
'?d:|e:', /* errors from TCPCLIENT */
'?f:', /* from CHOP */
'| term', /* send to CRT */
'?g:', /* from FANOUT */
'|i:combine x', /* spot the difference */
'| xlate *-* 01-ff 2 00 0', /* colorize delta */
'| insert /vsc writ cms 0 24 0 (color /', /* combine CMDs */
'| insert /;PSC REF/ after', /* show it immediately */
'| split ;', /* one CMD one line */
'| cms', /* execute the CMDs */
'?j:tcplisten' q.in, /* get client connected */
'| take', /* one only */
'|k:tcpdata linger 1200', /* read in from the loop */
'| fblock 2', /* make single frames */
'|l:fanout', /* get a copy */
'|m:tcpclient' exIP q.ex, /* send it out on the loop */
'?j:|e:?k:|e:?m:|e:', /* errors to PIPESTOP */
'?l:', /* frames from the loop */
'| dcf', /* decode frame */
'|n:fanout', /* to COMBINE */
'|h:', /* to SPEC */
'?n:|i:' /* short through */
exit rc /* that's it */
|