Source file: LOOP#IMP Compiled: 30-MAY-1984 16.05.57 Object file: J#REL Edinburgh IMP77 Compiler - Version 8.2 release 3 1 %control 1 2 3 4 !******************************************** 5 !* * 6 !* Gateway Testing Module * 7 !* * 8 !* LOOP * 9 !* * 10 !* Version 9.07 07 May 1984 * 11 !* * 12 !******************************************** 13 14 %begin 15 ! Options used:T#L,LOOP#IMP,G 16 ! #datestring 17 !#if g(=true) 18 %include "ercm06.inc_configglas" & 0 ! Configuration file for Glasgow & 1 & 2 ! Options used:INC_CONFIGGEN,TEMP,G,CLEAN & 3 %conststring (8) datestring="25/04/84" & 4 & 5 !Versions required: & 6 & 7 & 8 ! System Name Accred Nets Procs* Disc Drv Prep & 9 & 10 ! P PSSE PSSE Yes 2+1 16 6 10 RL01 0 P & 11 ! M XGATE XGATE No 1+1 37 20 40 RL01 0 M & 12 ! K Kent GATE Yes 1+1 16 6 10 RL02 0 K & 13 ! U Kent #2 SGATE Yes 1+2 ?? ?? ?? RK05 0 U & 14 ! G Glasgow GGATE No 1+2 16 6 31 RX02 1 G & 15 ! F FEP (GATEX) - No +2 60 20 40 - - H & 16 & 17 !Disc Configuration Information & 18 !Define first and last user blocks to prevent us overwriting directory & 19 !etc. Ranges for various discs are: & 20 !RK05: 400 - 10767. RL01: 400 - 21757. RX02: 241 - 1750. (octal) & 21 & 22 %constinteger drive = 0 & 23 %constinteger fsys = 8_33 & 24 %constinteger lub = 8_241 & 25 %constinteger hub = 8_1750 & 26 %constinteger blocksize = 512 & 27 %constinteger maxblocks = 128 & 28 !maxblocks is largest Acct/Help/Alert/Name/Mnemonic file & 29 & 30 !NSI ports and facility numbers & 31 !Set Gateport 2 = Gateport 1 if only 1 ring/NSI gateway & 32 !Nothing terrible will happen if you get these wrong - Source addresses & 33 !will not be correctly interpreted in the USERS ALL command etc is all & 34 & 35 %constinteger gate port 1 = 11 ;!Ring port of Ring - NSI Gateway & 36 %constinteger gate port 2 = 12 ;!2nd ring/NSI Gateway & 37 & 38 !X25 Level 3 options & 39 & 40 %constinteger max l3 packet = 256 ;!Max Level 3 packet size in bytes & 41 & 42 !Procs, TSB procs, LCNs & 43 & 44 %constinteger no of procs = 16 ;!No of simultaneous users & 45 %constinteger no of tsb procs = 6 & 46 %constinteger no of lcns = 31 ;!No of X25 LCNs subscribes to & 47 & 48 %constinteger no of nets = 2 & 49 %constinteger no of x25 nets = 1 & 50 %constinteger sercline = 0 & 51 %constinteger pssline = 1 & 52 %constinteger rcoline = 2 & 53 %constinteger no of rco nets = 1 & 54 %conststring (5) sysname = "GGATE" & 55 %conststring (7) syspass = "YAHOO" & 56 %conststring (4) %array longnetname(-1:2) = "????","X25 ","????","RCO " & 57 %conststring (1) %array shortnetname(-1:2) = "?","X","?","R" & 58 & 59 ! & 60 ! Other things that need to be altered & 61 ! & 62 & 63 ! The text "RCONET" in the welcome message in BRIDGE & 64 ! The text "PSSE/" in the Command: prompt in BRIDGE & 65 & 66 %endoffile 19 !#else(=false) 20 {%include "ercm06.inc_minconf"} 21 !#fi 22 %include "ercm06.inc_various" & 0 !Various useful consts etc & 1 & 2 %CONSTINTEGER TRUE = 1 & 3 %CONSTINTEGER FALSE = 0 & 4 %CONSTINTEGER CR = 13 & 5 %CONSTINTEGER LF = 10 & 6 & 7 !Buffer Manager Consts & 8 & 9 %CONSTINTEGER LONG = 0 & 10 %CONSTINTEGER SHORT = 1 & 11 %CONSTINTEGER REQUEST BUFFER = 0 & 12 %CONSTINTEGER RELEASE BUFFER = 1 & 13 & 14 %CONSTBYTENAME TT SER == K'160061' & 15 %constbytename id == k'160030' & 16 %CONSTBYTENAME OWN ID == K'160030' & 17 %CONSTBYTENAME INT == K'160060' & 18 %CONSTINTEGERNAME NO OF BUFF == K'100112' & 19 %CONSTINTEGERARRAYNAME BMS == K'100112' ;!Buffer Manager Statistics & 20 %CONSTBYTENAME CHANGE OUT ZERO == K'160310' & 21 & 22 !*Standard stream numbers & 23 ! & 24 %CONSTINTEGER DOC INPUT CR = 12 & 25 %CONSTINTEGER DOC INPUT PR = 13 & 26 %CONSTINTEGER LP STREAM = 4 & 27 %CONSTINTEGER ITP STREAM = 18 & 28 %CONSTINTEGER INFO STREAM = 21 & 29 %CONSTINTEGER TIME STREAM = 22 & 30 %CONSTINTEGER FTP STREAM = 16 & 31 & 32 %ENDOFFILE 23 %include "ercm06.INC_FORMATS" & 0 %constinteger hdrl = 8 ;!Length of dummy area before data field & 1 %recordformat qf(%record (qf) %name link, %integer count) & 2 %recordformat ts29f(%string (255) s %or %byte octet1 %or %bytearray a(0:255)) & 3 %recordformat itpf(%byte cnsl, hb2, hb3, (%string(255) s %or %bytearray a(0:255))) & 4 %recordformat x25f(%byte octet1, lcn, fn, %bytearray a(0:255)) & 5 %recordformat mef(%record (mef) %name link, %byte l,type, %c & 6+ (%bytearray a(0:251) %c & 7+ %or (%string(4) padding, %byte octet1, lcn, fn ,(%bytearray data(0:243) %or %record (itpf) itp %or %record (ts29f) ts29)) %c & 8+ %or %string(250) s )) & 9 %recordformat pf(%byte ser, reply, %c & 10+ ((%byte fn, (%byte s1 %or %byte process), ((%record (mef) %name m, (%byte gate port %or %byte len), %byte task port) %or %string(3) facility)) %c & 11+ %or (%byte a1, a2, b1, b2, c1, c2) %or (%integer a, b, c))) & 12 & 13 %recordformat cvf((%byte l, (%byte reason, cause, diags, %bytearray our ct(0:3), our segs(0:7),pss ct(0:3), pss segs(0:7)) %c & 14+ %or %bytearray a(0:26)) %c & 15+ %or %string(27) s) & 16 & 17 %endoffile 24 %include "ercm06.INC_XGTFNS" & 0 !New X-25 Gate to task Interface - extended set to include Accounting & 1 !Functions: & 2 & 3 !Accounting Functions: & 4 %constinteger accredit user pass = 40 & 5 %constinteger process command = 41 & 6 %constinteger accredit reply = 42 & 7 %constinteger command reply = 43 & 8 %constinteger log call start = 44 & 9 %constinteger checkpoint = 45 & 10 %constinteger log call end = 46 & 11 %constinteger end call reply = 46 & 12 %constinteger hello = 47 & 13 %constinteger abort session = 48 & 14 %constinteger broadcast = 49 & 15 %constinteger goodbye = 50 & 16 %constinteger log session end = 51 & 17 %constinteger noticeboard = 52 & 18 & 19 !Transport Functions: & 20 %constinteger connect = 1 & 21 %constinteger accept call = 2 & 22 %constinteger disconnect = 3 & 23 %constinteger enable input = 4 & 24 %constinteger enable output = 4 & 25 %constinteger put output = 5 & 26 %constinteger input here = 5 & 27 %constinteger expedited data = 6 & 28 %constinteger reset = 7 & 29 %constinteger datagram = 8 & 30 %constinteger datagram reply = 9 & 31 & 32 %constinteger enable facility = 10 & 33 %constinteger disable facility = 11 & 34 %constinteger put control output = 12 & 35 %constinteger control input here = 12 & 36 %constinteger control data = 12 & 37 & 38 %constinteger ack = 4 & 39 %constinteger data = 5 & 40 %constinteger prod = 21 & 41 %constinteger poke = 22 & 42 %constinteger no goaheads = 23 & 43 & 44 %endoffile 25 %include "ercm06.INC_SERS" & 0 !PSS Gateway Service Numbers & 1 & 2 !DEIMOS hardware driver sers etc & 3 ! 1 tty #1 & 4 ! 2 CLI & 5 ! 3 DK & 6 ! 4 DIRT & 7 ! 5 LOAD & 8 ! 6 TU16 (-5) & MOTH & 9 ! 8 Big disc #1 - ERTE Big disc handler BDKH & 10 ! 9 Big Disc #1 DIR & 11 !11 DQS11S (KMC/DU11) & 12 !12 LP & 13 !13 LP #2 ? & 14 !17 Spool & 15 !18 SPCI & 16 !19 tty #2 & 17 !20 CLI #2 & 18 !21 tty #3 & 19 !22 CLI #3 & 20 !23 CR & 21 !24 GP & 22 !25 PR & 23 !28 Big Disc #2 (DIRT) & 24 !29 Big Disc #2 DIR & 25 & 26 !Globally accepted Services: & 27 %constinteger buffer manager = 17 & 28 %constinteger t3 ser = 21 ;!Buffered tty I/O & 29 %constinteger gate ser = 16 ;!NSI Level 3 handler & 30 !%CONSTINTEGER FROM PROT = 10 ;!HDLC level 2 handler (No. Used by Gate) & 31 & 32 !Gateway Specials: & 33 %constinteger test ser = 23 ;!Not a DEIMOS Ser. Note clash with pcmc & 34 %constinteger tsb ser = 19 ;!Transport Service Bridge & 35 !! %constinteger ftp ser = 19 & 36 %constinteger gatex ser = 24 & 37 %constinteger kernel ser = 11 & 38 %constinteger from xprot = 11 & 39 %constinteger loop ser = 20 & 40 %constinteger loopb ser = 18 ;!Not a DEIMOS Ser. & 41 %constinteger rloop ser = loop ser & 42 %constinteger glue ser = 26 & 43 %constinteger pcma ser = 22 & 44 %constinteger pcmb ser = 25 & 45 %constinteger pcmc ser = 23 & 46 %constinteger pcmd ser = 23 ;!Note clash with pcmc & 47 %constinteger bridge ser = 29 & 48 %constinteger account ser = 27 & 49 %constinteger time ser = 28 ;!Not a DEIMOS Ser & 50 %constinteger pftp ser = 21 ;!Not a DEIMOS Ser & 51 & 52 %endoffile 26 %include "ercm06.INC_EXTS" & 0 !Commonly Used Externals & 1 & 2 %externalroutinespec alarm(%integer ticks) & 3 %externalroutinespec linkin(%integer ser) & 4 %externalintegerfnspec dup addr(%integer seg) & 5 %externalintegerfnspec map abs(%integer adr, len, req id) & 6 %externalroutinespec map hwr(%integer seg) & 7 %externalintegerfnspec get id & 8 %externalroutinespec map virt(%integer ser,seg1,seg2) & 9 %externalroutinespec set prio(%integer n) & 10 %externalroutinespec pon(%record (*) %name p) & 11 %externalroutinespec ponoff(%record (*) %name p) & 12 %externalroutinespec poff(%record (*) %name p) & 13 & 14 %endoffile 27 %owninteger our ser = loop ser 28 %constinteger sync = 0 29 %constinteger ring = 1 30 31 %constinteger user = 1 32 %constinteger server = 0 33 34 %constinteger call reply = 3 35 %constinteger close call = 6 36 %constinteger abort call = 7 37 %constinteger open call = 8 38 %constinteger new open call = 10 39 40 %constinteger incoming call = 2 41 %constinteger input recd = 3 42 %constinteger output transmitted = 4 43 %constinteger call closed = 5 44 %constinteger call aborted = 6 45 %constinteger open reply a = 7 46 %constinteger open reply b = 8 47 %constinteger message = 9 48 49 %owninteger buffers held, users = 0 50 %constrecord (*) %name null == 0 51 %owninteger linetype = ring 52 53 %recordformat mefl(%record (mefl) %name link, %byte len, type, (%byte fn, sufl, st, ss, sn, dn, dt, ds, %c 54+ flag, uflag) %or (%integer sterm, prt, ssc, rp, fac, term, node)) 55 %ownrecord (mefl) %name mesl 56 %routinespec free buffer(%record (mefl) %name mesl) 57 %record (mefl) %mapspec get z buffer 58 %routinespec to upper(%record (mefl) %name mesl, %integer fn, %integer side) 59 %routinespec from glue 60 %routinespec handle clock tick ;! 07/05/84 61 %routinespec handle interrupt ;! 07/05/84 62 63 %integer other side, process 64 %byte i 65 %ownrecord (pf) p 66 67 poff(p) 68 %if 10 <= p_fn <= 29 %then our ser = p_fn 69 linkin(our ser) 70 map virt(buffer manager,6,5) 71 map virt(buffer manager,5,4) 72 73 ! This module handles three distinct types of loopback. 74 75 ! We identify ourself to Account twice, under our id and service number. 76 ! calls sent to our ser (= id) will be looped back to the sender. 77 ! calls sent to loopb ser (= loop ser) will be looped between Bridge and TSB. 78 ! calls originating from glue will be looped back to glue under the old gate/task 79 ! interface 80 81 p_ser = account ser 82 p_fn = hello 83 84 p_reply = id 85 p_s1 = our ser 86 pon(p) 87 88 p_reply = our ser 89 p_s1 = loopb ser 90 pon(p) 91 alarm(100) ;! for servicing interrupts 07/05/84 92 93 printstring("Loop Version 9.07 07 May 1984");newline 94 ! printstring("Loop") ;write(our ser,1) ;printstring(" Running") ;newline 95 96 %cycle 97 p_ser = 0 98 poff(p) 99 %if p_reply = glue ser %start 100 from glue 101 102 %elseif p_reply = 0 ;! 07/05/84 103 handle clock tick 104 105 %else 106 %if p_fn = poke %start 107 p_b = users ;p_c = buffers held 108 i = p_ser ;p_ser = p_reply ;p_reply = i 109 110 %elseif p_ser = id 111 p_ser = p_reply ;p_reply = id 112 113 %else 114 %if p_reply = bridge ser %then p_ser = tsb ser %else p_ser = bridge ser 115 p_reply = our ser 116 117 %finish 118 119 i = p_task port ;p_task port = p_gate port ;p_gate port = i 120 pon(p) 121 %finish 122 %repeat 123 124 %routine from glue 125 %byte fn, s 126 mesl == p_m 127 fn = p_fn 128 129 %if fn = open call %or fn = new open call %start 130 process = p_process 131 users = users + 1 132 %if linetype = sync %start 133 s = p_b1 134 p_c2 = process << 1 135 %else 136 s = p_c2 ;! equiv. to. p_term 137 p_b1 = process << 1 138 %finish 139 140 p_c2 = 1 ;!Successful 141 to upper(null, open reply a, user) 142 %if fn = open call %then mesl == get z buffer %else buffers held = buffers held + 1 143 144 %if linetype = sync %start 145 mesl_sn = 0 ;mesl_st = 0 146 mesl_ds = s 147 %else 148 p_c2 = s 149 p_len = 0 150 mesl_flag = x'0202' 151 %finish 152 153 to upper(mesl, incoming call, server) ;buffers held = buffers held - 1 154 155 %else 156 157 process = p_process >> 1 158 other side = p_process & 1 159 160 %if fn = put output %start 161 to upper(mesl, input recd, other side) 162 163 %elseif fn = enable input 164 to upper(null, output transmitted, other side) 165 166 %elseif fn = call reply 167 buffers held = buffers held + 1 168 %if p_c2 = 0 %then p_c2 = 1 %and users = users - 1 %else p_c2 = 0 169 !call reply: 0 = reject #0 = OK 170 !open rpy b: 0 = OK #0 = reject 171 free buffer(mesl) 172 to upper(null, open reply b, other side) 173 174 %elseif fn = close call 175 to upper(null, call closed, other side) ;users = users - 1 176 177 %elseif fn = abort call 178 to upper(null, call aborted, other side) ;users = users - 1 179 180 %elseif fn = call closed 181 to upper(null, close call, other side) 182 183 %elseif fn = call aborted 184 to upper(null, abort call, other side) 185 186 %else 187 188 %finish 189 190 %finish 191 %end 192 193 194 %routine free buffer(%record (mefl) %name mesl) 195 %unless mesl == null %start 196 p_ser = buffer manager 197 p_reply = id 198 p_fn = release buffer 199 p_m == mesl 200 pon(p) ;buffers held = buffers held - 1 201 %finish 202 %end 203 204 %record (mefl) %map get z buffer 205 !This routine guarantees to find a buffer. If it finds one in the 206 !pool, it returns with it. If not, it requests one from Buffer Manager 207 !and waits for it. 208 209 %record (pf) p 210 211 p_ser = buffer manager ;p_reply = id 212 p_fn = request buffer 213 p_len = 0 ;!Always a long buffer 214 ponoff(p) 215 buffers held = buffers held + 1 216 p_m_l = 0 ;!Zero it for benefit of packing routines 217 %result == p_m 218 %end ;!of Get Buffer 219 220 221 %routine to upper(%record (mefl) %name mesl, %integer fn, %integer side) 222 p_ser = glue ser 223 p_reply = loop ser 224 p_fn = fn 225 p_process = process<<1 226 p_process = p_process + 1 %if side = server 227 %if fn = open reply a %start 228 p_b1 = p_process 229 p_process = process 230 %finishelse p_m == mesl 231 pon(p) 232 %end 233 234 %routine handle clock tick ;! 07/05/84 235 %if int # 0 %then handle interrupt 236 ! don't require to do anything else for the moment 237 alarm(100) 238 %end 239 240 %routine handle interrupt ;! 07/05/84 241 %if int = 'V' %start ;! Version number required 242 printstring("Loop Running");newline 243 %elseif int = '?' ;! query processes 244 printstring("Buffers held = ") 245 write(buffers held,2) 246 newline 247 ! not worked out the rest of this yet 248 %finish 249 int = 0 250 %end 251 252 %endofprogram ?MESSAGE unused ?SETPRIO unused ?GETID unused ?MAPHWR unused ?MAPABS unused ?DUPADDR unused ?PFTPSER unused ?TIMESER unused ?PCMDSER unused ?PCMCSER unused ?PCMBSER unused ?PCMASER unused ?RLOOPSER unused ?FROMXPROT unused ?KERNELSER unused ?GATEXSER unused ?TESTSER unused ?GATESER unused ?T3SER unused ?NOGOAHEADS unused ?PROD unused ?DATA unused ?ACK unused ?CONTROLDATA unused ?CONTROLINPUTHERE unused ?PUTCONTROLOUTPUT unused ?DISABLEFACILITY unused ?ENABLEFACILITY unused ?DATAGRAMREPLY unused ?DATAGRAM unused ?RESET unused ?EXPEDITEDDATA unused ?INPUTHERE unused ?ENABLEOUTPUT unused ?DISCONNECT unused ?ACCEPTCALL unused ?CONNECT unused ?NOTICEBOARD unused ?LOGSESSIONEND unused ?GOODBYE unused ?BROADCAST unused ?ABORTSESSION unused ?ENDCALLREPLY unused ?LOGCALLEND unused ?CHECKPOINT unused ?LOGCALLSTART unused ?COMMANDREPLY unused ?ACCREDITREPLY unused ?PROCESSCOMMAND unused ?ACCREDITUSERPASS unused ?CVF unused ?X25F unused ?HDRL unused ?FTPSTREAM unused ?TIMESTREAM unused ?INFOSTREAM unused ?ITPSTREAM unused ?LPSTREAM unused ?DOCINPUTPR unused ?DOCINPUTCR unused ?CHANGEOUTZERO unused ?BMS unused ?NOOFBUFF unused ?OWNID unused ?TTSER unused ?SHORT unused ?LONG unused ?LF unused ?CR unused ?FALSE unused ?TRUE unused ?SHORTNETNAME unused ?LONGNETNAME unused ?SYSPASS unused ?SYSNAME unused ?NOOFRCONETS unused ?RCOLINE unused ?PSSLINE unused ?SERCLINE unused ?NOOFX25NETS unused ?NOOFNETS unused ?NOOFLCNS unused ?NOOFTSBPROCS unused ?NOOFPROCS unused ?MAXL3PACKET unused ?GATEPORT2 unused ?GATEPORT1 unused ?MAXBLOCKS unused ?BLOCKSIZE unused ?HUB unused ?LUB unused ?FSYS unused ?DRIVE unused ?DATESTRING unused