+-+-+-+ Beginning of part 4 +-+-+-+ X`009 rad$(swap%(cvt$%(mid(job0$,29%,2%)))) & X`009! Skip this if RTS not desired. Otherwise tack RTS info on the end. & X X25270`009msg$=msg$+chr$(13%)+chr$(10%) & X`009\ fnend & X`009! Terminate the output line properly & X X25280`009def* fnstate$ & X`009\ i%=swap%(cvt$%(mid(job1$,11%,2%))) & X`009\ b$="RN" & X`009\ goto 25320 if (i% and (swap%(cvt$%(mid(job1$,9%,2%)))))<>0% & X`009\ b$="RS" & X`009\ goto 25320 if (swap%(cvt$%(mid(job1$,15%,2%))))=0% and & X`009 ascii(mid(job1$,14%,1%))=196% & X`009\ i%=i% and (not 16384%) if (i% and (not 16384%))<>0% & X`009\ b$="BF" & X`009\ goto 25320 if (i% and 16384%)<>0% & X`009\ b$="SL" & X`009\ goto 25290 if (i% and 8192%)=0% & X`009\ b$="SR" if ascii(mid(job1$,7%,1%))=5% & X`009\ goto 25320 & X X25290`009b$="FP" & X`009\ goto 25320 if (i% and 4096%)<>0% & X`009\ b$="TT" & X`009\ goto 25320 if (i% and 2048%)<>0% & X`009\ b$="HB" & X`009\ goto 25320 if i%=0% & X`009\ j%=2% & X`009\ goto 25310 if i%=2% & X X25300`009k%=peek(peek(swap%(cvt$%(mid(job1$,25%,2%))))+ & X`009 ascii(mid(job1$,20%,1%))) & X`009\ j%=0% & X`009\ j%=peek(k%) and 255% if k%<>0% & X`009\ if j%=0% then l%=peek(peek(k%+8%)-4%) and 255% & X`009\ b$=cvt%$(swap%(peek(dsklog%+(l%*10%)+6%))) & X`009\ b$="??" if len(cvt$$(b$,-2%))=0% or k%=0% & X`009\ goto 25320 & X X25310`009b$=cvt%$(swap%(peek(devnam%+devokb%+j%-2%))) & X`009\ b$="`094C" if swap%(cvt$%(mid(job1$,21%,2%)))<0% if j%=2% & X X25320`009fnstate$=b$ & X`009\ fnend & X`009! This function returns the 2-character job state. & X`012 X X26000`009! Routine to parse command qualifiers & X`009! Entered with command$ set to the command line, flags%() undefined & X`009! Returns with qualifiers stripped, flags%() set appropriately, and & X`009! iam$ set to the originating user (if applicable). & X`009& X`009iam$="" & X`009! Initialize flags & X X26010`009i%=instr(1%,command$,"/") & X`009\ return if i%=0% & X`009\ restore & X`009\ j%=instr(i%+1%,command$,"/") & X`009\ k%=instr(i%+1%,command$," ") & X`009\ j%=32767% if j%=0% & X`009\ k%=32767% if k%=0% & X`009\ j%=k% if k% len(reqd$) & X`009\ goto 26030 if left(reqd$,len(command.1$)) <> command.1$ & X`009\ flags%(index%)=flags%(index%) or mask% & X`009\ goto 26010 & X`009! If this is the special /IAM qualifier, go process it specially. & X`009! Here we have a partial match for an asserted qualifier - see if the & X`009! rest matches. If not, exit. & X`009! otherwise, OR in the new qualifier bitmask & X`009! and go pick up another & X X26050`009reqd$=reqd$+mid(qual$,reqd%+2%,len(qual$)) & X`009\ goto 26030 if len(command.1$) > len(reqd$)+2% & X`009\ goto 26030 if left(reqd$,len(command.1$)-2%) <> mid(command.1$,3%, & X`009 len(command.1$)) & X`009\ flags%(index%)=flags%(index%) and (not(mask%)) & X`009\ goto 26010 & X`009! Here we have a partial match for a deasserted qualifier - see if the & X`009! rest matches. If not, exit. & X`009! otherwise, AND out the new qualifier bitmask & X`009! and go pick up another & X X26060`009command.1$=right(command.1$,6%) & X`009\ goto 26030 if right(command.1$,len(command.1$))<>'"' & X`009\ goto 26010 if accmod%=1% & X`009\ iam$=left(command.1$,len(command.1$)-1%) & X`009\ flags%(index%)=flags%(index%) or mask% & X`009\ goto 26010 & X`009! Make sure IAM is a quoted string. If not network access, just ig- & X`009! nore it. & X X26070`009! Data for qualifiers - format is qualifier, onmask, index & X`009& X`009data "IN*TERACTIVE",`0091,`0091, & X`009 "BA*TCH",`009`0092,`0091, & X`009 "SU*BPROCESS",`0090,`0090, & X`009 "NE*TWORK",`0094,`0091, & X`009 "SY*STEM",`0098,`0091, & X`009 "AL*L",`009`00915,`0091, & X`009 "H*ELP",`009`00916,`0091, & X`009 "V*ERSION",`00932,`0091, & X`009 "IAM=*",`009`00964,`0091, & X`009 "ME*SSAGE",`009128,`0091, & X`009 "J*OB",`009`0091,`0092, & X`009 "PI*D",`009`0091,`0092, & X`009 "PRO*CESSNAME",`0092,`0092, & X`009 "U*SERNAME",`0092,`0092, & X`009 "PP*N",`009`0094,`0092, & X`009 "PE*RSONALNAME",`0098,`0092, & X`009 "IM*AGENAME",`00916,`0092, & X`009 "TE*RMINAL",`00932,`0092, & X`009 "LOG*INTIME",`00964,`0092, & X`009 "C*PUTIME",`009128,`0092, & X`009 "ID*LETIME",`0090,`0092, & X`009 "ST*ATE",`009`009256,`0092, & X`009 "SI*ZE",`009`009512,`0092, & X`009 "LOC*ATION",`0091024,`0092, & X`009 "TT*TYPE",`0092048,`0092, & X`009 "SW*APPED",`0090,`0092, & X`009 "PRI*ORITY",`0094096,`0092, & X`009 "R*UNTIMESYSTEM", 8192,`0092, & X`009 "F*ULL",`009`00916383,`0092, & X`009 "BY*PASS",`0091,`0093, & X`009 "PL*AN",`009`0092,`0093, & X`009 "MA*IL",`009`0094,`0093, & X`009 "AR*EA",`009`0098,`0093, & X`009 "EOF",`009`0090,`0090 & X`012 X X27000`009! Routine to ship messages back to our caller & X`009& X`009goto 27010 if accmod%=3% & X`009\ print xlate(msg$,escfix$); & X`009\ return & X`009! Determine method. If local, just stuff it out to terminal & X X27010`009o.retcnt%=0% X27020`009field #11%, len(msg$) as buff11$ & X`009\ lset buff11$=msg$ & X`009\ a$=sys(chr$(6%)+chr$(22%)+chr$(-5%)+chr$(1%)+string$(6%,0%)+ & X`009 chr$(11%)+chr$(0%)+cvt%$(swap%(len(msg$)))+cvt%$(swap%(0%))+ & X`009 string$(4%,0%)+chr$(3%)+string$(13%,0%)+chr$(0%)+ & X`009 string$(5%,0%)) & X`009\ return & X`009! Remote, output it across the DECnet link. & X`012 X X28000`009! Entry point for issuing remote FINGER command & X`009& X`009a$=sys(chr$(6%)+chr$(-10%)+"FINREQ") & X`009\ call name & X`009\ open "NL:" as file #12%, recordsize 512% & X`009\ job%=peek(518%)/2% & X`009\ job$=mid(num1$(job%+100%),2%,2%) & X`009\ u.ppn$=cvt%$(peek(peek(peek(520%)+8%)+24%)) & X`009\ open "FINGER$:FINGER.DAT" for input as file #10%, & X`009 organization indexed, & X`009 recordsize 128%, & X`009 map indexf, & X`009 primary key ppn$, & X`009 alternate key username$, & X`009 mode 4352%, & X`009 access read, & X`009 allow modify & X`009\ user$=fnppntoname$(u.ppn$) & X`009\ close #10% & X X28010`009a$=sys(chr$(6%)+chr$(22%)+chr$(1%)+chr$(0%)+"FIN."+job$+ & X`009 string$(10%,0%)+chr$(117%)+chr$(12%)+string$(2%,0%)+ & X`009 chr$(255%)+chr$(1%)+string$(2%,0%)+chr$(1%)+string$(5%,0%)+ & X`009 chr$(1%)) & X`009! Declare Object 117 receiver as RIB #1 & X X28020`009msg$="["+node$+chr$(255%) & X`009\ gosub 27000 & X`009\ field #12, 172% as buff12$ & X`009\ lset buff12$=node$+string$(6%-len(node$),32%)+chr$(0%)+ & X`009 chr$(117%)+chr$(1%)+string$(17%,0%)+string$(146%,0%) & X`009! Prepare Connect Initiate message & X X28030`009a$=sys(chr$(6%)+chr$(22%)+chr$(-2%)+chr$(1%)+string$(6%,0%)+ & X`009 chr$(12%)+chr$(0%)+cvt%$(swap%(172%))+cvt%$(swap%(0%))+ & X`009 string$(8%,0%)+cvt%$(swap%(512%))+string$(8%,0%)+chr$(1%)+ & X`009 string$(5%,0%)) & X`009! Send Connect Initiate message on RIB #1 & X X28040`009i.retcnt%=0% X28050`009a$=sys(chr$(6%)+chr$(22%)+chr$(2%)+chr$(9%)+chr$(0%)+chr$(0%)+ & X`009 string$(4%,0%)+chr$(12%)+chr$(0%)+cvt%$(swap%(512%))+ & X`009 cvt%$(swap%(0%))+string$(10%,0%)+cvt%$(swap%(15%))+string$(6%,0%)+ & X`009 chr$(1%)+string$(5%,0%)) & X`009\ stat%=ascii(mid(a$,3%,1%)) & X`009\ reason%=swap%(cvt$%(mid(a$,23%,2%))) & X`009\ goto 28060 if stat%=253% & X`009\ erno%=256%+reason% & X`009\ goto 28120 if stat%=252% & X`009\ msg$=": link failed]"+chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ msg$=chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ msg$="?FINGER - Status code="+num1$(stat%)+", reason code="+ & X`009 num1$(reason%)+"."+chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ goto 28100 & X`009! Clear retry count and sleep waiting for a response. When we get a & X`009! response, look at status byte. If all is ok, proceed, else report & X`009! the error and bail out. & X X28060`009msg$=".DECnet]"+chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ goto 28070 if accmod%<>1% & X`009\ a$=sys(chr$(6%)+chr$(22%)+chr$(-19%)+chr$(1%)) & X`009\ a$=cvt$$(mid(a$,5%,6%),128%) & X`009\ command$=command$+'/IAM="'+user$+'`126'+a$+'"' & X`009! Print the connect message. Skip next if not originating node. Get & X`009! user's username from mail database. Get node name from DECnet. Tack & X`009! onto command line. & X X28070`009field #12%, len(command$)+2% as buff12$ & X`009\ lset buff12$=command$+chr$(13%)+chr$(10%) & X`009\ a$=sys(chr$(6%)+chr$(22%)+chr$(-5%)+chr$(1%)+string$(6%,0%)+ & X`009 chr$(12%)+chr$(0%)+cvt%$(swap%(len(buff12$)))+cvt%$(swap%(0%))+ & X`009 string$(4%,0%)+chr$(3%)+string$(13%,0%)+chr$(1%)) & X`009! Send the finger command to the remote node on RIB #1 & X X28080`009i.retcnt%=0% X28090`009a$=sys(chr$(6%)+chr$(22%)+chr$(2%)+chr$(9%)+chr$(0%)+chr$(0%)+ & X`009 string$(4%,0%)+chr$(12%)+chr$(0%)+cvt%$(swap%(512%))+ & X`009 cvt%$(swap%(0%))+string$(10%,0%)+cvt%$(swap%(15%))+ & X`009 string$(6%,0%)+chr$(1%)+string$(5%,0%)) & X`009\ goto 28100 if mid(a$,3%,1%)=chr$(248%) & X`009\ buflen%=swap%(cvt$%(mid(a$,13%,2%))) & X`009\ field #12, buflen% as buff12$ & X`009\ msg$=buff12$ & X`009\ gosub 27000 & X`009\ goto 28080 & X`009! Receive network data message. If it was link disconnect, go to & X`009! our exit routine, else report the message to the user and go & X`009! back for more. & X X28100`009a$=sys(chr$(6%)+chr$(22%)+chr$(0%)+chr$(0%)+string$(30%,0%)+ & X`009 chr$(1%)+string$(5%,0%)) & X`009! Remove our receiver & X X28110`009close #12% & X`009\ goto 32600 & X`009! Close and exit. & X X28120`009goto 28130 if (router$<>"" and node$<>router$ and & X`009 (erno%=6% or erno%=31% or erno%=258%)) & X`009\ msg$=": link failed]"+chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ msg$=chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ msg$="?FINGER - " & X`009\ msg.1$="Unknown error code "+num1$(erno%)+" at line "+num1$(erl)+ & X`009 " in job "+num1$(peek(518%)/2%) & X`009\ msg.1$="No such node defined" if erno%=6% or erno%=31% or erno%=258% & X`009\ msg.1$="Remote node is not currently reachable" if erno%=14% or & X`009 erno%=22% or erno%=259% or erno%=295% & X`009\ msg.1$="Network unavailable" if erno%=62% or erno%=66% & X`009\ msg.1$="No FINGER server" if erno%=260% & X`009\ msg.1$="Link timeout for node "+node$ if erno%=512% & X`009\ msg$=msg$+msg.1$+"."+chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ goto 28100 & X`009! If no such node, we have a router node, and router wasn't the node & X`009! we were trying for, re-issue command through router node & X`009! Construct a plausible error message and display it & X X28130`009a$=sys(chr$(6%)+chr$(22%)+chr$(-19%)+chr$(1%)) & X`009\ a$=cvt$$(mid(a$,5%,6%),128%) & X`009\ goto 28140 if a$<>router$ & X`009\ router$="" & X`009\ goto 28120 & X`009! Get local host node name, compare with router host node name to & X`009! prevent infinite looping. If same, zap router entry and go give & X`009! the regular error message after all & X X28140`009msg$=" via routing host "+router$+"]"+chr$(13%)+chr$(10%) & X`009\ gosub 27000 & X`009\ command$=command$+"@"+node$ & X`009\ node$=router$ & X`009\ goto 28020 & X`009! Re-issue command using routing host & X`012 X X29000`009! Network entry point & X`009& X`009a$=sys(chr$(6%)+chr$(-10%)+"FINSRV") & X`009\ call name & X`009\ open "NL:" as file #11%, recordsize 512% & X`009\ on error goto 32000 & X`009\ job%=peek(518%)/2% & X`009\ job$=mid(num1$(job%+100%),2%,2%) & X`009! Change our program name to indicate server. & X X29010`009a$=sys(chr$(6%)+chr$(22%)+chr$(1%)+chr$(0%)+"FIN$"+job$+ & X`009 string$(10%,0%)+chr$(117%)+chr$(12%)+chr$(0%)+chr$(0%)+ & X`009 chr$(255%)+chr$(1%)+string$(2%,0%)+chr$(1%)+string$(5%,0%)+ & X`009 chr$(0%)) & X`009! Declare object 117 receiver & X X29020`009a$=sys(chr$(7%)) & X X29030`009a$=sys(chr$(6%)+chr$(22%)+chr$(2%)+chr$(9%)+chr$(0%)+ & X`009 chr$(0%)+string$(4%,0%)+chr$(11%)+chr$(0%)+ & X`009 cvt%$(swap%(512%))+cvt%$(swap%(0%))+string$(10%,0%)+ & X`009 cvt%$(swap%(10%))+string$(6%,0%)+chr$(0%)+string$(7%,0%)) & X`009\ cim.lla%=swap%(cvt$%(mid(a$,5%,2%))) & X`009! Receive a [connect initiate] message, extract the parts we need & X X29040`009a$=sys(chr$(6%)+chr$(22%)+chr$(-3%)+chr$(1%)+ & X`009 cvt%$(swap%(cim.lla%))+string$(4%,0%)+chr$(0%)+chr$(0%)+ & X`009 cvt%$(swap%(0%))+cvt%$(swap%(0%))+string$(8%,0%)+ & X`009 cvt%$(swap%(512%))+string$(14%,0%)) & X`009! Send connect confirm message & X X29050`009i.retcnt%=0% X29060`009a$=sys(chr$(6%)+chr$(22%)+chr$(2%)+chr$(9%)+chr$(0%)+ & X`009 chr$(0%)+string$(4%,0%)+chr$(11%)+chr$(0%)+ & X`009 cvt%$(swap%(512%))+cvt%$(swap%(0%))+string$(10%,0%)+ & X`009 cvt%$(swap%(10%))+string$(6%,0%)+chr$(0%)+string$(7%,0%)) & X`009\ field #11%, swap%(cvt$%(mid(a$,13%,2%)))-2% as buff11$ & X`009\ command$=cvt$$(buff11$,128%) & X`009\ accmod%=3% & X`009\ goto 31000 & X`009! Receive network data message containing finger command & X`012 X X30000`009! CCL entry point & X`009& X`009on error goto 32000 & X`009\ a$=sys(chr$(6%)+chr$(-7%)) & X`009\ command$=sys(chr$(7%)) & X`009\ accmod%=1% & X`009\ goto 31000 & X`009! Set up error trap & X`009! Set up `094C trap & X`009! Get command line from local user and go to command processing code & X X31000`009! Initial command processing & X`009& X`009version$="RSTS/E Finger: Version V1.1-08 of 14-Sep-1989" & X`009\ bypass$="........."+chr$(9%)+chr$(10%)+".."+chr$(13%)+ & X`009 ".................. !"+chr$(34%)+"#$%&'()*+,-./"+ & X`009 "0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ" + & X`009 "[/]`094_`096abcdefghijklmnopqrstuvwxyz`123`124`125`126." & X`009\ escfix$="." & X`009\ escfix$=escfix$+chr$(i%) for i%=1% to 13% & X`009\ escfix$=escfix$+chr$(142%)+chr$(143%) & X`009\ escfix$=escfix$+chr$(i%) for i%=16% to 26% & X`009\ escfix$=escfix$+chr$(155%) & X`009\ escfix$=escfix$+chr$(i%) for i%=28% to 31% & X`009\ escfix$=escfix$+right(bypass$,33%) & X`009\ tttabl$="UnknownLA36 VT52 VT55 LA180S VT100 LA120 LA12 "+ & X`009 "LA100 LA34 LA38 LA50 VT101 VT102 VT125 VT131 "+ & -+-+-+-+-+ End of part 4 +-+-+-+-+-