(FILECREATED " 9-AUG-83 16:47:12" {PHYLUM}<LISPCORE>SOURCES>LLETHER.;18 176165Q changes to: (VARS LLETHERCOMS) (MACROS \BLTLOCALHOSTNUMBER) previous date: " 7-AUG-83 01:14:26" {PHYLUM}<LISPCORE>SOURCES>LLETHER.;17) (* Copyright (c) 1982, 1983 by Xerox Corporation) (PRETTYCOMPRINT LLETHERCOMS) (RPAQQ LLETHERCOMS [[COMS (* Stuff which should be somwhere else!) (INITVARS (ERRORMESSAGESTREAM T) (PROMPTWINDOW T)) (GLOBALVARS ERRORMESSAGESTREAM PROMPTWINDOW) (COMS (* Queue management for data which can be chain-linked through the first cell) (DECLARE: DONTCOPY (EXPORT (RECORDS SYSQUEUE QABLEITEM) (MACROS \QUEUEHEAD))) (INITRECORDS SYSQUEUE) (SYSRECORDS SYSQUEUE) (FNS \ENQUEUE \DEQUEUE \QUEUELENGTH \ONQUEUE \UNQUEUE) (* Queue management constructed by TCONC) (EXPORT (MACROS \DETCONC \ENTCONC \PEEKTCONC] (COMS (* General packet management) (DECLARE: DONTCOPY (EXPORT (* * Skeletal ether packet. Other users define with respect to) (RECORDS ETHERPACKET ETHERAUX) (CONSTANTS \EPT.PUP \3MBTYPE.PUP \10MBTYPE.PUP \EPT.XIP \3MBTYPE.XIP \10MBTYPE.XIP \EPT.10TO3 \3MBTYPE.10TO3 \EPT.UNKNOWN)) (GLOBALVARS \FREE.PACKET.QUEUE)) (INITRECORDS ETHERPACKET) (FNS \ALLOCATE.ETHERPACKET \RELEASE.ETHERPACKET RELEASE.PUP \FLUSH.PACKET.QUEUE \REQUEUE.ETHERPACKET \EP.PUT.AUX) (INITVARS (\FREE.PACKET.QUEUE (NCREATE (QUOTE SYSQUEUE))) (\NEWPACKETCOUNTER 5))) [COMS (DECLARE: DONTCOPY (EXPORT (RECORDS NSADDRESS NSHOSTNUMBER) (MACROS LOADNSHOSTNUMBER STORENSHOSTNUMBER \MOVENSADDRESSES \SWAPNSADDRESSES) (CONSTANTS (\#WDS.NSADDRESS 6) (\#WDS.NSHOSTNUMBER 3)) (MACROS \LOCALNSHOSTNUMBER \LOCALNSNETNUMBER \LOCALNSADDRESS EQNSHOSTNUMBER \BLTLOCALHOSTNUMBER) (GLOBALVARS BROADCASTNSHOSTNUMBER \MY.NSADDRESS \MY.NSHOSTNUMBER \MY.NSNETNUMBER))) (INITRECORDS NSADDRESS) (INITVARS (\MY.NSHOSTNUMBER NIL) (\MY.NSNETNUMBER NIL) (\MY.NSADDRESS NIL)) (VARS BROADCASTNSHOSTNUMBER) (FNS \SETLOCALNSNUMBERS \LOADNSADDRESS \STORENSADDRESS \PRINTNSADDRESS \NSADDRESS.DEFPRINT \LOADNSHOSTNUMBER \STORENSHOSTNUMBER PRINTNSHOSTNUMBER) (P (DEFPRINT (QUOTE NSADDRESS) (QUOTE \NSADDRESS.DEFPRINT] [COMS (* Assorted Level 0) (FNS \ETHERINIT \ETHEREVENTFN \SETETHERFLAGS \FLUSHNDBS \FLUSH.NDB.QUEUE) (FNS \CHECKSUM \HANDLE.RAW.OTHER \FEED.ETHER.OUTPUT \HANDLE.RAW.PACKET \ADD.PACKET.FILTER \DEL.PACKET.FILTER) (DECLARE: DONTCOPY (EXPORT (CONSTANTS (\NULLCHECKSUM 177777Q))) (GLOBALVARS \NETOUTQUEUE \PACKET.FILTERS \ETHERLIGHTNING)) (INITVARS (\NETOUTQUEUE (NCREATE (QUOTE SYSQUEUE))) (\PACKET.FILTERS NIL) (\ETHERLIGHTNING)) (DECLARE: DONTEVAL@LOAD DOCOPY (P (\ETHERINIT) (MOVD? (QUOTE NILL) (QUOTE BLOCK] (COMS (* Assorted routing stuff) (DECLARE: DONTCOPY (RECORDS NDB ROUTING) (CONSTANTS \RT.INFINITY) (MACROS ENCAPSULATE.ETHERPACKET TRANSMIT.ETHERPACKET BROADCASTP .RTLOOKUP.) (GLOBALVARS \RT.TIMEOUTINTERVAL \RT.AGEINTERVAL \RT.PURGEFLG) (GLOBALVARS \3MBFLG \10MBFLG \3MBLOCALNDB \10MBLOCALNDB \LOCALNDBS \NSFLG)) (INITRECORDS NDB) (SYSRECORDS NDB) (FNS \AGE.ROUTING.TABLE \FLUSH.ROUTING.TABLE PRINTROUTINGTABLE) (FNS ENCAPSULATE.ETHERPACKET TRANSMIT.ETHERPACKET) (INITVARS (\RT.TIMEOUTINTERVAL 257620Q) (\RT.AGEINTERVAL 72460Q) (\RT.PURGEFLG T)) (INITVARS (\3MBFLG T) (\10MBFLG) (\3MBLOCALNDB) (\10MBLOCALNDB) (\LOCALNDBS) (\NSFLG))) (COMS (* 12Q to 3 translation ugliness) (FNS \TRANSLATE.10TO3 \NOTE.10TO3 \HANDLE.RAW.10TO3) (DECLARE: DONTCOPY (RECORDS ETHERTRANS) (CONSTANTS \TRANS.OP.REQUEST \TRANS.OP.RESPONSE \TRANS.DATALENGTH) (* The \TRANS.DATALENGTH includes the space for 10TO3OPERATION and two 3-word/1-word translation pairs.))) (COMS (* Printing routines for packets) (FNS PRINTPACKET \MAYBEPRINTPACKET PRINT10TO3 PRINTPACKETDATA PRINTPACKETQUEUE) (INITVARS (\RAWTRACING)) (ADDVARS (\PACKET.PRINTERS (1000Q . PRINTPUP) (3001Q . PRINT10TO3))) (GLOBALVARS \RAWTRACING \PACKET.PRINTERS)) (COMS (* 3MB stuff, which is not needed in DandeLion) (FNS \3MBGETPACKET \3MB.CREATENDB \3MBSENDPACKET \3MBWATCHER \3MBENCAPSULATE \3MB.BROADCASTP \3MBFLUSH) (DECLARE: DONTCOPY (RECORDS 3MBENCAPSULATION PBI) (EXPORT (MACROS \SERIALNUMBER)) (CONSTANTS \3MBENCAPSULATION.WORDS))) [COMS (* Debugging) (FNS ASSURE.ETHER.ON INITPUPLEVEL1 TURN.ON.ETHER RESTART.ETHER TURN.OFF.ETHER PRINTWORDS) (VARS ROUTINGINFOMACRO ETHERFILES) (DECLARE: EVAL@COMPILE DONTCOPY (P (CLISPDEC (QUOTE FETCHFIELD)) (* Slow, checking version for debugging] (COMS (* Opcodes) (FNS \DEVICE.INPUT \DEVICE.OUTPUT \D0.STARTIO) (DECLARE: DONTCOPY (CONSTANTS * D0DEVICES) (EXPORT (PROP DOPVAL \DEVICE.INPUT \DEVICE.OUTPUT \D0.STARTIO]) (* Stuff which should be somwhere else!) (RPAQ? ERRORMESSAGESTREAM T) (RPAQ? PROMPTWINDOW T) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS ERRORMESSAGESTREAM PROMPTWINDOW) ) (* Queue management for data which can be chain-linked through the first cell) (DECLARE: DONTCOPY (* FOLLOWING DEFINITIONS EXPORTED) [DECLARE: EVAL@COMPILE (DATATYPE SYSQUEUE ((NIL BYTE) (SYSQUEUEHEAD POINTER) (NIL BYTE) (SYSQUEUETAIL POINTER))) (BLOCKRECORD QABLEITEM ((NIL BYTE) (QLINK POINTER) (* Link to next thing in queue always in first pointer of datum, independent of what the datum is) ) (BLOCKRECORD QABLEITEM ((NIL BYTE) (LINK POINTER) (* Let's also be able to call it a LINK) ))) ] (/DECLAREDATATYPE (QUOTE SYSQUEUE) (QUOTE (BYTE POINTER BYTE POINTER))) (DECLARE: EVAL@COMPILE (PUTPROPS \QUEUEHEAD MACRO ((Q) (fetch (SYSQUEUE SYSQUEUEHEAD) of Q))) ) (* END EXPORTED DEFINITIONS) ) (/DECLAREDATATYPE (QUOTE SYSQUEUE) (QUOTE (BYTE POINTER BYTE POINTER))) [ADDTOVAR SYSTEMRECLST (DATATYPE SYSQUEUE ((NIL BYTE) (SYSQUEUEHEAD POINTER) (NIL BYTE) (SYSQUEUETAIL POINTER))) ] (DEFINEQ (\ENQUEUE [LAMBDA (Q ITEM) (* bvm: " 2-MAR-83 11:49") (* Adds ITEM to tail of Q, which must be a SYSQUEUE datatype. ITEM must be describable by QABLEITEM.) (SETQ Q (\DTEST Q (QUOTE SYSQUEUE))) (* Do this \DTEST first, even though the fetch will also do it, so that no error occurs underneath the UNINTERRUPTABLY) (freplace QLINK of ITEM with NIL) (* Just for safety -- who knows what garbage may have creeped into the LINK slot of ITEM) (UNINTERRUPTABLY [COND ((NULL (ffetch SYSQUEUEHEAD of Q)) (* Empty queue) (freplace SYSQUEUEHEAD of Q with ITEM)) (T (PROG ((TAILEND (ffetch SYSQUEUETAIL of Q))) (OR (NULL (fetch QLINK of TAILEND)) (ERROR "Tail of queue not consistent with queue's contents" Q)) (freplace QLINK of TAILEND with ITEM] (freplace SYSQUEUETAIL of Q with ITEM) (* ITEM is now last thing on the queue) ) ITEM]) (\DEQUEUE [LAMBDA (Q) (* bvm: " 4-FEB-83 13:05") (* Removes and returns the top item on Q, which should be a SYSQUEUE datatype. Returns NIL if queue is empty.) (SETQ Q (\DTEST Q (QUOTE SYSQUEUE))) (* Do this \DTEST first, even though the fetch will also do it, so that no error occurs underneath the UNINTERRUPTABLY) (UNINTERRUPTABLY (PROG ((ITEM (fetch SYSQUEUEHEAD of Q))) (if ITEM then (* First, "cdr" the link in the queue head) (if (NULL (replace SYSQUEUEHEAD of Q with (fetch QLINK of ITEM))) then (* Exhausted queue) (replace SYSQUEUETAIL of Q with NIL)) (replace QLINK of ITEM with NIL) (* Break the connection that ITEM had with the queue.) ) (RETURN ITEM)))]) (\QUEUELENGTH [LAMBDA (Q) (* bvm: " 4-FEB-83 13:05") (PROG ((X (fetch SYSQUEUEHEAD of Q)) (CNT 0)) LP (OR X (RETURN CNT)) (SETQ X (fetch QLINK of X)) (add CNT 1) (GO LP]) (\ONQUEUE [LAMBDA (ITEM Q) (* bvm: " 4-FEB-83 13:04") (for (X ←(fetch (SYSQUEUE SYSQUEUEHEAD) of Q)) by (fetch QLINK of X) while X do (RETURN ITEM) when (EQ X ITEM]) (\UNQUEUE [LAMBDA (QUEUE ITEM NOERRORFLG) (* bvm: " 6-FEB-83 18:27") (* * Removes ITEM from QUEUE, wherever it may be. Is error if ITEM not in QUEUE unless NOERRORFLG is true) (COND [(UNINTERRUPTABLY [bind (NEXT ←(fetch SYSQUEUEHEAD of QUEUE)) PREV while NEXT do (COND ((EQ NEXT ITEM) (COND [(NULL PREV) (* removing head of queue) (COND ((NULL (replace SYSQUEUEHEAD of QUEUE with (fetch QLINK of ITEM))) (* Exhausted queue) (replace SYSQUEUETAIL of QUEUE with NIL] ((NULL (replace QLINK of PREV with (fetch QLINK of ITEM))) (* Removing last item) (replace SYSQUEUETAIL of QUEUE with PREV))) (replace QLINK of ITEM with NIL) (RETURN ITEM)) (T (SETQ NEXT (fetch QLINK of (SETQ PREV NEXT])] ((NOT NOERRORFLG) (ERROR (LIST ITEM (QUOTE not) (QUOTE on) QUEUE]) ) (* Queue management constructed by TCONC) (* FOLLOWING DEFINITIONS EXPORTED) (DECLARE: EVAL@COMPILE (PUTPROPS \DETCONC MACRO [OPENLAMBDA (TQ) (PROG1 (\PEEKTCONC TQ) (if [NULL (CAR (RPLACA TQ (CDAR TQ] then (RPLACD TQ]) (PUTPROPS \ENTCONC MACRO (= . TCONC)) (PUTPROPS \PEEKTCONC MACRO (= . CAAR)) ) (* END EXPORTED DEFINITIONS) (* General packet management) (DECLARE: DONTCOPY (* FOLLOWING DEFINITIONS EXPORTED) (* * Skeletal ether packet. Other users define with respect to) [DECLARE: EVAL@COMPILE (DATATYPE ETHERPACKET ((NIL BYTE) (EPLINK POINTER) (* For queue maintenence) (EPFLAGS BYTE) (* optional flags for some applications) (EPUSERFIELD POINTER) (* Arbitrary pointer for applications) (NIL BYTE) (EPPLIST POINTER) (* Extra field for use as an A-list for properties) (EPTRANSMITTING FLAG) (* True while packet is being transmitted and hence cannot be reused) (NIL BITS 7) (EPREQUEUE POINTER) (* Where to requeue this packet after transmission) (NIL BYTE) (EPSOCKET POINTER) (NIL BYTE) (EPNETWORK POINTER) (EPTYPE WORD) (* Type of packet to be encapsulated (PUP or XIP or 10TO3)) (NIL 11Q WORD) (* Space for expansion) (* Note: This next field wants to be quad+2 aligned so that the 10mb packet is quad+3 aligned) (EPENCAPSULATION 10Q WORD) (* 10mb encapsulation, or 3mb encapsulation with padding) (EPBODY 441Q WORD) (* Body of packet, header up to 20Q words plus data up to 1042Q bytes) )) (ACCESSFNS ETHERAUX ((AUXPTR (CDR (ASSOC (QUOTE AUXPTR) (fetch EPPLIST of DATUM))) (\EP.PUT.AUX DATUM (QUOTE AUXPTR) NEWVALUE)) (AUXWORD (OR (CDR (ASSOC (QUOTE AUXWORD) (fetch EPPLIST of DATUM))) 0) (\EP.PUT.AUX DATUM (QUOTE AUXWORD) NEWVALUE)) (AUXBYTE (OR (CDR (ASSOC (QUOTE AUXBYTE) (fetch EPPLIST of DATUM))) 0) (\EP.PUT.AUX DATUM (QUOTE AUXBYTE) NEWVALUE)))) ] (/DECLAREDATATYPE (QUOTE ETHERPACKET) (QUOTE (BYTE POINTER BYTE POINTER BYTE POINTER FLAG (BITS 7) POINTER BYTE POINTER BYTE POINTER WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD))) (DECLARE: EVAL@COMPILE (RPAQQ \EPT.PUP 1000Q) (RPAQQ \3MBTYPE.PUP 1000Q) (RPAQQ \10MBTYPE.PUP 1000Q) (RPAQQ \EPT.XIP 3000Q) (RPAQQ \3MBTYPE.XIP 3000Q) (RPAQQ \10MBTYPE.XIP 3000Q) (RPAQQ \EPT.10TO3 3001Q) (RPAQQ \3MBTYPE.10TO3 3001Q) (RPAQQ \EPT.UNKNOWN 377Q) (CONSTANTS \EPT.PUP \3MBTYPE.PUP \10MBTYPE.PUP \EPT.XIP \3MBTYPE.XIP \10MBTYPE.XIP \EPT.10TO3 \3MBTYPE.10TO3 \EPT.UNKNOWN) ) (* END EXPORTED DEFINITIONS) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \FREE.PACKET.QUEUE) ) ) (/DECLAREDATATYPE (QUOTE ETHERPACKET) (QUOTE (BYTE POINTER BYTE POINTER BYTE POINTER FLAG (BITS 7) POINTER BYTE POINTER BYTE POINTER WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD))) (DEFINEQ (\ALLOCATE.ETHERPACKET [LAMBDA NIL (* bvm: "12-FEB-83 17:35") (PROG ((PACKET (\DEQUEUE \FREE.PACKET.QUEUE))) (RETURN (COND (PACKET (\ZEROWORDS (fetch XIPBASE of PACKET) (LOCF (fetch XIPFIRSTDATAWORD of PACKET))) (* Clear the header. XIP header is the larger, so this clears for ether pups or xips) PACKET) (T (COND ((ILESSP (SETQ \NEWPACKETCOUNTER (SUB1 \NEWPACKETCOUNTER)) 0) (* GC doesn't happen often enough, so too many packets tend to get created) (RECLAIM) (SETQ \NEWPACKETCOUNTER 5))) (create ETHERPACKET]) (\RELEASE.ETHERPACKET [LAMBDA (EPKT) (* bvm: " 3-MAR-83 15:14") (* Free a ETHERPACKET -- might want to let GC do it, but GC doesn't happen often enough) (\DTEST EPKT (QUOTE ETHERPACKET)) (COND ([NOT (AND (ffetch EPTRANSMITTING of EPKT) (PROGN (freplace EPREQUEUE of EPKT with (QUOTE FREE)) (ffetch EPTRANSMITTING of EPKT] (* Don't free it yet if it's still being transmitted. Test twice in case it finished while we were setting EPREQUEUE) [freplace EPREQUEUE of EPKT with (freplace EPUSERFIELD of EPKT with (freplace EPNETWORK of EPKT with (freplace EPPLIST of EPKT with (freplace EPSOCKET of EPKT with NIL] (\ENQUEUE \FREE.PACKET.QUEUE EPKT))) NIL]) (RELEASE.PUP [LAMBDA (PUP) (* bvm: " 3-MAR-83 16:14") (\RELEASE.ETHERPACKET PUP]) (\FLUSH.PACKET.QUEUE [LAMBDA (QUEUE) (* bvm: " 4-FEB-83 14:37") (* * Releases all packets in QUEUE and returns how many were flushed) (bind PACKET (CNT ← 0) while (SETQ PACKET (\DEQUEUE QUEUE)) do (\RELEASE.ETHERPACKET PACKET) (add CNT 1]) (\REQUEUE.ETHERPACKET [LAMBDA (PACKET) (* bvm: " 3-MAR-83 15:14") (PROG ((REQUEUE (fetch EPREQUEUE of PACKET))) (SELECTQ REQUEUE ((NIL T)) (FREE (\RELEASE.ETHERPACKET PACKET)) (UNINTERRUPTABLY (COND ((type? SYSQUEUE REQUEUE) (\ENQUEUE REQUEUE PACKET))) (replace EPREQUEUE of PACKET with NIL))]) (\EP.PUT.AUX [LAMBDA (PKT KEY VAL) (* JonL " 8-JUL-82 21:45") (PROG ((PLIST (fetch EPPLIST of PKT)) A) [COND ((NULL (SETQ A (ASSOC KEY PLIST))) [COND ((NEQ KEY (QUOTE AUXPTR)) ([LAMBDA (CELL) (PutUnboxed CELL VAL) (SETQ VAL CELL] (CREATECELL \FIXP] (push (fetch EPPLIST of PKT) (CONS KEY VAL))) ((EQ KEY (QUOTE AUXPTR)) (RPLACD A VAL)) (T (PutUnboxed (CDR A) VAL) (SETQ VAL (CDR A] (RETURN VAL]) ) (RPAQ? \FREE.PACKET.QUEUE (NCREATE (QUOTE SYSQUEUE))) (RPAQ? \NEWPACKETCOUNTER 5) (DECLARE: DONTCOPY (* FOLLOWING DEFINITIONS EXPORTED) [DECLARE: EVAL@COMPILE (DATATYPE NSADDRESS ((NSNET FIXP) (NSHNM0 WORD) (NSHNM1 WORD) (NSHNM2 WORD) (NSSOCKET WORD)) (ACCESSFNS (NSHOSTNUMBER (LOADNSHOSTNUMBER (LOCF (fetch NSHNM0 of DATUM))) (STORENSHOSTNUMBER (LOCF (fetch NSHNM0 of DATUM)) NEWVALUE))) (BLOCKRECORD NSADDRESS ((NSNETHI WORD) (NSNETLO WORD)))) (TYPERECORD NSHOSTNUMBER (NSHOST0 NSHOST1 NSHOST2)) ] (/DECLAREDATATYPE (QUOTE NSADDRESS) (QUOTE (FIXP WORD WORD WORD WORD))) (DECLARE: EVAL@COMPILE (PUTPROPS LOADNSHOSTNUMBER MACRO (= . \LOADNSHOSTNUMBER)) (PUTPROPS STORENSHOSTNUMBER MACRO (= . \STORENSHOSTNUMBER)) (PUTPROPS \MOVENSADDRESSES MACRO ((BASE1 BASE2) (\BLT BASE2 BASE1 \#WDS.NSADDRESS))) (PUTPROPS \SWAPNSADDRESSES MACRO [OPENLAMBDA (BASE1 BASE2) (for I from 0 to (SUB1 \#WDS.NSADDRESS) do (\PUTBASE BASE1 I (PROG1 (\GETBASE BASE2 I) (\PUTBASE BASE2 I (PROGN (\GETBASE BASE1 I]) ) (DECLARE: EVAL@COMPILE (RPAQQ \#WDS.NSADDRESS 6) (RPAQQ \#WDS.NSHOSTNUMBER 3) (CONSTANTS (\#WDS.NSADDRESS 6) (\#WDS.NSHOSTNUMBER 3)) ) (DECLARE: EVAL@COMPILE (PUTPROPS \LOCALNSHOSTNUMBER MACRO (NIL \MY.NSHOSTNUMBER)) (PUTPROPS \LOCALNSNETNUMBER MACRO (NIL \MY.NSNETNUMBER)) (PUTPROPS \LOCALNSADDRESS MACRO (NIL \MY.NSADDRESS)) (PUTPROPS EQNSHOSTNUMBER MACRO (= . EQUAL)) (PUTPROPS \BLTLOCALHOSTNUMBER MACRO ((BASE) (\BLT BASE (LOCF (fetch (IFPAGE NSHost0) of \InterfacePage)) 3))) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS BROADCASTNSHOSTNUMBER \MY.NSADDRESS \MY.NSHOSTNUMBER \MY.NSNETNUMBER) ) (* END EXPORTED DEFINITIONS) ) (/DECLAREDATATYPE (QUOTE NSADDRESS) (QUOTE (FIXP WORD WORD WORD WORD))) (RPAQ? \MY.NSHOSTNUMBER NIL) (RPAQ? \MY.NSNETNUMBER NIL) (RPAQ? \MY.NSADDRESS NIL) (RPAQQ BROADCASTNSHOSTNUMBER (NSHOSTNUMBER 177777Q 177777Q 177777Q)) (DEFINEQ (\SETLOCALNSNUMBERS [LAMBDA (TYPE) (* bvm: "19-MAR-83 14:53") [SETQ \MY.NSHOSTNUMBER (COND ([NOT (ZEROP (LOGOR (fetch (IFPAGE NSHost0) of \InterfacePage) (fetch (IFPAGE NSHost1) of \InterfacePage) (fetch (IFPAGE NSHost2) of \InterfacePage] (create NSHOSTNUMBER NSHOST0 ←(fetch (IFPAGE NSHost0) of \InterfacePage) NSHOST1 ←(fetch (IFPAGE NSHost1) of \InterfacePage) NSHOST2 ←(fetch (IFPAGE NSHost2) of \InterfacePage))) (T (create NSHOSTNUMBER NSHOST0 ← 0 NSHOST1 ← 12345Q NSHOST2 ←(\SERIALNUMBER] (SETQ \MY.NSNETNUMBER 0) (SETQ \MY.NSADDRESS (create NSADDRESS NSHNM0 ←(fetch NSHOST0 of \MY.NSHOSTNUMBER) NSHNM1 ←(fetch NSHOST1 of \MY.NSHOSTNUMBER) NSHNM2 ←(fetch NSHOST2 of \MY.NSHOSTNUMBER]) (\LOADNSADDRESS [LAMBDA (BASE A) (* JonL " 2-AUG-82 00:09") (PROG [(A (if (type? NSADDRESS A) then A else (create NSADDRESS] (\MOVENSADDRESSES BASE A) (RETURN A]) (\STORENSADDRESS [LAMBDA (BASE A) (* JonL " 2-AUG-82 00:11") (\MOVENSADDRESSES (\DTEST A (QUOTE NSADDRESS)) BASE) A]) (\PRINTNSADDRESS [LAMBDA (BASE FILE) (* bvm: " 1-FEB-83 15:51") (if (ILESSP (IDIFFERENCE (LINELENGTH NIL FILE) (POSITION FILE)) (IPLUS 24Q (IQUOTIENT (IPLUS 2 (INTEGERLENGTH (\GETBASE BASE 5))) 3))) then (* Find how many octal digits in the socket number.) (TERPRI FILE)) (printout FILE .I0.-8 (\MAKENUMBER (\GETBASE BASE 0) (\GETBASE BASE 1)) "#" .I0.-8 (\GETBASE BASE 2) "." .I0.-8 (\GETBASE BASE 3) "." .I0.-8 (\GETBASE BASE 4) "#" .I0.-8 (\GETBASE BASE 5)) ""]) (\NSADDRESS.DEFPRINT [LAMBDA (BASE) (* bvm: " 1-FEB-83 15:51") (LIST (CONCAT (OCTALSTRING (\MAKENUMBER (\GETBASE BASE 0) (\GETBASE BASE 1))) "#" (OCTALSTRING (\GETBASE BASE 2)) "." (OCTALSTRING (\GETBASE BASE 3)) "." (OCTALSTRING (\GETBASE BASE 4)) "#" (OCTALSTRING (\GETBASE BASE 5]) (\LOADNSHOSTNUMBER [LAMBDA (BASE OLDBOX) (* bvm: "17-FEB-83 17:07") (COND ((NULL OLDBOX) (create NSHOSTNUMBER NSHOST0 ←(\GETBASE BASE 0) NSHOST1 ←(\GETBASE BASE 1) NSHOST2 ←(\GETBASE BASE 2))) ((type? NSHOSTNUMBER OLDBOX) (replace NSHOST0 of OLDBOX with (\GETBASE BASE 0)) (replace NSHOST1 of OLDBOX with (\GETBASE BASE 1)) (replace NSHOST2 of OLDBOX with (\GETBASE BASE 2)) OLDBOX) (T (ERROR "ARG NOT NSHOSTNUMBER" OLDBOX]) (\STORENSHOSTNUMBER [LAMBDA (BASE NSHNM) (* bvm: "17-FEB-83 17:07") (COND ((type? NSHOSTNUMBER NSHNM) (\PUTBASE BASE 0 (fetch NSHOST0 of NSHNM)) (\PUTBASE BASE 1 (fetch NSHOST1 of NSHNM)) (\PUTBASE BASE 2 (fetch NSHOST2 of NSHNM))) (T (ERROR "ARG NOT NSHOSTNUMBER" NSHNM))) NSHNM]) (PRINTNSHOSTNUMBER [LAMBDA (NSHOSTNUMBER FILE) (* bvm: " 5-AUG-83 15:12") (RESETFORM (RADIX 10Q) (printout FILE (fetch NSHOST0 of NSHOSTNUMBER) "." (fetch NSHOST1 of NSHOSTNUMBER) "." (fetch NSHOST2 of NSHOSTNUMBER]) ) (DEFPRINT (QUOTE NSADDRESS) (QUOTE \NSADDRESS.DEFPRINT)) (* Assorted Level 0) (DEFINEQ (\ETHERINIT [LAMBDA NIL (* bvm: "14-MAR-83 11:47") (* * This gets us EVENT action to take care of pup stuff around LOGOUT, etc.) (MOVD (QUOTE \RELEASE.ETHERPACKET) (QUOTE RELEASE.PUP)) (MOVD (QUOTE \ALLOCATE.ETHERPACKET) (QUOTE ALLOCATE.PUP)) (\DEFINEDEVICE NIL (create FDEV DEVICENAME ←(QUOTE ETHER) EVENTFN ←(FUNCTION \ETHEREVENTFN) DIRECTORYNAMEP ←(QUOTE NILL) HOSTNAMEP ←(QUOTE NILL]) (\ETHEREVENTFN [LAMBDA (DEV EVENT) (* bvm: "17-JUL-83 15:57") (SELECTQ EVENT ((NIL AFTERLOGOUT AFTERSYSOUT AFTERMAKESYS AFTERSAVEVM RESTART) (PROG (NDB TURNOFFNS TIMESET) (SETQ \PUP.READY (SETQ \NS.READY)) (\SETETHERFLAGS) (\SETLOCALNSNUMBERS) (\FLUSHNDBS EVENT) [SETQ \3MBLOCALNDB (COND (\3MBFLG (SETQ \LOCALNDBS (\3MB.CREATENDB \3MBFLG] (SETQ \10MBLOCALNDB (COND (\10MBFLG (SETQ NDB (\10MB.CREATENDB \10MBFLG)) (COND (\LOCALNDBS (replace NDBNEXT of \LOCALNDBS with NDB)) (T (SETQ \LOCALNDBS NDB))) NDB))) [for (DB ← \LOCALNDBS) by (fetch NDBNEXT of DB) while DB do (\LOCKWORDS DB (fetch DTDSIZE of (\GETDTD (NTYPX DB] [COND ((OR \NSFLG (SETQ TURNOFFNS \10MBFLG)) (* Start NS before Pup so that when on 12Q we can find out our pup number, which is done via NS protocol) (\NSINIT EVENT) (SETQ TIMESET (\NS.SETTIME] (\STARTPUP EVENT) [COND ((NOT TIMESET) (OR (\PUP.SETTIME) (printout PROMPTWINDOW "[Time not set]" T] (COND (TURNOFFNS (STOPNS))) T)) ((BEFOREMAKESYS BEFORELOGOUT BEFORESYSOUT) (CLRHASH \ETHERPORTS) (CLRHASH LOGINPASSWORDS)) NIL]) (\SETETHERFLAGS [LAMBDA NIL (* bvm: " 5-MAY-83 23:46") (SELECTC \MACHINETYPE (\DANDELION (SETQ \10MBFLG 0) (SETQ \3MBFLG NIL)) [\DOLPHIN (COND [(ILESSP (\SERIALNUMBER) 255) (SETQ \3MBFLG T) (SETQ \10MBFLG (COND ((EQ (LRSH (\DEVICE.INPUT (LLSH 5 4)) 8) \DEVICE.10MBETHER) 5] (T (SETQ \3MBFLG NIL) (SETQ \10MBFLG (COND ((EQ (LRSH (\DEVICE.INPUT (LLSH 7 4)) 8) \DEVICE.10MBETHER) 7] (\DORADO (SETQ \3MBFLG T) (SETQ \10MBFLG NIL)) (SHOULDNT]) (\FLUSHNDBS [LAMBDA (EVENT) (* bvm: " 4-AUG-83 22:51") [bind NDB QUEUE while (SETQ NDB \LOCALNDBS) do (SETQ \LOCALNDBS (fetch NDBNEXT of NDB)) (replace NDBNEXT of NDB with NIL) (COND ((EQ EVENT (QUOTE RESTART)) (APPLY* (fetch NDBETHERFLUSHER of NDB) NDB))) (DEL.PROCESS (fetch NDBWATCHER of NDB)) (replace NDBWATCHER of NDB with (replace NDBTRANSLATIONS of NDB with NIL)) [COND ((SETQ QUEUE (fetch NDBTQ of NDB)) (\FLUSH.NDB.QUEUE QUEUE EVENT (QUOTE OUTPUT)) (* Don't do this just yet, because of possible race in \PUPGATELISTENER - (replace NDBTQ of NDB with NIL)) ] (COND ((SETQ QUEUE (fetch NDBIQ of NDB)) (\FLUSH.NDB.QUEUE QUEUE EVENT (QUOTE INPUT)) (replace NDBIQ of NDB with NIL] (SETQ \PUP.ROUTING.TABLE (CONS)) (SETQ \NS.ROUTING.TABLE (CONS]) (\FLUSH.NDB.QUEUE [LAMBDA (QUEUE EVENT USE) (* bvm: " 8-JUL-83 18:10") (* * Release any packets on this QUEUE, and their IOCB's for USE if EVENT is RESTART) (bind PACKET IOCB while (SETQ PACKET (\DEQUEUE QUEUE)) do (COND ((AND (EQ EVENT (QUOTE RESTART)) (SETQ IOCB (fetch EPNETWORK of PACKET))) (\RELEASE.IOCB IOCB USE))) (\RELEASE.ETHERPACKET PACKET]) ) (DEFINEQ (\CHECKSUM [LAMBDA (BASE NWORDS INITSUM) (* bvm: " 7-FEB-83 12:05") (PROG ((CHECKSUM (COND (INITSUM (LOGAND INITSUM MASKWORD1'S)) (T 0))) (ADDR BASE) (CNT NWORDS) DIF DATA) (while (IGREATERP CNT 0) do (* * Algorithm: Do 1's complement add of next base word, then rotate sum left one. If result is all ones, then make it zero) [SETQ CHECKSUM (COND ([ILEQ CHECKSUM (SETQ DIF (IDIFFERENCE MAX.SMALL.INTEGER (SETQ DATA (\GETBASE ADDR 0] (* No carry) (IPLUS CHECKSUM DATA)) (T (* Carry, so add the carry into the result. This is actually "CHECKSUM+DATA-(177777Q+1)+1" = "CHECKSUM-(177777Q-DATA)") (IDIFFERENCE CHECKSUM DIF] [SETQ CHECKSUM (COND ((IGREATERP CHECKSUM 77777Q) (LOGOR 1 (LLSH (LOGAND CHECKSUM 77777Q) 1))) (T (LLSH CHECKSUM 1] (* ROT) (SETQ ADDR (\ADDBASE ADDR 1)) (SETQ CNT (SUB1 CNT))) (RETURN (COND ((EQ CHECKSUM MASKWORD1'S) 0) (T CHECKSUM]) (\HANDLE.RAW.OTHER [LAMBDA (PACKET RAWTYPE) (* bvm: "15-FEB-83 18:30") [COND (XIPTRACEFLG (printout XIPTRACEFILE "Dropping packet of unknown encapsulation type: ") (COND (RAWTYPE (printout XIPTRACEFILE "[ = #" .I0.-8 RAWTYPE "]"] (\RELEASE.ETHERPACKET PACKET]) (\FEED.ETHER.OUTPUT [LAMBDA NIL (* bvm: "10-JUN-83 12:28") (PROG (FOOD NDB) (COND ((SETQ FOOD (\DEQUEUE \NETOUTQUEUE)) (SETQ NDB (fetch EPNETWORK of FOOD)) (TRANSMIT.ETHERPACKET NDB FOOD) (BLOCK]) (\HANDLE.RAW.PACKET [LAMBDA (PACKET) (* bvm: " 8-JUN-83 16:56") (OR (AND (OR (NOT \ETHERLIGHTNING) (NEQ (RAND 0 \ETHERLIGHTNING) 0)) (find FILTER in \PACKET.FILTERS bind (TYPE ←(fetch EPTYPE of PACKET)) suchthat (APPLY* FILTER PACKET TYPE))) (\RELEASE.ETHERPACKET PACKET]) (\ADD.PACKET.FILTER [LAMBDA (FILTER) (* bvm: "17-FEB-83 15:17") (OR (FMEMB FILTER \PACKET.FILTERS) (SETQ \PACKET.FILTERS (NCONC1 \PACKET.FILTERS FILTER))) FILTER]) (\DEL.PACKET.FILTER [LAMBDA (FILTER) (* bvm: "17-FEB-83 15:18") (COND ((FMEMB FILTER \PACKET.FILTERS) (SETQ \PACKET.FILTERS (DREMOVE FILTER \PACKET.FILTERS)) T]) ) (DECLARE: DONTCOPY (* FOLLOWING DEFINITIONS EXPORTED) (DECLARE: EVAL@COMPILE (RPAQQ \NULLCHECKSUM 177777Q) (CONSTANTS (\NULLCHECKSUM 177777Q)) ) (* END EXPORTED DEFINITIONS) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \NETOUTQUEUE \PACKET.FILTERS \ETHERLIGHTNING) ) ) (RPAQ? \NETOUTQUEUE (NCREATE (QUOTE SYSQUEUE))) (RPAQ? \PACKET.FILTERS NIL) (RPAQ? \ETHERLIGHTNING ) (DECLARE: DONTEVAL@LOAD DOCOPY (\ETHERINIT) (MOVD? (QUOTE NILL) (QUOTE BLOCK)) ) (* Assorted routing stuff) (DECLARE: DONTCOPY [DECLARE: EVAL@COMPILE (DATATYPE NDB ((NETTYPE BYTE) (* 12Q or 3 for now) (NDBNEXT POINTER) (* Link to next NDB) (NDBPUPNET# BYTE) (* Pup number of this net. May be different from NS net number, though not in Xerox world) (NDBNSNET# POINTER) (* Can be 32-bits, so might as well leave its box around) (NDBTASK# BYTE) (* Task # of this network) (NDBBROADCASTP POINTER) (* Function that returns true if packet is of broadcast type) (NDBPUPHOST# BYTE) (* My pup address on this net. NS address is global to all nets, so not needed here) (NDBTRANSMITTER POINTER) (* Routine to send a raw packet on this net - args NDB PACKET returns NIL on failure) (NIL BYTE) (NDBENCAPSULATOR POINTER) (* Routine to encapsulate and send a higher-level packet on this net - args NDB PACKET HOST LENGTH TYPE) (NDBCSB POINTER) (* Pointer to CSB for this network) (NDBIQLENGTH BYTE) (NDBIQ POINTER) (* Queue of empty packets for receiver) (NDBTQ POINTER) (* Queue of packets to transmit) (NDBTRANSLATIONS POINTER) (* Cache of translations, 3:10 or 10:3 according to network) (NDBETHERFLUSHER POINTER) (* Turns off this ether. Args NDB) (NDBWATCHER POINTER) (NIL POINTER) (NIL POINTER) (NIL POINTER) (* Spares) )) (RECORD ROUTING (RTNET# RTHOPCOUNT RTGATEWAY# RTNDB RTTIMER RTRECENT)) ] (/DECLAREDATATYPE (QUOTE NDB) (QUOTE (BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER POINTER BYTE POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER))) (DECLARE: EVAL@COMPILE (RPAQQ \RT.INFINITY 20Q) (CONSTANTS \RT.INFINITY) ) (DECLARE: EVAL@COMPILE (PUTPROPS ENCAPSULATE.ETHERPACKET MACRO ((NDB PACKET HOST LENGTH TYPE) (SPREADAPPLY*(fetch NDBENCAPSULATOR of NDB) NDB PACKET HOST LENGTH TYPE))) (PUTPROPS TRANSMIT.ETHERPACKET MACRO ((NDB PACKET) (SPREADAPPLY*(fetch NDBTRANSMITTER of NDB) NDB PACKET))) (PUTPROPS BROADCASTP MACRO ((PACKET) ([LAMBDA (NDB) (AND NDB (APPLY* (fetch NDBBROADCASTP of NDB) PACKET NDB] (fetch EPNETWORK of PACKET)))) (PUTPROPS .RTLOOKUP. MACRO ((NET TABLE) (* Net numbers are currently smallp's so this is okay) (ASSOC NET (CDR TABLE)))) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \RT.TIMEOUTINTERVAL \RT.AGEINTERVAL \RT.PURGEFLG) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \3MBFLG \10MBFLG \3MBLOCALNDB \10MBLOCALNDB \LOCALNDBS \NSFLG) ) ) (/DECLAREDATATYPE (QUOTE NDB) (QUOTE (BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER POINTER BYTE POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER))) [ADDTOVAR SYSTEMRECLST (DATATYPE NDB ((NETTYPE BYTE) (* 12Q or 3 for now) (NDBNEXT POINTER) (* Link to next NDB) (NDBPUPNET# BYTE) (* Pup number of this net. May be different from NS net number, though not in Xerox world) (NDBNSNET# POINTER) (* Can be 32-bits, so might as well leave its box around) (NDBTASK# BYTE) (* Task # of this network) (NDBBROADCASTP POINTER) (* Function that returns true if packet is of broadcast type) (NDBPUPHOST# BYTE) (* My pup address on this net. NS address is global to all nets, so not needed here) (NDBTRANSMITTER POINTER) (* Routine to send a raw packet on this net - args NDB PACKET returns NIL on failure) (NIL BYTE) (NDBENCAPSULATOR POINTER) (* Routine to encapsulate and send a higher-level packet on this net - args NDB PACKET HOST LENGTH TYPE) (NDBCSB POINTER) (* Pointer to CSB for this network) (NDBIQLENGTH BYTE) (NDBIQ POINTER) (* Queue of empty packets for receiver) (NDBTQ POINTER) (* Queue of packets to transmit) (NDBTRANSLATIONS POINTER) (* Cache of translations, 3:10 or 10:3 according to network) (NDBETHERFLUSHER POINTER) (* Turns off this ether. Args NDB) (NDBWATCHER POINTER) (NIL POINTER) (NIL POINTER) (NIL POINTER) (* Spares) )) ] (DEFINEQ (\AGE.ROUTING.TABLE [LAMBDA (TABLE) (* bvm: "14-FEB-83 14:18") (for (TAIL ←(CDR TABLE)) (PREV ← TABLE) while TAIL bind ENTRY do (COND [[COND ((AND (NEQ (fetch RTHOPCOUNT of (SETQ ENTRY (CAR TAIL))) 0) (TIMEREXPIRED? (fetch RTTIMER of ENTRY))) (* Entry has timed out) (COND ((fetch RTRECENT of ENTRY) (* New entry, make it old) (replace RTRECENT of ENTRY with NIL) (SETUPTIMER \RT.TIMEOUTINTERVAL (fetch RTTIMER of ENTRY)) NIL) (T \RT.PURGEFLG] (RPLACD PREV (SETQ TAIL (CDR TAIL] (T (SETQ TAIL (CDR (SETQ PREV TAIL]) (\FLUSH.ROUTING.TABLE [LAMBDA (TABLE) (* bvm: "14-FEB-83 14:32") (FRPLACD TABLE (for X in (CDR TABLE) collect X when (ZEROP (fetch RTHOPCOUNT of X]) (PRINTROUTINGTABLE [LAMBDA (TABLE SORT FILE) (* bvm: " 3-MAR-83 16:19") (SELECTQ TABLE (NS (SETQ TABLE \NS.ROUTING.TABLE)) ((NIL PUP) (SETQ TABLE \PUP.ROUTING.TABLE)) NIL) (RESETFORM (RADIX 10Q) (printout FILE "Net# Gateway #Hops Recent?" T) (for ENTRY in (COND (SORT (SORT (APPEND (CDR TABLE)) T)) (T (CDR TABLE))) bind GATE do (printout FILE .I4.8 (fetch RTNET# of ENTRY)) (COND ((NOT (SETQ GATE (fetch RTGATEWAY# of ENTRY))) (PRIN1 " --- " FILE)) ((FIXP GATE) (printout FILE .I9.8 GATE)) (T (SPACES 2 FILE) (PRINTNSHOSTNUMBER GATE FILE))) (printout FILE 25Q .I2 (fetch RTHOPCOUNT of ENTRY) (COND ((fetch RTRECENT of ENTRY) " Yes") ((TIMEREXPIRED? (fetch RTTIMER of ENTRY)) " timed out") (T " No")) T)) (TERPRI FILE]) ) (DEFINEQ (ENCAPSULATE.ETHERPACKET [LAMBDA (NDB PACKET PDH NBYTES ETYPE) (* bvm: "10-JUN-83 12:11") (APPLY* (ffetch NDBENCAPSULATOR of (\DTEST NDB (QUOTE NDB))) NDB (\DTEST PACKET (QUOTE ETHERPACKET)) PDH NBYTES ETYPE]) (TRANSMIT.ETHERPACKET [LAMBDA (NDB PACKET) (* bvm: "10-JUN-83 12:15") (APPLY* (ffetch NDBTRANSMITTER of (\DTEST NDB (QUOTE NDB))) NDB (\DTEST PACKET (QUOTE ETHERPACKET]) ) (RPAQ? \RT.TIMEOUTINTERVAL 257620Q) (RPAQ? \RT.AGEINTERVAL 72460Q) (RPAQ? \RT.PURGEFLG T) (RPAQ? \3MBFLG T) (RPAQ? \10MBFLG ) (RPAQ? \3MBLOCALNDB ) (RPAQ? \10MBLOCALNDB ) (RPAQ? \LOCALNDBS ) (RPAQ? \NSFLG ) (* 12Q to 3 translation ugliness) (DEFINEQ (\TRANSLATE.10TO3 [LAMBDA (NSHOSTNUMBER NDB) (* bvm: "10-JUN-83 12:29") (* Translate from an NSHOSTNUMBER to a PUP host number for the indicated network. If we don't have the translation, we initiate a probe for it and return NIL) (OR [CADR (SASSOC NSHOSTNUMBER (ffetch NDBTRANSLATIONS of (\DTEST NDB (QUOTE NDB] (PROG ((PACKET (\ALLOCATE.ETHERPACKET))) (replace EPTYPE of PACKET with \EPT.10TO3) (freplace TRANSOPERATION of PACKET with \TRANS.OP.REQUEST) (freplace TRANSNSHOST of PACKET with NSHOSTNUMBER) (freplace TRANSSENDERNSHOST of PACKET with (\LOCALNSHOSTNUMBER)) (freplace TRANSSENDERPUPHOST of PACKET with (ffetch NDBPUPHOST# of NDB)) (ENCAPSULATE.ETHERPACKET NDB PACKET 0 \TRANS.DATALENGTH \EPT.10TO3) (AND XIPTRACEFLG (\MAYBEPRINTPACKET PACKET (QUOTE PUT))) (freplace EPREQUEUE of PACKET with (QUOTE FREE)) (TRANSMIT.ETHERPACKET NDB PACKET) (* We didn't find out this time, but we will later on) (RETURN]) (\NOTE.10TO3 [LAMBDA (NSHOST PUPADDRESS NDB) (* bvm: "26-MAR-83 15:02") (* Update cache to include this pairing) (PROG ([A (SASSOC NSHOST (ffetch NDBTRANSLATIONS of (\DTEST NDB (QUOTE NDB] (HOST (fetch PUPHOST# of PUPADDRESS))) (COND (A (RPLACA (CDR A) HOST)) (T (push (ffetch NDBTRANSLATIONS of NDB) (LIST NSHOST HOST (CLOCK 0]) (\HANDLE.RAW.10TO3 [LAMBDA (PACKET TYPE) (* bvm: "10-JUN-83 12:31") (* Called when a TRANSLATION packet is received. This is either a packet requesting a 10-to-3 translation, in which case we respond if it is asking about us; or it is a response to a request of ours, in which case we store the info in the cache) (COND ((EQ TYPE \EPT.10TO3) (PROG ((NDB (fetch EPNETWORK of PACKET))) (AND XIPTRACEFLG (\MAYBEPRINTPACKET PACKET (QUOTE GET))) [SELECTC (fetch TRANSOPERATION of PACKET) [\TRANS.OP.REQUEST (COND ((EQNSHOSTNUMBER (fetch TRANSNSHOST of PACKET) (\LOCALNSHOSTNUMBER)) (* It's for us) (COND ((IGEQ (fetch 3MBLENGTH of PACKET) (IPLUS \3MBENCAPSULATION.WORDS (FOLDHI \TRANS.DATALENGTH BYTESPERWORD)) ) (* Add sender's address to cache) (\NOTE.10TO3 (fetch TRANSSENDERNSHOST of PACKET) (fetch TRANSSENDERPUPHOST of PACKET) NDB))) (replace TRANSPUPHOST of PACKET with (fetch NDBPUPHOST# of NDB)) (* Add in the information he wants) (replace TRANSOPERATION of PACKET with \TRANS.OP.RESPONSE) (ENCAPSULATE.ETHERPACKET NDB PACKET (fetch TRANSSENDERPUPHOST of PACKET) \TRANS.DATALENGTH \EPT.10TO3) (* Send back the response) (AND XIPTRACEFLG (NOT (MEMB (QUOTE TRANS) XIPIGNORETYPES)) (PRINT10TO3 PACKET (QUOTE PUT) XIPTRACEFILE)) (replace EPREQUEUE of PACKET with (QUOTE FREE)) (TRANSMIT.ETHERPACKET NDB PACKET) (RETURN] (\TRANS.OP.RESPONSE (* Add the information to the cache) (\NOTE.10TO3 (fetch TRANSNSHOST of PACKET) (fetch TRANSPUPHOST of PACKET) NDB)) (COND (XIPTRACEFLG (printout XIPTRACEFILE "Bad 10:3 operation: " (fetch TRANSOPERATION of PACKET) T] (\RELEASE.ETHERPACKET PACKET)) T]) ) (DECLARE: DONTCOPY [DECLARE: EVAL@COMPILE (ACCESSFNS ETHERTRANS [(TRANSBODY (LOCF (fetch (ETHERPACKET EPBODY) of DATUM] [BLOCKRECORD TRANSBODY ((TRANSOPERATION WORD) (* Request or response) (BASETRANSNSHOST 3 WORD) (* Known or desired NS address) (TRANSPUPHOST BYTE) (* Known or desired PUP address) (NIL BYTE) (* Padding) (BASETRANSSENDERNSHOST 3 WORD) (* Sender's info) (TRANSSENDERPUPHOST BYTE) (NIL BYTE)) [ACCESSFNS BASETRANSNSHOST ((TRANSCONTENTS (LOCF DATUM] [ACCESSFNS BASETRANSNSHOST ((TRANSNSHOST (\LOADNSHOSTNUMBER (LOCF DATUM)) (\STORENSHOSTNUMBER (LOCF DATUM) NEWVALUE] (ACCESSFNS BASETRANSSENDERNSHOST ((TRANSSENDERNSHOST (\LOADNSHOSTNUMBER (LOCF DATUM)) (\STORENSHOSTNUMBER (LOCF DATUM) NEWVALUE] (TYPE? (type? ETHERPACKET DATUM))) ] (DECLARE: EVAL@COMPILE (RPAQQ \TRANS.OP.REQUEST 10101Q) (RPAQQ \TRANS.OP.RESPONSE 7070Q) (RPAQQ \TRANS.DATALENGTH 22Q) (CONSTANTS \TRANS.OP.REQUEST \TRANS.OP.RESPONSE \TRANS.DATALENGTH) ) (* The \TRANS.DATALENGTH includes the space for 10TO3OPERATION and two 3-word/1-word translation pairs.) ) (* Printing routines for packets) (DEFINEQ (PRINTPACKET [LAMBDA (PACKET CALLER FILE PRE.NOTE DOFILTER) (* bvm: "18-FEB-83 15:25") (PROG ((TYPE (fetch EPTYPE of PACKET)) FN) [COND ((SETQ FN (CDR (FASSOC TYPE \PACKET.PRINTERS))) (RETURN (APPLY* FN PACKET CALLER FILE PRE.NOTE DOFILTER] (OR FILE (SETQ FILE XIPTRACEFILE)) (AND PRE.NOTE (printout FILE T PRE.NOTE)) (AND CALLER (printout FILE CALLER ": ")) (printout FILE "Unknown ether packet type: " TYPE T) (RETURN PACKET]) (\MAYBEPRINTPACKET [LAMBDA (PACKET CALLER FILE PRE.NOTE) (* bvm: "18-JUN-83 20:57") (PROG ((TYPE (fetch EPTYPE of PACKET)) NDB) (SELECTQ (SELECTC TYPE (\EPT.PUP PUPTRACEFLG) XIPTRACEFLG) (NIL) [PEEK (PRIN1 (SELECTQ CALLER [(GET RAWGET) (COND ((BROADCASTP PACKET) (QUOTE *)) (T (QUOTE +] [(PUT RAWPUT) (COND ((BROADCASTP PACKET) (QUOTE ↑)) (T (QUOTE !] (QUOTE ?)) (OR FILE (SELECTC TYPE (\EPT.PUP PUPTRACEFILE) XIPTRACEFILE] [RAW (SELECTQ CALLER ((RAWGET RAWPUT) (PRINTPACKET PACKET CALLER FILE PRE.NOTE T)) (PRIN1 (SELECTQ CALLER (GET (QUOTE #)) (PUT (QUOTE ↑)) (QUOTE ?)) (OR FILE (SELECTC TYPE (\EPT.PUP PUPTRACEFILE) XIPTRACEFILE] (PRINTPACKET PACKET CALLER FILE PRE.NOTE T]) (PRINT10TO3 [LAMBDA (EPKT CALLER FILE PRE.NOTE DOFILTER) (* bvm: " 3-MAR-83 16:16") (COND ((OR (NOT DOFILTER) (NOT (MEMB (QUOTE TRANS) XIPIGNORETYPES))) (OR FILE (SETQ FILE XIPTRACEFILE)) (OR (ZEROP (POSITION FILE)) (TERPRI FILE)) (COND (PRE.NOTE (PRIN1 PRE.NOTE FILE))) (SELECTC (fetch TRANSOPERATION of EPKT) (\TRANS.OP.REQUEST (printout FILE CALLER " 10:3 trans request for ") (PRINTNSHOSTNUMBER (fetch TRANSNSHOST of EPKT) FILE) (printout FILE " from ") (PRINTNSHOSTNUMBER (fetch TRANSSENDERNSHOST of EPKT) FILE) (printout FILE " = " (fetch TRANSSENDERPUPHOST of EPKT) T)) (\TRANS.OP.RESPONSE (printout FILE CALLER " 10:3 trans response: ") (PRINTNSHOSTNUMBER (fetch TRANSNSHOST of EPKT) FILE) (printout FILE " = " (fetch TRANSPUPHOST of EPKT) T)) (printout FILE CALLER " unknown 10 to 3 translation operation " (fetch TRANSOPERATION of EPKT) T]) (PRINTPACKETDATA [LAMBDA (BASE OFFSET MACRO LENGTH FILE) (* bvm: "26-MAY-83 12:27") (* * Prints to FILE the data portion of a packet starting at byte OFFSET (default zero) of BASE for LENGTH bytes according to MACRO. MACRO contains elements describing what format the data is in - WORDS, BYTES, CHARS: print as words, numeric bytes or ascii characters - IFSSTRING: data is a string whose length is in the first two bytes - <positive number>: subsequent commands apply starting at this byte offset - <negative number>: commands apply for the next {magnitude} bytes - ...: print "..." and quit if you still have data at this point - REPEAT: rest of macro should be applied repeatedly until data exhausted - T: end of line - SEPR: separate items (other than CHARS) with next token - FINALLY: print next token when you get to the end) (OR OFFSET (SETQ OFFSET 0)) (bind CHAR TMP FINALPRINT REPEATMACRO (SEPR ← ", ") (TILOFFSET ← 0) (DATATYPE ←(QUOTE WORDS)) (STREAM ←(GETSTREAM FILE (QUOTE OUTPUT))) while (ILESSP OFFSET LENGTH) do (while (AND (OR MACRO (SETQ MACRO REPEATMACRO)) (IGEQ OFFSET TILOFFSET)) do [SELECTQ (CAR MACRO) ((WORDS BYTES CHARS INTEGERS) (SETQ DATATYPE (CAR MACRO))) [(WORD BYTE CHAR INTEGER) (SETQ DATATYPE (PACK* (CAR MACRO) (QUOTE S] [IFSSTRING (* Hack. Data is assumed to be a string whose first word is its length) (SETQ TMP (\GETBASE BASE (FOLDLO OFFSET BYTESPERWORD))) (printout STREAM (QUOTE {) .P2 TMP (QUOTE })) (add OFFSET 2) (SETQ TILOFFSET (CEIL (IPLUS OFFSET TMP) BYTESPERWORD)) (COND ((NEQ DATATYPE (QUOTE BYTES)) (SETQ DATATYPE (QUOTE CHARS] (... (PRIN1 (QUOTE ...) STREAM) (SETQ DATATYPE (SETQ MACRO))) (REPEAT (SETQ REPEATMACRO (CDR MACRO))) (SEPR (SETQ SEPR (CADR MACRO)) (SETQ MACRO (CDR MACRO))) [FINALLY (SETQ FINALPRINT (CAR (SETQ MACRO (CDR MACRO] (T (TERPRI STREAM)) (COND [(FIXP (CAR MACRO)) (SETQ TILOFFSET (COND ((IGEQ (CAR MACRO) 0) (CAR MACRO)) (T (* Relative) (IDIFFERENCE OFFSET (CAR MACRO] (T (PRIN1 (CAR MACRO) STREAM] (SETQ MACRO (CDR MACRO))) (SELECTQ DATATYPE [WORDS (PRIN2 (\GETBASE BASE (FOLDLO OFFSET BYTESPERWORD)) STREAM) (add OFFSET 2) (COND ((AND SEPR (ILESSP OFFSET LENGTH)) (PRIN1 SEPR STREAM] [INTEGERS (PRIN2 (\MAKENUMBER (\GETBASE BASE (SETQ TMP (FOLDLO OFFSET BYTESPERWORD) )) (\GETBASE BASE (ADD1 TMP))) STREAM) (add OFFSET 4) (COND ((AND SEPR (ILESSP OFFSET LENGTH)) (PRIN1 SEPR STREAM] (CHARS [COND ((AND (IGEQ (SETQ CHAR (\GETBASEBYTE BASE OFFSET)) (CHARCODE SPACE)) (ILESSP CHAR 177Q)) (\OUTCHAR STREAM CHAR)) ((AND (EQ CHAR (CHARCODE CR)) (IGREATERP LENGTH (ADD1 OFFSET)) (EQ (\GETBASEBYTE BASE (ADD1 OFFSET)) (CHARCODE LF))) (PRIN1 "[crlf]" STREAM) (add OFFSET 1)) (T (printout STREAM (QUOTE %[) CHAR (QUOTE %]] (add OFFSET 1)) (BYTES (printout STREAM (QUOTE %[) (\GETBASEBYTE BASE OFFSET) (QUOTE %])) (add OFFSET 1)) (RETURN)) finally (AND FINALPRINT (PRIN1 FINALPRINT STREAM))) (TERPRI FILE]) (PRINTPACKETQUEUE [LAMBDA (QUEUE CALLER FILE) (* bvm: "21-APR-83 23:51") (for [PACKET ←(COND ((type? SYSQUEUE QUEUE) (fetch SYSQUEUEHEAD of QUEUE)) (T (\DTEST QUEUE (QUOTE ETHERPACKET] by (fetch EPLINK of PACKET) while PACKET do (PRINTPACKET PACKET CALLER FILE]) ) (RPAQ? \RAWTRACING ) (ADDTOVAR \PACKET.PRINTERS (1000Q . PRINTPUP) (3001Q . PRINT10TO3)) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \RAWTRACING \PACKET.PRINTERS) ) (* 3MB stuff, which is not needed in DandeLion) (DEFINEQ (\3MBGETPACKET [LAMBDA NIL (* bvm: "18-FEB-83 16:44") (PROG (PACKET) (RETURN (COND ((UNINTERRUPTABLY (PROG ((PBI (\READRAWPBI))) [COND (PBI (SETQ PACKET (\ALLOCATE.ETHERPACKET)) (\BLT (fetch 3MBBASE of PACKET) (fetch PBIRAWSTART of PBI) (ADD1 (fetch PBILENGTH of PBI))) (COND ((NEQ (fetch PBISOCKET of PBI) 0) (HELP "PBI has a socket" PBI] (RETURN PBI))) (\BOXIPLUS (LOCF (fetch NETIOOPS of \MISCSTATS)) 1) (replace EPNETWORK of PACKET with \3MBLOCALNDB) (replace EPTYPE of PACKET with (fetch 3MBTYPE of PACKET)) [COND (\RAWTRACING (\MAYBEPRINTPACKET PACKET (QUOTE RAWGET] PACKET]) (\3MB.CREATENDB [LAMBDA NIL (* bvm: " 8-JUL-83 18:15") (create NDB NDBPUPHOST# ←(\SERIALNUMBER) NDBPUPNET# ← 0 NDBNSNET# ← 0 NETTYPE ← 3 NDBTRANSMITTER ←(FUNCTION \3MBSENDPACKET) NDBENCAPSULATOR ←(FUNCTION \3MBENCAPSULATE) NDBBROADCASTP ←(FUNCTION \3MB.BROADCASTP) NDBETHERFLUSHER ←(FUNCTION NILL) NDBWATCHER ←(ADD.PROCESS (QUOTE (\3MBWATCHER)) (QUOTE RESTARTABLE) (QUOTE SYSTEM) (QUOTE AFTEREXIT) (QUOTE DELETE]) (\3MBSENDPACKET [LAMBDA (NDB PACKET) (* bvm: " 8-JUN-83 16:59") (* Sends raw seething etherpacket on the 3mb net denoted by NDB) (SETQ PACKET (\DTEST PACKET (QUOTE ETHERPACKET))) (PROG NIL (AND \RAWTRACING (\MAYBEPRINTPACKET PACKET (QUOTE RAWPUT))) [COND ((OR (NULL \ETHERLIGHTNING) (NEQ (RAND 0 \ETHERLIGHTNING) 0)) (UNINTERRUPTABLY (PROG ((PBI (\GETPACKETBUFFER))) [OR PBI (RETURN (COND (\RAWTRACING (PRIN1 (QUOTE x) (SELECTC (fetch EPTYPE of PACKET) (\EPT.PUP PUPTRACEFILE) XIPTRACEFILE] (\BLT (fetch PBIRAWSTART of PBI) (fetch 3MBBASE of PACKET) (ADD1 (fetch 3MBLENGTH of PACKET))) (\WRITERAWPBI PBI) (\BOXIPLUS (LOCF (fetch NETIOOPS of \MISCSTATS)) 1)))] (\REQUEUE.ETHERPACKET PACKET) (RETURN T]) (\3MBWATCHER [LAMBDA NIL (* bvm: "17-FEB-83 15:10") (* Process that watches the 3mb net and pulls packets in. It immediately handles routing packets and translation packets; puts other XIPs on their addressed socket (if socket is open) discards anything else Also it dispatches packets of \XIPOUTQUEUE into the "real thing") (PROG (PACKET) LP (COND ((SETQ PACKET (\3MBGETPACKET)) (* Got something) (\HANDLE.RAW.PACKET PACKET))) (BLOCK) (\FEED.ETHER.OUTPUT) (GO LP]) (\3MBENCAPSULATE [LAMBDA (NDB PACKET PDH LENGTH TYPE) (* bvm: " 7-MAR-83 12:44") (* Encapsulates packets for 3mb net) (replace 3MBDESTHOST of PACKET with PDH) (replace 3MBSOURCEHOST of PACKET with (fetch NDBPUPHOST# of NDB)) (replace 3MBLENGTH of PACKET with (IPLUS (FOLDHI LENGTH BYTESPERWORD) \3MBENCAPSULATION.WORDS)) (replace 3MBTYPE of PACKET with TYPE) PACKET]) (\3MB.BROADCASTP [LAMBDA (PACKET) (* bvm: "18-JUN-83 20:53") (ZEROP (fetch 3MBDESTHOST of PACKET]) (\3MBFLUSH [LAMBDA (ASPROC) (* bvm: "18-FEB-83 17:10") (PROG NIL LP (RETURN (PROG1 (while (\READRAWPBI) sum 1) (COND (ASPROC (BLOCK 11610Q) (GO LP]) ) (DECLARE: DONTCOPY [DECLARE: EVAL@COMPILE (ACCESSFNS 3MBENCAPSULATION [(3MBENCAPSTART (LOCF (fetch (ETHERPACKET EPENCAPSULATION) of DATUM] (BLOCKRECORD 3MBENCAPSTART ((NIL 5 WORD) (* waste space) (3MBLENGTH WORD) (* Length of packet in words, starting at the next word) (3MBDESTHOST BYTE) (* Immediate destination host) (3MBSOURCEHOST BYTE) (* Us) (3MBTYPE WORD) (* Type of packet -- PUP or XIP or 10TO3) ) [ACCESSFNS 3MBLENGTH ((3MBBASE (LOCF DATUM] (* What to hand to BCPL) ) (TYPE? (type? ETHERPACKET DATUM))) (BLOCKRECORD PBI ((PBILINK WORD) (PBIQUEUE WORD) (PBISOCKET WORD) (PBINDB WORD) (PBIINPUTP FLAG) (PBIALLNETSP FLAG) (PBINOZEROP FLAG) (NIL BITS 15Q) (PBITIMER WORD) (PBILENGTH WORD) (PBIENCAPSULATION 2 WORD) (PBIFIRSTPUPWORD 12Q WORD) (PBIFIRSTPUPDATAWORD WORD)) [ACCESSFNS PBI ((PBIPUPSTART (LOCF (fetch PBIFIRSTPUPWORD of DATUM))) (PBIPUPDATASTART (LOCF (fetch PBIFIRSTPUPDATAWORD of DATUM))) (PBIRAWSTART (LOCF (fetch PBILENGTH of DATUM]) ] (* FOLLOWING DEFINITIONS EXPORTED) (DECLARE: EVAL@COMPILE (PUTPROPS \SERIALNUMBER MACRO (NIL (fetch (IFPAGE SerialNumber) of \InterfacePage))) ) (* END EXPORTED DEFINITIONS) (DECLARE: EVAL@COMPILE (RPAQQ \3MBENCAPSULATION.WORDS 2) (CONSTANTS \3MBENCAPSULATION.WORDS) ) ) (* Debugging) (DEFINEQ (ASSURE.ETHER.ON [LAMBDA (USENS) (* bvm: " 8-JUL-83 18:31") (OR (THIS.PROCESS) (ERROR "Processes not on!" "" T)) (COND ((NOT \LOCALNDBS) (AND USENS (SETQ \NSFLG T)) (\ETHEREVENTFN)) ((AND USENS (NOT \NSFLG)) (\NSINIT]) (INITPUPLEVEL1 [LAMBDA (FLG) (* bvm: " 5-MAY-83 23:49") (TURN.OFF.ETHER) (DEL.PROCESS (QUOTE \3MBFLUSH)) (SELECTC \MACHINETYPE (\DANDELION) (\PUPLEVEL1STATE NIL)) (ASSURE.ETHER.ON) (COND (FLG (* This hack used for Bootstrapping: we got called from \PUPINIT in the evaluation of PUP's coms) (HARDRESET]) (TURN.ON.ETHER [LAMBDA NIL (* bvm: "26-MAR-83 15:55") (ASSURE.ETHER.ON \NSFLG]) (RESTART.ETHER [LAMBDA NIL (* bvm: " 8-JUL-83 18:37") (SUSPEND.PROCESS (QUOTE \PUPGATELISTENER)) (SUSPEND.PROCESS (QUOTE \NSGATELISTENER)) (\ETHEREVENTFN NIL (QUOTE RESTART]) (TURN.OFF.ETHER [LAMBDA NIL (* bvm: "12-JUL-83 14:03") (BREAKCONNECTION T) (DEL.PROCESS (QUOTE \PUPGATELISTENER)) (DEL.PROCESS (QUOTE \NSGATELISTENER)) (CLOSEPUPSOCKET T) (AND (GETD (QUOTE CLOSENSOCKET)) (CLOSENSOCKET T)) (\FLUSHNDBS (QUOTE RESTART]) (PRINTWORDS [LAMBDA (BASE NWORDS) (* bvm: "25-MAY-82 21:26") (for I from 0 to (SUB1 NWORDS) do (printout NIL .P2 I ": " .P2 (\GETBASE BASE I) T]) ) (RPAQQ ROUTINGINFOMACRO (1 "Operation = " WORDS 2 "Info: " REPEAT "(" SEPR ", " INTEGER -4 WORDS SEPR ") " -2 FINALLY ")")) (RPAQQ ETHERFILES (LLETHER LLNS 10MBDRIVER PUP LEAF BSP CHAT SPP)) (DECLARE: EVAL@COMPILE DONTCOPY (CLISPDEC (QUOTE FETCHFIELD)) (* Slow, checking version for debugging) ) (* Opcodes) (DEFINEQ (\DEVICE.INPUT [LAMBDA (TASKREG) (* bvm: "12-JUL-82 13:29") ((OPCODES MISC1 1) (\DTEST TASKREG (QUOTE SMALLP]) (\DEVICE.OUTPUT [LAMBDA (VALUE TASKREG) (* bvm: "12-JUL-82 13:29") ((OPCODES MISC2 2) (\DTEST VALUE (QUOTE SMALLP)) (\DTEST TASKREG (QUOTE SMALLP]) (\D0.STARTIO [LAMBDA (BITS) (* bvm: "12-JUL-82 13:28") ((OPCODES MISC1 0) (\DTEST BITS (QUOTE SMALLP]) ) (DECLARE: DONTCOPY (RPAQQ D0DEVICES ((\DEVICE.3MBETHERIN 7) (\DEVICE.3MBETHEROUT 6) (\DEVICE.10MBETHER 25Q) (\DEVICE.SA4000 3) (\DEVICE.DISPLAY 2))) (DECLARE: EVAL@COMPILE (RPAQQ \DEVICE.3MBETHERIN 7) (RPAQQ \DEVICE.3MBETHEROUT 6) (RPAQQ \DEVICE.10MBETHER 25Q) (RPAQQ \DEVICE.SA4000 3) (RPAQQ \DEVICE.DISPLAY 2) (CONSTANTS (\DEVICE.3MBETHERIN 7) (\DEVICE.3MBETHEROUT 6) (\DEVICE.10MBETHER 25Q) (\DEVICE.SA4000 3) (\DEVICE.DISPLAY 2)) ) (* FOLLOWING DEFINITIONS EXPORTED) (PUTPROPS \DEVICE.INPUT DOPVAL (1 MISC1 1)) (PUTPROPS \DEVICE.OUTPUT DOPVAL (2 MISC2 2)) (PUTPROPS \D0.STARTIO DOPVAL (1 MISC1 0)) (* END EXPORTED DEFINITIONS) ) (PUTPROPS LLETHER COPYRIGHT ("Xerox Corporation" 3676Q 3677Q)) (DECLARE: DONTCOPY (FILEMAP (NIL (14650Q 24650Q (\ENQUEUE 14662Q . 17211Q) (\DEQUEUE 17213Q . 21306Q) (\QUEUELENGTH 21310Q . 21754Q) (\ONQUEUE 21756Q . 22366Q) (\UNQUEUE 22370Q . 24646Q)) (42255Q 50637Q ( \ALLOCATE.ETHERPACKET 42267Q . 43715Q) (\RELEASE.ETHERPACKET 43717Q . 45653Q) (RELEASE.PUP 45655Q . 46075Q) (\FLUSH.PACKET.QUEUE 46077Q . 46632Q) (\REQUEUE.ETHERPACKET 46634Q . 47535Q) (\EP.PUT.AUX 47537Q . 50635Q)) (55040Q 64147Q (\SETLOCALNSNUMBERS 55052Q . 56656Q) (\LOADNSADDRESS 56660Q . 57270Q) (\STORENSADDRESS 57272Q . 57563Q) (\PRINTNSADDRESS 57565Q . 61005Q) (\NSADDRESS.DEFPRINT 61007Q . 61606Q) (\LOADNSHOSTNUMBER 61610Q . 62654Q) (\STORENSHOSTNUMBER 62656Q . 63452Q) (PRINTNSHOSTNUMBER 63454Q . 64145Q)) (64301Q 74457Q (\ETHERINIT 64313Q . 65327Q) (\ETHEREVENTFN 65331Q . 70210Q) ( \SETETHERFLAGS 70212Q . 71403Q) (\FLUSHNDBS 71405Q . 73525Q) (\FLUSH.NDB.QUEUE 73527Q . 74455Q)) ( 74460Q 101752Q (\CHECKSUM 74472Q . 77032Q) (\HANDLE.RAW.OTHER 77034Q . 77562Q) (\FEED.ETHER.OUTPUT 77564Q . 100251Q) (\HANDLE.RAW.PACKET 100253Q . 101043Q) (\ADD.PACKET.FILTER 101045Q . 101405Q) ( \DEL.PACKET.FILTER 101407Q . 101750Q)) (115377Q 121665Q (\AGE.ROUTING.TABLE 115411Q . 117254Q) ( \FLUSH.ROUTING.TABLE 117256Q . 117623Q) (PRINTROUTINGTABLE 117625Q . 121663Q)) (121666Q 122676Q ( ENCAPSULATE.ETHERPACKET 121700Q . 122313Q) (TRANSMIT.ETHERPACKET 122315Q . 122674Q)) (123345Q 133433Q (\TRANSLATE.10TO3 123357Q . 125613Q) (\NOTE.10TO3 125615Q . 126604Q) (\HANDLE.RAW.10TO3 126606Q . 133431Q)) (136425Q 153377Q (PRINTPACKET 136437Q . 137505Q) (\MAYBEPRINTPACKET 137507Q . 141403Q) ( PRINT10TO3 141405Q . 143540Q) (PRINTPACKETDATA 143542Q . 152610Q) (PRINTPACKETQUEUE 152612Q . 153375Q) ) (153771Q 164065Q (\3MBGETPACKET 154003Q . 155604Q) (\3MB.CREATENDB 155606Q . 156671Q) ( \3MBSENDPACKET 156673Q . 160765Q) (\3MBWATCHER 160767Q . 162171Q) (\3MBENCAPSULATE 162173Q . 163241Q) (\3MB.BROADCASTP 163243Q . 163505Q) (\3MBFLUSH 163507Q . 164063Q)) (167372Q 172717Q (ASSURE.ETHER.ON 167404Q . 170057Q) (INITPUPLEVEL1 170061Q . 171017Q) (TURN.ON.ETHER 171021Q . 171241Q) (RESTART.ETHER 171243Q . 171632Q) (TURN.OFF.ETHER 171634Q . 172355Q) (PRINTWORDS 172357Q . 172715Q)) (173444Q 174521Q (\DEVICE.INPUT 173456Q . 173730Q) (\DEVICE.OUTPUT 173732Q . 174250Q) (\D0.STARTIO 174252Q . 174517Q)) ))) STOP