%conststring (17) vsn = "Info Poll....2b " #datestring #timestring !******************************** !* emas-2900 fep info server * !* file: fpt3s/fpt3y * !* * !******************************** ! Options used:X25_INFOPS,INFOPS,X,E,M,CLEAN ! prep versions are:- ! ! %control 1 %include "deimosperm" %begin %recordformat lev3f(%bytearray reserved(0:7), %bytearray a(0:241)) %recordformat mef(%record (mef) %name link, %c %byteinteger len, type, (%record (lev3f)lev3 %or %c %bytearray params(0:231))) %recordformat pe(%byteinteger ser, reply, %c (%integer a, b, (%integer c %or %byte c1, c2) %or %byte fn, a2, %c (%record(mef)%name mes, %byte gate port, task port %or %c %string (3) facility))) %recordformat qf(%record (mef) %name e) !******************************************************** !* upper level (itp&info) handler messages to gate !************************************************************ %include "b_ygatecalls" !************************************************************** !* buffer manager calls (from and to) * !************************************************************** ! %constinteger buffer here = 0 !********** to buffer manager *********** %constinteger request buffer = 0 %constinteger release buffer = 1 !************************************************************** !********** various service numbers ************* %constinteger gate ser = 24 %constinteger buffer manager = 17 %constinteger t3 ser = 21 %routinespec free buffer(%record (mef) %name mes) %routinespec trigger next(%record (mef) %name mes) %routinespec pack(%record(mef) %name mes, %string (63) fac) %string (127) %fnspec unpack(%record (mef) %name mes, %integer no) %routinespec to gate(%integer fn, %record (mef) %name mes, %c %integer flag) !****************************************************** %record (pe) p %owninteger con sub id reply = 1; ! picks up from actual mess !* * * * * * * * * * * * * * * * * * %ownrecord (mef) %name mes %owninteger mon = 0; ! monitoring flag (set to 'P') %owninteger fn = 0, state = 0 %integer d1, d2 %ownstring (63) s, t %constinteger max = 90 %owninteger add pt = 0 %ownstring (15) %array add(1:max) = "15000001", "15000002", "15000003", "15000004", "15000005", "15000006", "15000007.LOCAL", "15000008", "15000009", "15000010", "15000011", "15000012", "15000013", "15000014", "15000015", "15000016", "15000017", "15000018", "15000019", "15000020", "15000021", "15000022", "15000023", "15000024", "15000025", "15000026", "15000027", "15000028", "15000029", "15000030", "15000031", "15000032", "15000033", "15000034", "15000035", "15000036", "15000037", "16000001", "16000002", "16000003", "16000004", "16000005", "16000006", "16000007", "16000008", "16000009", "16000010", "16000011", "16000012", "16000013", "16000014", "16000015", "16000016", "16000017", "16000018", "16000019", "16000020", "16000021", "16000022", "16000023", "16000024", "00000001", "00000003", "00000004", "00000005", "00000006", "00000007", "00000008", "71000001", "71000002", "71000003", "71000004", "71000005", "71000006", "71000007", "71000008", "71000009", "71000010", "71000011", "71000012", "71000013", "71000014", "71000015", "71000016", "71000017", "71000018", "71000019", "71000020", "15000007.TCPS", "15000007.2972-4" ! l o g g i n g o n %integer i !********************************************** !* initialisation * !********************************************** i = map virt(buffer manager, 5, 4); ! map buff man stack to seg 4 i = map virt(buffer manager, 6, 5) printstring(vsn) printstring(datestring); newline alarm(50) s = "15000000" p_ser = buffer manager; p_reply = id p_fn = request buffer ponoff(p) trigger next(P_mes) p_ser = buffer manager; p_reply = id %cycle p_ser = 0; poff(p) %if p_reply = 0 %start; ! clock tick alarm(50) %if 'M' <= int <= 'P' %start mon = int-'O'; int = 0 %finish %continue %finish mes == p_mes fn = p_fn %if mon # 0 %start printstring("From Gate, fn="); write(fn, 1) printstring(", G Port ="); write(p_gate port, 1) printstring(", T Port ="); write(p_task port, 1) printstring(", Flag ="); write(p_a2, 1) newline %finish %if fn = accept call %start first response: t = unpack(mes, 3) printstring(add(add pt)); spaces(2) write(p_a2, 1) d1 = mes_lev3_reserved(2); d2 = mes_lev3_reserved(3) write(d1, 3); write(d2, 3) %if fn = disconnect %then newline %and -> next free buffer(mes) state = 1 %continue %finish %if fn = input here %start t = string(addr(mes_lev3_a(0))) %if length(t) > 2 %start %if length(string(addr(t)+1)) first response -> next %finish %if fn = reset %then -> disc it free buffer(mes) %unless mes == null %repeat %routine free buffer(%record (mef) %name mes) %record (pe) p p_ser = buffer manager; p_reply = own id !! queue it if it is a long buffer p_fn = release buffer; p_mes == mes pon(p) %end %routine trigger next(%record (mef) %name mes) mes_len = 0 add pt = add pt+1 p_task port = add pt %if add pt > max %start free buffer(mes) p_ser = 0; poff(p); ! catch the timer %stop %finish pack(mes, add(addpt).".INFO") pack(mes, "") pack(mes, "") to gate(Connect, mes, 0) %end %string (127) %fn unpack(%record (mef) %name mes, %integer no) %integer i, l %unless mes == null %or mes_len<=0 %or no<=0 %start l = 0 %while no>1 %cycle l=l+mes_params(l)+1 no = no-1 %repeat %result = string(addr(mes_params(l))) %finish %else %result = "" %end %routine pack(%record(mef) %name mes, %string (63) s) string(addr(mes_params(mes_len))) = s mes_len = mes_len+length(s)+1 %end %routine crunch printstring("Info - crashed ") *=k'104001'; ! emt wait %end %routine to gate(%integer fn, %record (mef) %name mes, %c %integer flag) %if mon # 0 %start select output(0); printstring("To gate:"); write(fn, 1) printstring(", Gate Port"); write(p_gate port, 1) printstring(", Flag"); write(flag, 1); newline select output(0) %finish %if addr(mes)&k'140000'=k'140000' %or addr(mes)&k'77'#0 %then crunch p_ser = gate ser; p_reply = own id p_fn = fn %if int = 'A' %start free buffer(p_mes) %stop %finish p_mes == mes; p_a2 = flag pon(p) %end %endofprogram