title DQUERY test routine for DOMAIN JSYS general request search domsym,macsym,monsym extern .gtdom,morg,mjfn,map01 sall .directive flblst,sfcond define bltdb(dest)< ;;copies section measurement database to movei t5,dest ;;specified destination call rbltdb > define cipct(a,b)< move t2,a imuli t2,^d200 idiv t2,b aos t2 ash t2,-1 > define cpct(a,b)< move t2,a imuli t2,^d2000 idiv t2,b aos t2 ash t2,-1 > define finn(hostad)< ;;print the host name given IP address move t3,hostad call fpinn > define fnum ($val,$width<0>,$flags<0>)< move t2,$val movx t3,<$width>b17+^d10+$flags nout nop > define fstar(wid,%l)< ;;print stars for overflo movei t3,wid %l: call fpstar sojn t3,%l > define fpct(a,b,c<0>,d<0>,%x)< ;;print a as percent of b skipn b jrst [ fstar jrst %x] cpct a,b idivi t2,^d10 push p,t3 fnum t2,c,d fmsg <.> pop p,t2 fnum t2 %x: > define favg(a,b,c<0>,d<0>,%x)< ;;print a/b and one digit after skipn b jrst [ ife c,> ifn c,< movei t3,c+2 call fpstrs> jrst %x ] move t2,a imuli t2,^d20 idiv t2,b aos t2 ash t2,-1 idivi t2,^d10 push p,t3 fnum t2,c,d fmsg <.> pop p,t2 fnum t2 %x: > define fina(a)< move t2,a call fpina > define kw(a,b)< [asciz/a/],,b > define gox(%aaa)< xjrstf [ 0 1,,%aaa] ;go extended %aaa: > define backx(%aaa)< xjrstf [ 0 0,,%aaa] ;back to section 0 %aaa: > define setfu(arg)< ;;macro to set fork usage stats in format xmovei t5,arg ;;compatible with domain fruse format call rruse> ;;used for DQUERY itself define sigma(start,end,delta<1>,%x)< ;;macro to add up an array setzm t2 ;;start with zero sum movei t3,start %x: add t2,0(t3) ;;add in new sample addi t3,delta ;;bump current address caig t3,end ;;skip if done jrst %x > subttl Bits N Stuff t1==1 t2==2 t3==3 t4==4 t5==5 t6==6 t7==7 flags==6 ;bits defined in flags dogth==1b35 ;do a GTHST call dogtd==1b34 ;do a general GTDOM donull==1b33 ;do a null call dogtda==1b32 ;do a GTDOM address op docall==1b31 ;emulate GTDOM via call opmask==dogth+dogtd+donull+dogtda dottl==1b30 dolen==1b29 dbase==16 ostream=cmdblk+.cmioj ;RH has output JFN ; ; DEFINITIONS which should eventually come from MONSYM ; gtdldo==1b0 ;local data only gtdmba==1b1 ;must be authoritative gtdrbk==1b6 ;resolve in background bit gtdaka==1b14 ;alias found subttl Main loop start: reset move p,[iowd pdlen,pdlist] ;restart stack movei flags,dottl+dogtd ;set defaults to TTL on, new function movei t1,11 ;setup default GTDOM% opcode movem t1,gtdcmd# setzm int ;set wait interval to zero hrlzi dbase,domsec ;set domain database origin movx t1,.fhslf runtm movem t3,pnew+elwb(t5) ;setup wall base time movem t3,pnew+elwb(t5) loop: move p,[iowd pdlen,pdlist] ;restart stack movei t1,cmdblk movei t2,[flddb. .cmini] comnd ;initialize command block erjmp errorc cmrprs: movei t2,[ fldbk. (.cmkey,,qttab,,<*>,starbk,swchbk)] movei t1,cmdblk comnd erjmp errorc txne t1,cm%nop jrst clerr ;signal command line error movs t4,t3 ;check to see if we parsed a switch came t4,t3 ;skip if not jrst eatsw hrrz t2,(t2) ;parsed a QTYPE hrlm t2,calltc ;put encoded type in type,,class cn: movei t2,[flddb. (.cmnoi,,<-1,,[asciz/QCLASS/]>)] movei t1,cmdblk comnd erjmp errorc movei t2,[fldbk. (.cmkey,,qctab,,,starbk)] movei t1,cmdblk ck: comnd erjmp errorc hrrz t2,(t2) ;get encoded class value hrrm t2,calltc ;put it in call type,,class movei t2,[flddb. (.cmnoi,,<-1,,[asciz/Domain name/]>)] movei t1,cmdblk dnn: comnd erjmp errorc movei t2,[fldbk. (.cmfld,,,,,[brmsk. (fldb0.,fldb1.,fldb2.,fldb3.,<.>)])] movei t1,cmdblk dnp: comnd erjmp errorc movei t2,confirm movei t1,cmdblk comnd erjmp errorc call cecho ; if an interval was specified wait the appropriate ; amount of time skipe t1,int call [ time move t2,await sub t2,t1 movem t2,await move t1,int disms time addm t1,await ;compute actual wait time ret ] ; ok now go call the appropriate function move t1,gtdcmd hrroi t2,atmbuf move t3,calltc move t4,[ point 8,dback ] aos ngtdom txne flags,donull jrst [ movx t3,^d99b11+^d99b19+^d99b27+^d99b35 jrst pacall] ;for a null call just print 99.99.99.99 txne flags,dogtda ;GTDOM emulation of GTHST name to address call jrst [ move t1,gtdcmd hrri t1,.gthsn hrroi t2,atmbuf txnn flags,docall jrst [ gtdom% jrst errorc jrst pacall ] call .gtdom jrst errorp jrst pacall ] txne flags,dogth jrst [ movei t1,.gthsn hrroi t2,atmbuf gthst jrst errorc pacall: push p,t3 ;save host address hrrz t1,ostream txne t4,HS%NCK ;NICKNAME? call [ fmsg ret ] pop p,t2 ;retrieve host address call fpina call crlf jrst loop] txnn flags,docall jrst [ gtdom% jrst errorc jrst domdon ] pushj p,.gtdom jrst errorp domdon: movem t4,dbackp ;remember updated output pointer move t5,[point 8,dback] ;start at front of output buffer txne t1,gtdaka ;skip if not alias call [ hrrz t1,ostream fmsg ret] dump1: camn t5,dbackp ;done ? jrst loop ;yes hrrz t1,ostream ;set output designator call ptrr ;go print the RR jrst dump1 confirm: flddb. (.cmcfm) ;get a confirmation subttl Tables for COMND and buffers pdlen==200 pdlist: block pdlen ;stack cmdblk: 0,,cmrprs .priin,,.priou -1,,[asciz/(QTYPE) /] -1,,cmdbuf -1,,cmdbuf cmdbsz*5-1 0 -1,,atmbuf atmbsz*5-1 gtjblk cmdbsz==20 cmdbuf: block cmdbsz atmbsz==20 atmbuf: block atmbsz calltc: 0 ;type,,class for call dback: block 200 dbackp: 0 gtjblk: block .gjatr+1 starbk: brmsk. (fldb0.,fldb1.,fldb2.,fldb3.,<*>) qttab: qtlen,,qtlen kw (*,dstar) kw (A,da) kw (CNAME,dcname) kw (HINFO,dhinfo) kw (MAILA,dmaila) kw (MAILB,dmailb) kw (MB,dmb) kw (MG,dmg) kw (MD,dmd) kw (MF,dmf) kw (MINFO,dminfo) kw (MR,dmr) kw (MX,dmx) kw (NS,dns) kw (NULL,dnull) kw (PTR,dptr) kw (SOA,dsoa) kw (WKS,dwks) qtlen==.-qttab-1 qctab: qclen,,qclen kw (*,dstar) kw (CS,dcs) kw (IN,din) qclen==.-qctab-1 qoctab: qoclen,,qoclen kw (* ,dstar) kw (CS,dcs) kw (IN,din) qoclen==.-qoctab-1 pttab: ptlen,,ptlen ;port table kw (RJE,^d5) kw (ECHO,^d7) kw (DISCARD,^d9) kw (USERS,^d11) kw (DAYTIME,^d13) kw (NETSTAT,^d15) kw (QUOTE,^d17) kw (CHARGEN,^d19) kw (FTP,^d20) kw (FTP,^d21) kw (TELNET,^d23) kw (SMTP,^d25) kw (NSW-FE,^d27) kw (MSG-ICP,^d29) kw (MSG-AUTH,^d31) kw (TIME,^d37) kw (RLP,^d39) kw (GRAPHICS,^d41) kw (NAMESERVER,^d42) kw (NICNAME,^d43) kw (MPM-FLAGS,^d44) kw (MPM,^d45) kw (MPM,^d46) kw (NI-FTP,^d47) kw (LOGIN,^d49) kw (LA-MAINT,^d51) kw (DOMAIN,^d53) kw (ISI-GL,^d55) kw (NI-MAIL,^d61) kw (VIA-FTP,^d61) kw (TFTP,^d69) kw (NETRJS,^d71) kw (NETRJS,^d72) kw (NETRJS,^d73) kw (NETRJS,^d74) kw (FINGER,^d79) kw (HOSTS2-NS,^d83) kw (MIT-ML-DEV,^d85) kw (MIT-ML-DEV,^d87) kw (SU-MIT-TG,^d89) kw (MIT-DOV,^d91) kw (DCP,^d93) kw (SUPDUP,^d95) kw (SWIFT-RVF,^d97) kw (METAGRAM,^d99) kw (HOSTNAME,^d101) kw (CSNET-NS,^d105) kw (RTELNET,^d107) kw (POP,^d109) kw (SUNRPC,^d111) kw (AUTH,^d113) kw (SFTP,^d115) kw (UUCP-PATH,^d117) kw (SUR-MEAS,^d243) kw (LINK,^d245) ptlen==.-pttab-1 ; protocol--keywords only pctab: pclen,,pclen kw (ICMP,1) kw (GGP,^d3) kw (ST,^d5) kw (TCP,^d6) kw (UCL,^d7) kw (EGP,^d8) kw (IGP,^d9) kw (BBN-RCC-MON,^d10) kw (NVP-II,^d11) kw (PUP,^d12) kw (ARGUS,^d13) kw (EMCON,^d14) kw (XNET,^d15) kw (CHAOS,^d16) kw (UDP,^d17) kw (MUX,^d18) kw (DCN-MEAS,^d19) kw (HMP,^d20) kw (PRM,^d21) kw (XNS-IDP,^d22) kw (TRUNK-1,^d23) kw (TRUNK-2,^d24) kw (LEAF-1,^d25) kw (LEAF-2,^d26) kw (RDP,^d27) kw (CFTP,^d62) kw (SAT-EXPAK,^d64) kw (MIT-SUBNET,^d65) kw (RVD,^d66) kw (IPPC,^d67) kw (SAT-MON,^d69) kw (IPCV,^d71) kw (BR-SAT-MON,^d76) kw (WB-MON,^d78) kw (WB-EXPAK,^d79) pclen==.-pctab-1 subttl Error handling routines errorc: movx t1,.fhslf geter hrrz t2,t2 ;toss process handle cain t2,iox4 jrst [ movx t1,.fhslf clzff haltf jrst start ] push p,2 jrst .+2 errorp: push p,1 aos nerror hrrz t1,ostream hrroi t2,[ asciz /Error /] setzb t3,t4 sout pop p,2 hrrz 2,2 hrrz t1,ostream movei 3,10 nout nop push p,2 hrroi t2,[asciz / /] setzb t3,t4 sout pop p,2 hrli t2,.fhslf sub 3,3 erstr erjmp .+1 erjmp .+1 hrrz t1,ostream hrroi t2,[asciz / returned /] setzb t3,t4 sout jrst loop clerr: hrrz t1,ostream fmsg <***** Argument error > jrst loop subttl Switch handling tables and routines swchbk: flddb. (.cmswi,,swtab,,) swtab: swlen,,swlen kw (back,setbck) kw (call,setcal) kw (clear,clrvar) kw (efile,endf) kw (file,infil) kw (freeze,setfrz) kw (gtdom,gtdop) kw (gtdoma,gtdaop) kw (gthst,gthop) kw (interval,gtival) kw (ldo,setldo) kw (len,setlen) kw (mapr,clrmw) kw (mapw,setmw) kw (mba,setmba) kw (mgtdom,setmgt) kw (noback,clrbck) kw (nocall,clrcal) kw (nofreeze,clrfrz) kw (noldo,clrldo) kw (nolen,clrlen) kw (nomba,clrmba) kw (nomgtdom,clrmgt) kw (nottl,clrttl) kw (null,nullop) kw (set,setvar) kw (stats,dostat) kw (ttl,setttl) swlen=.-swtab-1 gthop: movei t1,dogth jrst setop gtdaop: movei t1,dogtda jrst setop gtdop: movei t1,dogtd jrst setop nullop: movei t1,donull setop: andcmi flags,opmask ior flags,t1 jrst loop eatsw: hrrz t2,(t2) ;get table pointer jrst (t2) clrcal: movei t1,docall clear: andcm flags,t1 jrst loop clrttl: movei t1,dottl jrst clear setttl: movei t1,dottl jrst setit clrlen: movei t1,dolen jrst clear setlen: movei t1,dolen jrst setit setcal: movei t1,docall setit: ior flags,t1 jrst loop setbck: move t1,gtdcmd iorx t1,gtdrbk ;turn on resolve in background bit movem t1,gtdcmd jrst loop clrbck: move t1,gtdcmd andx t1,-1-gtdrbk movem t1,gtdcmd jrst loop setldo: move t1,gtdcmd iorx t1,gtdldo ;turn on local data only bit movem t1,gtdcmd jrst loop clrldo: move t1,gtdcmd andx t1,-1-gtdldo movem t1,gtdcmd jrst loop setmgt: setom mgtdom jrst loop clrmgt: setzm mgtdom jrst loop setfrz: setom t1,freeze ;freeze measurement area jrst loop clrfrz: setzm freeze jrst loop setmw: setom mapw jrst loop clrmw: setzm mapw jrst loop setmba: move t1,gtdcmd iorx t1,gtdmba ;turn on must be authoritative bit movem t1,gtdcmd jrst loop clrmba: move t1,gtdcmd andx t1,-1-gtdmba movem t1,gtdcmd jrst loop gtival: movei t1,cmdblk movei t2,[flddb. (.cmnum,,^d10,)] comnd erjmp errorc txne t1,cm%nop jrst [ call cecho hrrz t1,ostream fmsg jrst loop] movem t2,pint# ;save proposed interval movei t2,[flddb. (.cmcfm)] ;get a confirmation movei t1,cmdblk comnd erjmp errorc move t2,pint movem t2,int# jrst loop infil: movei t1,cmdblk movei t2,[flddb. (.cmifi,,,)] comnd erjmp errorc txne t1,cm%nop jrst [ call cecho hrrz t1,ostream hrroi t2,[asciz/Can't do that file /] setzb t3,t4 sout jrst loop ] move t1,t2 ;t1 gets jfn hrlm t2,jfndat# movx t2,of%rd+7b5 openf erjmp errorc movei t1,cmdblk movei t2,[flddb. (.cmofi,,,)] comnd erjmp errorc txne t1,cm%nop jrst [ call cecho hrrz t1,ostream hrroi t2,[asciz/Can't do that file /] setzb t3,t4 sout jrst loop ] move t1,t2 ;t1 gets jfn hrrm t2,jfndat# movx t2,of%wr+7b5 openf erjmp errorc movei t2,[flddb. (.cmcfm)] ;get a confirmation movei t1,cmdblk comnd erjmp errorc move t1,jfndat movem t1,ostream ;set the input JFN in command block eloop: call cecho jrst loop endf: call cecho ;reset to primary input and output hrrz t1,cmdblk+.cmioj closf nop hlrz t1,cmdblk+.cmioj closf nop movx t1,<.priin,,.priou> movem t1,cmdblk+.cmioj jrst loop dostat: call chkdb ;make sure there is a database mapped in movei t1,cmdblk movei t2,[flddb. (.cmofi,,,,)] comnd erjmp errorc txne t1,cm%nop jrst [ call cecho hrrz t1,ostream hrroi t2,[asciz/Can't do that file /] setzb t3,t4 sout jrst loop ] move t1,t2 ;t1 gets jfn hrrzm t2,sstream# movx t2,of%wr+7b5 openf erjmp errorc movei t2,[flddb. (.cmcfm)] ;get a confirmation movei t1,cmdblk comnd erjmp errorc call cecho call statp move t1,sstream closf nop jrst loop cecho: move t1,ostream ;echo command if not primary came t1,[.priin,,.priou] call [ hrrz t1,ostream move t2,cmdblk+.cmbfp setzb t3,t4 sout ret ] ret subttl Databse variable routines ; ; /SET and /CLEAR are used to chage the values of variables in the ; database ; ; /set variable sets variable to 1 ; /set variable number sets variable to number ; /clear variable sets variable to 0 ; /clear variable number sets variable to number clrvar: setzm varval jrst setcom setvar: movei t1,1 movem t1,varval setcom: setom mapw call chkdb movei t1,cmdblk movei t2,[flddb. (.cmnoi,,<-1,,[asciz/location/]>)] comnd erjmp errorc movei t1,cmdblk movei t2,[flddb. (.cmkey,,loctab,)] comnd erjmp errorc txne t1,cm%nop jrst clerr hrrz t2,0(t2) ;address of switch descriptor movem t2,vardv ;save address of variable descriptor movei t1,cmdblk ;get value or confirm movei t2,[flddb. (.cmnum,,^d10,,,confirm)] comnd erjmp errorc txne t1,cm%nop jrst clerr movs t4,t3 ;see if value worked came t4,t3 ;skip if got value jrst setgo ;nope use default movem t2,varval ;save value movei t1,cmdblk movei t2,confirm comnd ;get confirm erjmp errorc txne t1,cm%nop jrst clerr setgo: move t1,varval ;get variable value move t2,vardv ;get variable dope vector caml t1,1(t2) ;check against minimum camle t1,2(t2) ;check against maximum jrst varerr move t2,0(t2) ;get variable address add t2,dbase gox move t3,0(t2) ;get old value movem t3,varold movem t1,0(t2) ;store new value backx hrrz t1,ostream ;print message with change move t2,vardv hrroi t2,3(t2) setzb t3,t4 sout call space fnum varold fmsg < becomes > fnum varval call crlf jrst loop varerr: call cecho hrrz t1,ostream move t5,vardv Fmsg fnum 1(t5) fmsg < and > fnum 2(t5) call crlf jrst loop varval: 0 ;value to store varold: 0 ;old value vardv: 0 ;address of variable address,min,max,text define kwv(v,a,t,mi<0>,ma<1>)< [asciz/v/],,[a mi ma asciz/t/] > loctab: loclen,,loclen kwv (CACHEP,cachep,,0,0) kwv (DYNDEN,dynden+msrdat,resolver dynamic timeout denominator,^d1,^d1000) kwv (DYNNUM,dynnum+msrdat,resolver dynamic timeout numerator,^d1,^d1000) kwv (DYNSW,dynsw+msrdat,resolver dynamic timeout enable) kwv (INFTTL,infttl+msrdat,GTDOM TTL,5,^d31) kwv (LCKTTL,lckttl+msrdat,database lock disms interval,^d20,^d10000) kwv (LOGNS,logns,name server summary logging) kwv (LOGRI,logri,resolver incoming UDP logging) kwv (LOGRN,logrn,resolver normal loging) kwv (LOGRP,logrp,resolver log peculiar packets) kwv (LOGUA,logua,UDP all packets logging) kwv (LOGUE,logue,UDP error logging) kwv (MAXIT,maxit+msrdat,resolver max tries per address,1,^d1000) kwv (MAXST,maxst+msrdat,resolver max tries per server,1,^d1000) kwv (PLTTL,plttl+msrdat,primitive lock disms interval,^d20,^d10000) kwv (QTOI,qtoi+msrdat,initial query timeout for static mode,^d250,^d10000) kwv (QTOQ,qtoq+msrdat,quiet query timeout for static mode,^d1000,^d60000) kwv (QTOR,qtor+msrdat,retransmit query timeout for static mode,^d250,^d10000) kwv (RBPOLL,rbpoll+msrdat,resolver busy poll interval for test version,^d20,^d10000) kwv (RIPOLL,ripoll+msrdat,resolver idle poll interval for test version,^d20,^d10000) kwv (RMTTL,rmttl+msrdat,resolver max TTL,6,^d31) kwv (RWAIT,rwait+msrdat,GTDOM resolver wait disms interval,^d10,^d1000) kwv (RWAITI,rwaiti+msrdat,GTDOM initial resolver wait disms interval,^d100,^d1000) kwv (UDPHL,udphl+msrdat,halflife for resolver address selection data,^d10000,^d3600000) loclen==.-loctab-1 subttl Statistics routines ; ; STATC initializes the base statistics ; statc: setzm ngtdom# ;zero number of GTDOM calls setfu pbase ;setup base usage for program setzm nerror# ;zero error count setzm await# ;zero wait time bltdb base ret ; ; STATP prints out a complete set of statistics ; statp: setfu pnew ;set this process' usage in pnew bltdb new ;blt database measurements to new hrrz t1,sstream ;set destination designator movei t5,new ;get statistics area address call pmhead ;print measuremnet header call crlf call pdquery ;print DQUERY statistics call crlf movei t5,new ;get statistics area address call pgtdom ;print GTDOM statistics call prsolve ;print resolver statistics call pns ;print name server statistics ret ;statistics complete subttl Catalog of printing routines ; All routines use t1 for the output designator ; ; Name t2 t5 Prints ; ; PMHEAD MSURE measurement header information ; PDQUERY dquery process statistics ; PGTDOM MSURE GTDOM JSYS statistics ; PRSOLVE MSURE resolver statistics ; PNS MSURE name server statistics ; ; PTRDAT FRUSE fork resource usage data ; PTRAVG count FRUSE fork resource usage data and ; per request averages ; PTRR RR RRs as returned by GTDOM ; PTHST HGRAPH host usage information ; PTGRA TGRAPH elapsed time graph ; PBYQT QGRAPH distribution by QTYPE ; PBYQC CGRAPH distribution by QCLASS ; PBYDS DGRAPH time of day graph ; PBYRC RGRAPH response code graph ; FPRC rcode response code ; FPSOK socket socket name ; FPINA address dotted internet address ; FPNUM number decimal number ; FPMS time milliseconds or hh:mm:ss ; FPGTAD IDST internal time string ; FPAZ BP ASCIZ string ; FPDNF BP DSTRING ; FPQT qtype QTYPE (and TAB) ; FPQC qclass QCLASS (and space) ; FPDOT "." ; FPSTAR "*" ; CRLF CR/LF ; FPTAB TAB ; SPACE " " ; FPFF formfeed subttl PMHEAD prints the header information from a MSURE block pmhead: fmsg move t2,[ point 8,mname(t5) ] call fpaz fmsg < printed at > push p,t1 gtad move t2,t1 ;remember time in t2 pop p,t1 call fpgtad call crlf fmsg move t2,tzero(t5) call fpgtad move t2,tzero(t5) ;see if statistics were ever reset came t2,mclear(t5) call [ fmsg <, cleared > move t2,mclear(t5) call fpgtad ret ] fmsg <, measured > move t2,mdate(t5) call fpgtad call crlf fmsg < Primary file: > hrroi t2,prifn(t5) call fpaz fmsg < Secondary file: > hrroi t2,secfn(t5) call fpaz fmsg < Version: > fnum dupver(t5) call crlf skipe mcomment(t5) ;print comment if one there call [ fmsg hrroi t2,mcomment(t5) call fpaz callret crlf] fmsg < UDP send errors: > fnum uoerrs(t5) fmsg < receive errors: > fnum uierrs(t5) callret crlf subttl PDQUERY prints DQUERY summary and fork usage pdquery:fmsg fnum ngtdom skipe nerror call [ fmsg < Errors: > fnum nerror ret ] skipe int call [ fmsg < Interval: > move t2,ngtdom movem t2,statd move t2,await call statt ret ] call crlf movei t5,pnew move t2,ngtdom call ptravg ;pretty print resource data and averages ret subttl PGTDOM prints GTDOM JSYS statistics pgtdom: ret fmsg xmovei t5,msrdat+dfgra(dbase) call ptgra call fpff ret subttl PRSOLVE prints resolver related statistics prsolve:fmsg move t2,dresol(t5) ;resolver attempts sub t2,drnldo ;less LDO lossage push p,t2 fnum t2 call crlf pop p,t2 push p,t5 movei t5,rusage(t5) call ptravg call crlf fmsg move t5,0(p) movei t5,newudp(t5) call pthst call fpff fmsg move t5,0(p) movei t5,udphst(t5) call pthst call fpff fmsg move t5,0(p) movei t5,udpgra(t5) call ptgra pop p,t5 ;pop saved t5 ret subttl PNS prints name server related statistics pns: fmsg fnum nsugra+touts(t5) ;get number of name server requests push p,t5 skipe bogon(t5) call [ fmsg < Bogons:> fnum bogon(t5) ret ] skipe pfail(t5) call [ fmsg < Parse fails:> fnum pfail(t5) ret ] call crlf move t2,nsugra+touts(t5) ;get divisor movei t5,nusage(t5) call ptravg ;print resource usage call crlf move t5,0(p) ;calculate queries/min move t2,nusage+elwall(t5) idivi t2,^d60000 move t4,t2 favg nsugra+touts(t5),t4 fmsg < queries/min > skipe bogon(t5) call [ move t5,-1(p) ;calculate bogons/min move t2,nusage+elwall(t5) idivi t2,^d60000 move t4,t2 favg bogon(t5),t4 fmsg < bogons/min> ret ] skipe pfail(t5) call [ move t5,-1(p) ;calculate pfails/min move t2,nusage+elwall(t5) idivi t2,^d60000 move t4,t2 favg pfail(t5),t4 fmsg < parse failure/min> ret ] call crlf fmsg move t5,0(p) movei t5,nsbyqt(t5) call pbyqt call crlf fmsg move t5,0(p) movei t5,nsbyqc(t5) call pbyqc call crlf fmsg move t5,0(p) movei t5,nsucod(t5) call pbyrc call fpff move t5,0(p) movei t5,nssgra(t5) call psgra ;print by section graph data fmsg < Transport truncation > move t5,0(p) fnum nudptc(t5),6,no%lfl fpct nudptc(t5),ssigma,4,no%lfl fmsg < Authoritative msgs > fnum nsaa(t5),6,no%lfl fpct nsaa(t5),ssigma,4,no%lfl call crlf call fpff fmsg move t5,0(p) ;get t5 back movei t5,nsuhst(t5) call pthst ;print by host statistics call fpff fmsg move t5,0(p) movei t5,nsugra(t5) ;print response time graph call ptgra call fpff fmsg move t5,0(p) ;Print time of day usage movei t5,nsbyds(t5) call pbyds pop p,t5 ;restore t5 ret ;statistics complete subttl routines to print process resource usage statistics ptrdat: movei t2,1 ptravg: movem t2,statd ;save divisor fmsg move t2,elpgt(t5) call stati fmsg < Faults: > move t2,elpgf(t5) call stati fmsg < Pager time: > move t2,elpgrt(t5) call statt call crlf fmsg move t2,elrun(t5) call statt fmsg < Elapsed time: > move t2,elwall(t5) call statt callret crlf stati: movem t2,statn fnum t2 ;take the number in t1 and output it skipn statd ;if any tests have been run ret ;also print number divided by test count fmsg < (> ;print avg inside of parentheses favg statn,statd fmsg <)> ret statt: movem t2,statn call fpms ;print millisecond time skipn statd ;if any tests have been run ret ;also print number divided by test count fmsg < (> ;print avg inside of parentheses favg statn,statd fmsg <)> ret statn: block 1 statd: block 1 subttl PTRR prints out a RR ; ; On entry: On exit: ; ; t1/output designator ; t5=RR byte pointer t5=updated byte pointer ; ptrr: call otype ;output the type call oclass ;output the class call g4 ;get ttl txne flags,dottl call onum call g2 movem t2,left txne flags,dolen call onum move t2,class ;get class back caie t2,din ;is this internet class? jrst [ call orest ;if not dump in octal call crlf ret ] move t2,type ;get type back cain t2,da jrst [ call oina ;output internet address jrst ckterm ] cain t2,dcname jrst [ onedn: call odn jrst ckterm ] cain t2,dhinfo jrst [ call ostr call fptab call ostr jrst ckterm ] cain t2,dmb jrst onedn cain t2,dmg jrst onedn cain t2,dmd jrst onedn cain t2,dmf jrst onedn cain t2,dminfo jrst [ call odn call fptab jrst onedn ] cain t2,dmx jrst [ call o2 jrst onedn ] cain t2,dmr jrst onedn cain t2,dns jrst onedn cain t2,dnull jrst [ call orest call crlf ret ] cain t2,dptr jrst onedn cain t2,dsoa jrst [ call odn ;master host name call space call odn ;responsible person name call space call o4 ;serial call o4 ;refresh call o4 ;retry call o4 ;expire call o4 ;minimum jrst ckterm ] cain t2,dwks jrst [ call oina call fptab call opcall setzm sok# sokbl: skipg left ;done? jrst ckterm call getch lsh t2,34 movei t7,10 soklp: skipge t2 call [ push p,t2 move t2,sok call fpsok call space pop p,t2 ret ] aos sok lsh t2,1 sojg t7,soklp jrst sokbl ] callret orest ;if unknown type, output octal ckterm: skipn left ;check to see that emptied the RR callret crlf ;exit if so fmsg <***** UNEXPECTED RR END ****** > jrst loop subttl Routines to scan and print encoded values otype: call g2 movem t2,type fpqt: movei t3,qttab lop: call lookup setzb t3,t4 sout callret fptab oclass: call g2 movem t2,class fpqc: movei t3,qoctab call lookup setzb t3,t4 sout callret space opcall: call getch movei t3,pctab jrst lop ; ; LOOKUP ; ; t2=code t2=7777777,address of string ; t3=>table ; lookup: hrrz t4,0(t3) ;get number of entries hrrzi t3,1(t3) ;bump past count push p,t1 lookl: sosge t4 ;check for end of table jrst [ hrroi t1,unkbuf ;create unknown code text movx t3,no%lfl+no%ast+5b+^d10 nout nop hrroi t2,unkbuf jrst lookr] hrrz t1,0(t3) ;get table code came t2,t1 aoja t3,lookl hlro t2,0(t3) lookr: pop p,t1 ret unkbuf: block 3 type: block 1 ;last RR type scanned class: block 1 ;last RR class scanned left: block 1 ;octets left in RDATA subttl Routines to scan and print primitive things o4: call g4 onum: call fpnum callret space o2: call g2 jrst onum orest: skipn left ;done ? callret crlf ;yes, do a crlf call getch ;print rest as octal bytes move t3,[4,,10] nout nop jrst orest ostr: call getch ;get length movem t2,strl ostrl: sosge strl ret call getch bout nop jrst ostrl strl: block 1 oina: call g4 ;print internat address callret fpina odn: call getch ;scan and print a domain name in ASCIZ cain t2,0 ret bout nop jrst odn subttl Octet string input routines ; ; character input routines ; ; Getch gets 1 octet, g2 gets 2 octets as 16 bit number ... ; ; t2=returned value ; t5=input byte pointer updated input byte pointer ; ; left gets decremented ; getch: ildb t2,t5 sos left ret g2: call getch ;get first octet lsh t2,10 ;shift it over push p,t2 call getch ;get second octet pop p,t3 add t2,t3 ;add octets together to get 16 bits ret g4: call g2 ;note UNSIGNED lsh t2,20 push p,t2 call g2 pop p,t3 add t2,t3 ret subttl PTHST prints out the host usage graph ; ; on entry ; t1/ destination ; t5/ =>hgraph ; pthst: push p,t6 push p,t7 move t7,t5 movei t6,hslots setzm hgto ;calculate total out setzm hgtb ;calculate total back pthsum: move t2,hgtout(t5) addm t2,hgto ;total out move t2,hgtbac(t5) addm t2,hgtb ;total back addi t5,hgre sojn t6,pthsum ;loop until all slots tallied move t5,t7 movei t6,hslots move t2,hgto add t2,hgtb jumpe t2,pthstr ;escape if no samples fmsg < Start %All Done %Done Avg time Host > phstl: skipe t2,hghost(t5) call [ fnum hgtout(t5),6,no%lfl call space fpct hgtout(t5),hgto,2,no%lfl call space fnum hgtbac(t5),6,no%lfl call space fpct hgtbac(t5),hgtout(t5),3,no%lfl call space favg hgtt(t5),hgtbac(t5),6,no%lfl call space cain t6,1 jrst [ fmsg <***** Others *****> callret crlf ] fina hghost(t5) fmsg < > finn hghost(t5) callret crlf] addi t5,hgre ;move on to next slot sojn t6,phstl ;and loop if any slots left fmsg < Total out > fnum hgto fmsg < Total back > fnum hgtb fmsg < > fpct hgtb,hgto,3,no%lfl fmsg <%> pthstr: pop p,t7 pop p,t6 callret crlf hgto: block 1 ;total out hgtb: block 1 ;total back subttl PTGRA prints the trip time graph and stats ; ; on entry ; t1/ destination ; t5/ =>tgraph block ; ptgra: push p,t6 push p,t7 skipn touts(t5) jrst ptgrar fmsg fnum touts(t5) fmsg < completed: > fnum tbacks(t5) fmsg < > fpct tbacks(t5),touts(t5) fmsg <% Completed > fmsg fnum tquanta(t5) fmsg < Average: > favg ttotal(t5),tbacks(t5) call crlf call crlf fmsg < Time Count slot% sum%> call crlf sub t6,t6 ;slot index sub t7,t7 ;cumulative total ptgl: move t2,t6 ;print one line of timing graph cain t2,tslots ;skip if not last jrst [ fmsg < over> jrst ptgl1] imul t2,tquanta(t5) ;convert slot to ms low limit fnum t2,5,no%lfl ptgl1: fmsg < > xmovei t2,tdelay(t5) add t2,t6 move t2,0(t2) ;get count for this slot movem t2,slotct# ;save it fnum t2,7,no%lfl fmsg < > fpct slotct,tbacks(t5),3,no%lfl ;print percentage of total fmsg < > add t7,slotct fpct t7,tbacks(t5),3,no%lfl ;print covered percentage fmsg < > cipct slotct,tbacks(t5) ;calculate integer percentage movem t2,slotpc# cipct t7,tbacks(t5) sub t2,slotpc ;calculate excess movem t2,totpc# skipe t2,slotpc call fpbar skipe t3,totpc call [ sose t3 call [osp: movei t2," " bout sojn t3,osp ret] movei t2,"+" bout ret ] call crlf caie t6,tslots aoja t6,ptgl ptgrar: pop p,t7 pop p,t6 ;exit ptgra ret subttl PBYQT prints a by qtype graph pbyqt: push p,t5 ;save block pointer sigma 0(t5),qslots-1(t5) movem t2,qsigma ;save total count movem t5,qscan ;start of loop movei t5,qslots-1(t5) movem t5,qend ;end of loop jumpn t2,pbyqt1 fmsg <***** No QTYPE samples present ***** > pop p,t5 ret pbyqt1: setzm qnum fmsg qtloop: aos qnum ;bump QTYPE skipe @qscan ;skip if slot empty call [ move t2,qnum call fpqt ;print qtype fnum @qscan,7,no%lfl call space fpct @qscan,qsigma,3,no%lfl cipct @qscan,qsigma call fpbar call crlf ret ] aos t2,qscan ;bump pointer camg t2,qend jrst qtloop fmsg < TOTAL > fnum qsigma,7,no%lfl pop p,t5 callret crlf qscan: block 1 ;pointer to current slot qend: block 1 ;pointer to last slot qsigma: block 1 ;sum of slots qnum: block 1 ;current qtype subttl PBYQC prints a by qclass graph pbyqc: push p,t5 ;save block pointer sigma 0(t5),cslots-1(t5) movem t2,csigma ;save total count movem t5,cscan ;start of loop movei t5,cslots-1(t5) movem t5,cend ;end of loop jumpn t2,pbyqc1 fmsg <***** No QCLASS samples present ***** > pop p,t5 ret pbyqc1: setzm cnum fmsg qcloop: aos cnum ;bump QCLASS skipe @cscan ;skip if slot empty call [ move t2,cnum call fpqc ;print qclass call fptab fnum @cscan,7,no%lfl call space fpct @cscan,csigma,3,no%lfl cipct @cscan,csigma call fpbar call crlf ret ] aos t2,cscan ;bump pointer camg t2,cend jrst qcloop fmsg < TOTAL > fnum csigma,7,no%lfl pop p,t5 callret crlf cscan: block 1 ;pointer to current slot cend: block 1 ;pointer to last slot csigma: block 1 ;sum of slots cnum: block 1 ;current qclass subttl PBYRC prints a by response code table toprc==^d15 ;max response code pbyrc: push p,t5 ;save block pointer sigma 0(t5),toprc(t5) movem t2,rsigma ;save total count movem t5,rcscan ;start of loop movei t5,toprc(t5) movem t5,rcend ;end of loop jumpn t2,pbyrc1 fmsg <***** No response code samples present ***** > pop p,t5 ret pbyrc1: setzm rcnum fmsg rcloop: skipe @rcscan ;skip if slot empty call [ move t2,rcnum call fprc ;print rcype call fptab fnum @rcscan,7,no%lfl call space fpct @rcscan,rsigma,3,no%lfl cipct @rcscan,rsigma call fpbar call crlf ret ] aos rcnum ;bump RCODE aos t2,rcscan ;bump pointer camg t2,rcend jrst rcloop fmsg < TOTAL > fnum rsigma,7,no%lfl pop p,t5 callret crlf rcscan: block 1 ;pointer to current slot rcend: block 1 ;pointer to last slot rsigma: block 1 ;sum of slots rcnum: block 1 ;current rc subttl FPRC print a name server response code fprc: movei t3,rctab ;response code lookup call lookup setzb t3,t4 sout ret rctab: rclen,,rclen kw (10,10) kw (11,11) kw (12,12) kw (13,13) kw (14,14) kw (15,15) kw (6,6) kw (7,7) kw (8,8) kw (9,9) kw (format,1) kw (namerr,3) kw (normal,0) kw (notimp,4) kw (refuse,5) kw (sfail,2) rclen==.-rctab-1 subttl PBYDS prints a by time graph pbyds: push p,t5 ;save block pointer sigma 0(t5),dimax(t5) movem t2,dsigma ;save total count movem t5,dscan ;start of loop movei t5,dimax(t5) movem t5,dend ;end of loop jumpn t2,pbyds1 fmsg <***** No time of day samples present ***** > pop p,t5 ret pbyds1: setzm dnum skipn @dscan ;supress leading empties jrst [ aos dnum aos dscan jrst .-1 ] skipn @dend ;supress trailling empties jrst [ sos dend jrst .-1 ] fmsg