(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED " 3-May-2021 23:13:56" {DSK}larry>ilisp>medley>sources>LLETHER.;4 139646 changes to%: (FNS \ETHEREVENTFN \ETHER-AVAILABLE) (VARS LLETHERCOMS) previous date%: " 2-May-2021 12:37:02" {DSK}larry>ilisp>medley>sources>LLETHER.;3) (* ; " Copyright (c) 1982-1988, 1990-1993, 2021 by Venue & Xerox Corporation. ") (PRETTYCOMPRINT LLETHERCOMS) (RPAQQ LLETHERCOMS [(DECLARE%: EVAL@COMPILE DONTCOPY (FILES (SOURCE) LLNSDECLS)) [COMS (* ;  "Stuff that should be somewhere 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 CANONICAL.HOSTNAME \ENQUEUE \DEQUEUE \QUEUELENGTH \ONQUEUE \UNQUEUE) (* ;  "Queue management constructed by TCONC") (EXPORT (MACROS \DETCONC \ENTCONC \PEEKTCONC] (COMS (* ; "General packet management") (DECLARE%: DONTCOPY (* ;; "Skeletal ether packet. Other users define with respect to") (EXPORT (RECORDS ETHERPACKET ETHERAUX) (CONSTANTS \EPT.PUP \EPT.XIP \3MBTYPE.XIP \10MBTYPE.XIP \EPT.10TO3 \3MBTYPE.10TO3 \EPT.UNKNOWN)) (GLOBALVARS \FREE.PACKET.QUEUE \NEWPACKETCOUNTER)) (INITRECORDS ETHERPACKET) (SYSRECORDS ETHERPACKET) (FNS \ALLOCATE.ETHERPACKET \RELEASE.ETHERPACKET RELEASE.PUP \FLUSH.PACKET.QUEUE \REQUEUE.ETHERPACKET \EP.PUT.AUX) (INITVARS (\FREE.PACKET.QUEUE (NCREATE 'SYSQUEUE)) (\NEWPACKETCOUNTER 5))) [COMS (INITRECORDS NSADDRESS) (INITVARS (\MY.NSHOSTNUMBER NIL) (\MY.NSNETNUMBER NIL) (\MY.NSADDRESS NIL) (*NSADDRESS-FORMAT* NIL)) [P (CL:PROCLAIM '(CL:SPECIAL *NSADDRESS-FORMAT*] (VARS BROADCASTNSHOSTNUMBER) (FNS \SETLOCALNSNUMBERS \LOADNSADDRESS \STORENSADDRESS \PRINTNSADDRESS \NSADDRESS.DEFPRINT \NSADDRESS.PRINT.DECIMAL \LOADNSHOSTNUMBER \STORENSHOSTNUMBER PRINTNSHOSTNUMBER) (DECLARE%: DONTEVAL@LOAD DOCOPY (P (DEFPRINT 'NSADDRESS '\NSADDRESS.DEFPRINT] [COMS (* ; "Assorted Level 0") (FNS \ETHERINIT \ETHEREVENTFN \ETHER-AVAILABLE \TIME.NOT.SET \SETETHERFLAGS \FLUSHNDBS \FLUSH.NDB.QUEUE) (FNS \CHECKSUM \HANDLE.RAW.OTHER \HANDLE.RAW.PACKET \ADD.PACKET.FILTER \DEL.PACKET.FILTER) (DECLARE%: DONTCOPY (EXPORT (CONSTANTS (\NULLCHECKSUM 65535))) (GLOBALVARS \PACKET.FILTERS \ETHERLIGHTNING RESTARTETHERFNS)) (INITVARS (\PACKET.FILTERS NIL) (\ETHERLIGHTNING) (RESTARTETHERFNS)) (DECLARE%: DONTEVAL@LOAD DOCOPY (P (\ETHERINIT) (MOVD? 'NILL 'BLOCK) (MOVD? 'NILL '\STASH.PASSWORDS] (COMS (* ; "Assorted routing stuff") (DECLARE%: DONTCOPY (EXPORT (RECORDS NDB ROUTING)) (CONSTANTS \RT.INFINITY) (MACROS ENCAPSULATE.ETHERPACKET TRANSMIT.ETHERPACKET BROADCASTP \CHECK.ROUTING.TABLE) (GLOBALVARS \RT.TIMEOUTINTERVAL \RT.AGEINTERVAL \RT.PURGEFLG \GATEWAYFLG \ROUTING.TABLE.MASK \ROUTING.TABLE.TYPENUM) (GLOBALVARS \3MBFLG \10MBFLG \3MBLOCALNDB \10MBLOCALNDB \LOCALNDBS \NSFLG \IPFLG \NS.ROUTING.TABLE \PUP.ROUTING.TABLE \NS.READY \PUP.READY \IP.READY)) (INITRECORDS NDB) (SYSRECORDS NDB) (FNS ENCAPSULATE.ETHERPACKET TRANSMIT.ETHERPACKET) (* ;; "Routing table management. Table is naked array of specified size (choices are 8, 16, 32, 64, based on availability of pointer hunks for those sizes). These are global vars rather than constants so you can play with them (but you'd better restart ether immediately).") (FNS \AGE.ROUTING.TABLE \ADD.ROUTING.TABLE.ENTRY \CLEAR.ROUTING.TABLE \MAP.ROUTING.TABLE PRINTROUTINGTABLE \ROUTINGTABLE.INFOHOOK) [INITVARS (\RT.TIMEOUTINTERVAL 90000) (\RT.AGEINTERVAL 30000) (\RT.PURGEFLG T) (\GATEWAYFLG NIL) (\ROUTING.TABLE.MASK 31) (\ROUTING.TABLE.TYPENUM (\TYPENUMBERFROMNAME (PACK* "\PTRHUNK" (ADD1 \ROUTING.TABLE.MASK ] (INITVARS (\3MBFLG T) (\10MBFLG) (\3MBLOCALNDB) (\10MBLOCALNDB) (\LOCALNDBS) (\NSFLG) (\IPFLG))) (COMS (* ; "10 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 TIME.SINCE.PACKET MAKE-NETWORK-TRACE-WINDOW \CHANGE.ETHER.TRACING) (INITVARS (\RAWTRACING)) (ADDVARS (\PACKET.PRINTERS (512 . PRINTPUP) (1537 . PRINT10TO3))) (GLOBALVARS \RAWTRACING \PACKET.PRINTERS PUPTRACEFILE XIPTRACEFILE \RCLKMILLISECOND)) (COMS (* ; "For PUP/XIPTRACETIME, functions to convert time from internal ticks to decimal fractions of a second.") (FNS \CENTICLOCK) [VARS (\CENTICLOCKFACTOR) (\CENTICLOCKBOX (NCREATE 'FIXP] (ADDVARS (\SYSTEMCACHEVARS \CENTICLOCKFACTOR)) (DECLARE%: EVAL@COMPILE DONTCOPY (GLOBALVARS \CENTICLOCKFACTOR \CENTICLOCKBOX) (RECORDS CENTICLOCK))) (COMS (* ;  "3MB stuff, which is not needed in DandeLion") (FNS \3MBGETPACKET \3MB.CREATENDB \3MBSENDPACKET \3MBWATCHER \3MBENCAPSULATE \3MB.BROADCASTP \3MBFLUSH) (INITVARS (\MAXWATCHERGETS 5)) (DECLARE%: DONTCOPY (RECORDS 3MBENCAPSULATION PBI) (EXPORT (MACROS \SERIALNUMBER)) (CONSTANTS \3MBENCAPSULATION.WORDS \3MBTYPE.PUP) (GLOBALVARS \MAXWATCHERGETS *MAXIMUM-PACKET-SIZE*))) (COMS (* ; "Debugging") (FNS ASSURE.ETHER.ON INITPUPLEVEL1 TURN.ON.ETHER RESTART.ETHER TURN.OFF.ETHER PRINTWORDS) (VARS ROUTINGINFOMACRO) (DECLARE%: EVAL@COMPILE DONTCOPY (LOCALVARS . T))) (COMS (* ; "Opcodes") (FNS \DEVICE.INPUT \DEVICE.OUTPUT \D0.STARTIO) (DECLARE%: DONTCOPY (CONSTANTS * D0DEVICES) (EXPORT (PROP DOPVAL \DEVICE.INPUT \DEVICE.OUTPUT \D0.STARTIO]) (DECLARE%: EVAL@COMPILE DONTCOPY (FILESLOAD (SOURCE) LLNSDECLS) ) (* ; "Stuff that should be somewhere else!") (RPAQ? ERRORMESSAGESTREAM T) (RPAQ? PROMPTWINDOW T) (DECLARE%: DOEVAL@COMPILE DONTCOPY (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 BITS 4) (QLINK POINTER) (* ;  "Link to next thing in queue always in first pointer of datum, independent of what the datum is") ) (BLOCKRECORD QABLEITEM ((NIL BITS 4) (LINK POINTER) (* ;  "Let's also be able to call it a LINK") ))) ) (/DECLAREDATATYPE 'SYSQUEUE '(BYTE POINTER BYTE POINTER) '((SYSQUEUE 0 (BITS . 7)) (SYSQUEUE 2 POINTER) (SYSQUEUE 1 (BITS . 7)) (SYSQUEUE 4 POINTER)) '6) (DECLARE%: EVAL@COMPILE (PUTPROPS \QUEUEHEAD MACRO ((Q) (fetch (SYSQUEUE SYSQUEUEHEAD) of Q))) ) (* "END EXPORTED DEFINITIONS") ) (/DECLAREDATATYPE 'SYSQUEUE '(BYTE POINTER BYTE POINTER) '((SYSQUEUE 0 (BITS . 7)) (SYSQUEUE 2 POINTER) (SYSQUEUE 1 (BITS . 7)) (SYSQUEUE 4 POINTER)) '6) (ADDTOVAR SYSTEMRECLST (DATATYPE SYSQUEUE ((NIL BYTE) (SYSQUEUEHEAD POINTER) (NIL BYTE) (SYSQUEUETAIL POINTER))) ) (DEFINEQ (CANONICAL.HOSTNAME [LAMBDA (HOSTNAME) (* ; "Edited 1-May-2021 19:45 by larry") (LET [(DEV (CL:ASSOC HOSTNAME \DEVICENAMETODEVICE :TEST 'STRING-EQUAL] (if DEV then (* ; "Known device, don't ask anyone") (fetch DEVICENAME of (CDR DEV)) elseif (NOT (SUBRCALL ETHER-AVAILABLE)) then HOSTNAME elseif (AND \NS.READY (STRPOS ":" HOSTNAME)) then (* ; "Assume NS") (\CANONICAL.NSHOSTNAME HOSTNAME) elseif (NUMBERP HOSTNAME) then (* ; "Some sort of host address") (if (AND (SMALLP HOSTNAME) (< HOSTNAME 255)) then (* ; "valid pup address") HOSTNAME elseif \IP.READY then (* ; "Big number may be IP host") (IPHOSTNAME HOSTNAME)) else (if (NOT (LITATOM HOSTNAME)) then (SETQ HOSTNAME (MKATOM HOSTNAME))) (OR (CDR (FASSOC HOSTNAME \HOSTNAMES)) (AND \IP.READY (\CANONICALIZE.IP.HOSTNAME HOSTNAME)) (AND \PUP.READY (\CANONICALIZE.PUP.HOSTNAME HOSTNAME)) HOSTNAME]) (\ENQUEUE [LAMBDA (Q ITEM) (* bvm%: "14-Feb-85 21:55") (* ;; "Adds ITEM to tail of Q, which must be a SYSQUEUE datatype. ITEM must be describable by QABLEITEM.") (SETQ Q (\DTEST Q 'SYSQUEUE)) (* ;; "Do this \DTEST first, even though the fetch will also do it, so that no error occurs underneath the UNINTERRUPTABLY") (PROG (TAILEND JUNK) (UNINTERRUPTABLY [COND ((NOT (ffetch SYSQUEUEHEAD of Q)) (* ; "Empty queue") (freplace SYSQUEUEHEAD of Q with ITEM)) ([NULL (fetch QLINK of (SETQ TAILEND (ffetch SYSQUEUETAIL of Q] (* ;  "Normal case, SYSQUEUETAIL should have nothing after it") (freplace QLINK of TAILEND with ITEM)) (T (* ;; "SYSQUEUETAIL has non-null link? Shouldn't happen, but folks who are sloppy about there queues can have this happen. Need to signal an error, but first at least patch the queue up so that while you're sitting in the break you don't have more similar breaks") (SETQ JUNK (LIST* "Tail at:" (LOC TAILEND) "LINK:" (fetch QLINK of TAILEND) "Queue item locations:" (to 100 bind THISITEM (NEXTITEM _ (ffetch SYSQUEUEHEAD of Q)) while (SETQ NEXTITEM (ffetch QLINK of (SETQ THISITEM NEXTITEM)) ) collect (LOC THISITEM) finally (COND (THISITEM (replace QLINK of THISITEM with ITEM] (freplace QLINK of ITEM with NIL) (* ;  "Just for safety -- who knows what garbage may have creeped into the LINK slot of ITEM") (freplace SYSQUEUETAIL of Q with ITEM)) (AND JUNK (ERROR "Tail of queue has non-NIL link ptr" JUNK))) ITEM]) (\DEQUEUE [LAMBDA (Q) (* ; "Edited 28-Aug-91 18:41 by jds") (* ;; "Removes and returns the top item on Q, which should be a SYSQUEUE datatype. Returns NIL if queue is empty.") (SETQ Q (\DTEST Q 'SYSQUEUE)) (* ;; "Do this \DTEST first, even though the fetch will also do it, so that no error occurs underneath the UNINTERRUPTABLY") (UNINTERRUPTABLY (PROG ((ITEM (ffetch SYSQUEUEHEAD of Q))) (if ITEM then (* ;  "First, 'cdr' the link in the queue head") (if (NULL (freplace SYSQUEUEHEAD of Q with (ffetch QLINK of ITEM))) then (* ; "Exhausted queue") (freplace SYSQUEUETAIL of Q with NIL)) (freplace 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 'not '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")(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") (EPRECEIVING FLAG) (* ;  "True when a packet has been seen at the head of the network's input queue at least once") (NIL BITS 6) (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 WORD) (EPTIMESTAMP FIXP) (* ;  "Gets RCLK value when transmitted/received") (EPREQUEUEFN POINTER) (* ; "FN to perform requeueing") (NIL 4 WORD) (* ; "Space for expansion") (* ;  "Note: This next field wants to be quad+2 aligned so that the 10mb packet is quad+3 aligned") (EPENCAPSULATION 8 WORD) (* ;  "10mb encapsulation, or 3mb encapsulation with padding") (EPBODY 289 WORD) (* ;  "Body of packet, header up to 16 words plus data up to 546 bytes") )) (ACCESSFNS ETHERAUX ((AUXPTR (CDR (ASSOC 'AUXPTR (fetch EPPLIST of DATUM))) (\EP.PUT.AUX DATUM 'AUXPTR NEWVALUE)) (AUXWORD (OR (CDR (ASSOC 'AUXWORD (fetch EPPLIST of DATUM))) 0) (\EP.PUT.AUX DATUM 'AUXWORD NEWVALUE)) (AUXBYTE (OR (CDR (ASSOC 'AUXBYTE (fetch EPPLIST of DATUM))) 0) (\EP.PUT.AUX DATUM 'AUXBYTE NEWVALUE)))) ) (/DECLAREDATATYPE 'ETHERPACKET '(BYTE POINTER BYTE POINTER BYTE POINTER FLAG FLAG (BITS 6) POINTER BYTE POINTER BYTE POINTER WORD WORD FIXP 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) '((ETHERPACKET 0 (BITS . 7)) (ETHERPACKET 2 POINTER) (ETHERPACKET 1 (BITS . 7)) (ETHERPACKET 4 POINTER) (ETHERPACKET 1 (BITS . 135)) (ETHERPACKET 6 POINTER) (ETHERPACKET 6 (FLAGBITS . 0)) (ETHERPACKET 6 (FLAGBITS . 16)) (ETHERPACKET 0 (BITS . 133)) (ETHERPACKET 8 POINTER) (ETHERPACKET 10 (BITS . 7)) (ETHERPACKET 12 POINTER) (ETHERPACKET 11 (BITS . 7)) (ETHERPACKET 14 POINTER) (ETHERPACKET 16 (BITS . 15)) (ETHERPACKET 17 (BITS . 15)) (ETHERPACKET 18 FIXP) (ETHERPACKET 20 POINTER) (ETHERPACKET 22 (BITS . 15)) (ETHERPACKET 23 (BITS . 15)) (ETHERPACKET 24 (BITS . 15)) (ETHERPACKET 25 (BITS . 15)) (ETHERPACKET 26 (BITS . 15)) (ETHERPACKET 27 (BITS . 15)) (ETHERPACKET 28 (BITS . 15)) (ETHERPACKET 29 (BITS . 15)) (ETHERPACKET 30 (BITS . 15)) (ETHERPACKET 31 (BITS . 15)) (ETHERPACKET 32 (BITS . 15)) (ETHERPACKET 33 (BITS . 15)) (ETHERPACKET 34 (BITS . 15)) (ETHERPACKET 35 (BITS . 15)) (ETHERPACKET 36 (BITS . 15)) (ETHERPACKET 37 (BITS . 15)) (ETHERPACKET 38 (BITS . 15)) (ETHERPACKET 39 (BITS . 15)) (ETHERPACKET 40 (BITS . 15)) (ETHERPACKET 41 (BITS . 15)) (ETHERPACKET 42 (BITS . 15)) (ETHERPACKET 43 (BITS . 15)) (ETHERPACKET 44 (BITS . 15)) (ETHERPACKET 45 (BITS . 15)) (ETHERPACKET 46 (BITS . 15)) (ETHERPACKET 47 (BITS . 15)) (ETHERPACKET 48 (BITS . 15)) (ETHERPACKET 49 (BITS . 15)) (ETHERPACKET 50 (BITS . 15)) (ETHERPACKET 51 (BITS . 15)) (ETHERPACKET 52 (BITS . 15)) (ETHERPACKET 53 (BITS . 15)) (ETHERPACKET 54 (BITS . 15)) (ETHERPACKET 55 (BITS . 15)) (ETHERPACKET 56 (BITS . 15)) (ETHERPACKET 57 (BITS . 15)) (ETHERPACKET 58 (BITS . 15)) (ETHERPACKET 59 (BITS . 15)) (ETHERPACKET 60 (BITS . 15)) (ETHERPACKET 61 (BITS . 15)) (ETHERPACKET 62 (BITS . 15)) (ETHERPACKET 63 (BITS . 15)) (ETHERPACKET 64 (BITS . 15)) (ETHERPACKET 65 (BITS . 15)) (ETHERPACKET 66 (BITS . 15)) (ETHERPACKET 67 (BITS . 15)) (ETHERPACKET 68 (BITS . 15)) (ETHERPACKET 69 (BITS . 15)) (ETHERPACKET 70 (BITS . 15)) (ETHERPACKET 71 (BITS . 15)) (ETHERPACKET 72 (BITS . 15)) (ETHERPACKET 73 (BITS . 15)) (ETHERPACKET 74 (BITS . 15)) (ETHERPACKET 75 (BITS . 15)) (ETHERPACKET 76 (BITS . 15)) (ETHERPACKET 77 (BITS . 15)) (ETHERPACKET 78 (BITS . 15)) (ETHERPACKET 79 (BITS . 15)) (ETHERPACKET 80 (BITS . 15)) (ETHERPACKET 81 (BITS . 15)) (ETHERPACKET 82 (BITS . 15)) (ETHERPACKET 83 (BITS . 15)) (ETHERPACKET 84 (BITS . 15)) (ETHERPACKET 85 (BITS . 15)) (ETHERPACKET 86 (BITS . 15)) (ETHERPACKET 87 (BITS . 15)) (ETHERPACKET 88 (BITS . 15)) (ETHERPACKET 89 (BITS . 15)) (ETHERPACKET 90 (BITS . 15)) (ETHERPACKET 91 (BITS . 15)) (ETHERPACKET 92 (BITS . 15)) (ETHERPACKET 93 (BITS . 15)) (ETHERPACKET 94 (BITS . 15)) (ETHERPACKET 95 (BITS . 15)) (ETHERPACKET 96 (BITS . 15)) (ETHERPACKET 97 (BITS . 15)) (ETHERPACKET 98 (BITS . 15)) (ETHERPACKET 99 (BITS . 15)) (ETHERPACKET 100 (BITS . 15)) (ETHERPACKET 101 (BITS . 15)) (ETHERPACKET 102 (BITS . 15)) (ETHERPACKET 103 (BITS . 15)) (ETHERPACKET 104 (BITS . 15)) (ETHERPACKET 105 (BITS . 15)) (ETHERPACKET 106 (BITS . 15)) (ETHERPACKET 107 (BITS . 15)) (ETHERPACKET 108 (BITS . 15)) (ETHERPACKET 109 (BITS . 15)) (ETHERPACKET 110 (BITS . 15)) (ETHERPACKET 111 (BITS . 15)) (ETHERPACKET 112 (BITS . 15)) (ETHERPACKET 113 (BITS . 15)) (ETHERPACKET 114 (BITS . 15)) (ETHERPACKET 115 (BITS . 15)) (ETHERPACKET 116 (BITS . 15)) (ETHERPACKET 117 (BITS . 15)) (ETHERPACKET 118 (BITS . 15)) (ETHERPACKET 119 (BITS . 15)) (ETHERPACKET 120 (BITS . 15)) (ETHERPACKET 121 (BITS . 15)) (ETHERPACKET 122 (BITS . 15)) (ETHERPACKET 123 (BITS . 15)) (ETHERPACKET 124 (BITS . 15)) (ETHERPACKET 125 (BITS . 15)) (ETHERPACKET 126 (BITS . 15)) (ETHERPACKET 127 (BITS . 15)) (ETHERPACKET 128 (BITS . 15)) (ETHERPACKET 129 (BITS . 15)) (ETHERPACKET 130 (BITS . 15)) (ETHERPACKET 131 (BITS . 15)) (ETHERPACKET 132 (BITS . 15)) (ETHERPACKET 133 (BITS . 15)) (ETHERPACKET 134 (BITS . 15)) (ETHERPACKET 135 (BITS . 15)) (ETHERPACKET 136 (BITS . 15)) (ETHERPACKET 137 (BITS . 15)) (ETHERPACKET 138 (BITS . 15)) (ETHERPACKET 139 (BITS . 15)) (ETHERPACKET 140 (BITS . 15)) (ETHERPACKET 141 (BITS . 15)) (ETHERPACKET 142 (BITS . 15)) (ETHERPACKET 143 (BITS . 15)) (ETHERPACKET 144 (BITS . 15)) (ETHERPACKET 145 (BITS . 15)) (ETHERPACKET 146 (BITS . 15)) (ETHERPACKET 147 (BITS . 15)) (ETHERPACKET 148 (BITS . 15)) (ETHERPACKET 149 (BITS . 15)) (ETHERPACKET 150 (BITS . 15)) (ETHERPACKET 151 (BITS . 15)) (ETHERPACKET 152 (BITS . 15)) (ETHERPACKET 153 (BITS . 15)) (ETHERPACKET 154 (BITS . 15)) (ETHERPACKET 155 (BITS . 15)) (ETHERPACKET 156 (BITS . 15)) (ETHERPACKET 157 (BITS . 15)) (ETHERPACKET 158 (BITS . 15)) (ETHERPACKET 159 (BITS . 15)) (ETHERPACKET 160 (BITS . 15)) (ETHERPACKET 161 (BITS . 15)) (ETHERPACKET 162 (BITS . 15)) (ETHERPACKET 163 (BITS . 15)) (ETHERPACKET 164 (BITS . 15)) (ETHERPACKET 165 (BITS . 15)) (ETHERPACKET 166 (BITS . 15)) (ETHERPACKET 167 (BITS . 15)) (ETHERPACKET 168 (BITS . 15)) (ETHERPACKET 169 (BITS . 15)) (ETHERPACKET 170 (BITS . 15)) (ETHERPACKET 171 (BITS . 15)) (ETHERPACKET 172 (BITS . 15)) (ETHERPACKET 173 (BITS . 15)) (ETHERPACKET 174 (BITS . 15)) (ETHERPACKET 175 (BITS . 15)) (ETHERPACKET 176 (BITS . 15)) (ETHERPACKET 177 (BITS . 15)) (ETHERPACKET 178 (BITS . 15)) (ETHERPACKET 179 (BITS . 15)) (ETHERPACKET 180 (BITS . 15)) (ETHERPACKET 181 (BITS . 15)) (ETHERPACKET 182 (BITS . 15)) (ETHERPACKET 183 (BITS . 15)) (ETHERPACKET 184 (BITS . 15)) (ETHERPACKET 185 (BITS . 15)) (ETHERPACKET 186 (BITS . 15)) (ETHERPACKET 187 (BITS . 15)) (ETHERPACKET 188 (BITS . 15)) (ETHERPACKET 189 (BITS . 15)) (ETHERPACKET 190 (BITS . 15)) (ETHERPACKET 191 (BITS . 15)) (ETHERPACKET 192 (BITS . 15)) (ETHERPACKET 193 (BITS . 15)) (ETHERPACKET 194 (BITS . 15)) (ETHERPACKET 195 (BITS . 15)) (ETHERPACKET 196 (BITS . 15)) (ETHERPACKET 197 (BITS . 15)) (ETHERPACKET 198 (BITS . 15)) (ETHERPACKET 199 (BITS . 15)) (ETHERPACKET 200 (BITS . 15)) (ETHERPACKET 201 (BITS . 15)) (ETHERPACKET 202 (BITS . 15)) (ETHERPACKET 203 (BITS . 15)) (ETHERPACKET 204 (BITS . 15)) (ETHERPACKET 205 (BITS . 15)) (ETHERPACKET 206 (BITS . 15)) (ETHERPACKET 207 (BITS . 15)) (ETHERPACKET 208 (BITS . 15)) (ETHERPACKET 209 (BITS . 15)) (ETHERPACKET 210 (BITS . 15)) (ETHERPACKET 211 (BITS . 15)) (ETHERPACKET 212 (BITS . 15)) (ETHERPACKET 213 (BITS . 15)) (ETHERPACKET 214 (BITS . 15)) (ETHERPACKET 215 (BITS . 15)) (ETHERPACKET 216 (BITS . 15)) (ETHERPACKET 217 (BITS . 15)) (ETHERPACKET 218 (BITS . 15)) (ETHERPACKET 219 (BITS . 15)) (ETHERPACKET 220 (BITS . 15)) (ETHERPACKET 221 (BITS . 15)) (ETHERPACKET 222 (BITS . 15)) (ETHERPACKET 223 (BITS . 15)) (ETHERPACKET 224 (BITS . 15)) (ETHERPACKET 225 (BITS . 15)) (ETHERPACKET 226 (BITS . 15)) (ETHERPACKET 227 (BITS . 15)) (ETHERPACKET 228 (BITS . 15)) (ETHERPACKET 229 (BITS . 15)) (ETHERPACKET 230 (BITS . 15)) (ETHERPACKET 231 (BITS . 15)) (ETHERPACKET 232 (BITS . 15)) (ETHERPACKET 233 (BITS . 15)) (ETHERPACKET 234 (BITS . 15)) (ETHERPACKET 235 (BITS . 15)) (ETHERPACKET 236 (BITS . 15)) (ETHERPACKET 237 (BITS . 15)) (ETHERPACKET 238 (BITS . 15)) (ETHERPACKET 239 (BITS . 15)) (ETHERPACKET 240 (BITS . 15)) (ETHERPACKET 241 (BITS . 15)) (ETHERPACKET 242 (BITS . 15)) (ETHERPACKET 243 (BITS . 15)) (ETHERPACKET 244 (BITS . 15)) (ETHERPACKET 245 (BITS . 15)) (ETHERPACKET 246 (BITS . 15)) (ETHERPACKET 247 (BITS . 15)) (ETHERPACKET 248 (BITS . 15)) (ETHERPACKET 249 (BITS . 15)) (ETHERPACKET 250 (BITS . 15)) (ETHERPACKET 251 (BITS . 15)) (ETHERPACKET 252 (BITS . 15)) (ETHERPACKET 253 (BITS . 15)) (ETHERPACKET 254 (BITS . 15)) (ETHERPACKET 255 (BITS . 15)) (ETHERPACKET 256 (BITS . 15)) (ETHERPACKET 257 (BITS . 15)) (ETHERPACKET 258 (BITS . 15)) (ETHERPACKET 259 (BITS . 15)) (ETHERPACKET 260 (BITS . 15)) (ETHERPACKET 261 (BITS . 15)) (ETHERPACKET 262 (BITS . 15)) (ETHERPACKET 263 (BITS . 15)) (ETHERPACKET 264 (BITS . 15)) (ETHERPACKET 265 (BITS . 15)) (ETHERPACKET 266 (BITS . 15)) (ETHERPACKET 267 (BITS . 15)) (ETHERPACKET 268 (BITS . 15)) (ETHERPACKET 269 (BITS . 15)) (ETHERPACKET 270 (BITS . 15)) (ETHERPACKET 271 (BITS . 15)) (ETHERPACKET 272 (BITS . 15)) (ETHERPACKET 273 (BITS . 15)) (ETHERPACKET 274 (BITS . 15)) (ETHERPACKET 275 (BITS . 15)) (ETHERPACKET 276 (BITS . 15)) (ETHERPACKET 277 (BITS . 15)) (ETHERPACKET 278 (BITS . 15)) (ETHERPACKET 279 (BITS . 15)) (ETHERPACKET 280 (BITS . 15)) (ETHERPACKET 281 (BITS . 15)) (ETHERPACKET 282 (BITS . 15)) (ETHERPACKET 283 (BITS . 15)) (ETHERPACKET 284 (BITS . 15)) (ETHERPACKET 285 (BITS . 15)) (ETHERPACKET 286 (BITS . 15)) (ETHERPACKET 287 (BITS . 15)) (ETHERPACKET 288 (BITS . 15)) (ETHERPACKET 289 (BITS . 15)) (ETHERPACKET 290 (BITS . 15)) (ETHERPACKET 291 (BITS . 15)) (ETHERPACKET 292 (BITS . 15)) (ETHERPACKET 293 (BITS . 15)) (ETHERPACKET 294 (BITS . 15)) (ETHERPACKET 295 (BITS . 15)) (ETHERPACKET 296 (BITS . 15)) (ETHERPACKET 297 (BITS . 15)) (ETHERPACKET 298 (BITS . 15)) (ETHERPACKET 299 (BITS . 15)) (ETHERPACKET 300 (BITS . 15)) (ETHERPACKET 301 (BITS . 15)) (ETHERPACKET 302 (BITS . 15)) (ETHERPACKET 303 (BITS . 15)) (ETHERPACKET 304 (BITS . 15)) (ETHERPACKET 305 (BITS . 15)) (ETHERPACKET 306 (BITS . 15)) (ETHERPACKET 307 (BITS . 15)) (ETHERPACKET 308 (BITS . 15)) (ETHERPACKET 309 (BITS . 15)) (ETHERPACKET 310 (BITS . 15)) (ETHERPACKET 311 (BITS . 15)) (ETHERPACKET 312 (BITS . 15)) (ETHERPACKET 313 (BITS . 15)) (ETHERPACKET 314 (BITS . 15)) (ETHERPACKET 315 (BITS . 15)) (ETHERPACKET 316 (BITS . 15)) (ETHERPACKET 317 (BITS . 15)) (ETHERPACKET 318 (BITS . 15)) (ETHERPACKET 319 (BITS . 15)) (ETHERPACKET 320 (BITS . 15)) (ETHERPACKET 321 (BITS . 15)) (ETHERPACKET 322 (BITS . 15))) '324) (DECLARE%: EVAL@COMPILE (RPAQQ \EPT.PUP 512) (RPAQQ \EPT.XIP 1536) (RPAQQ \3MBTYPE.XIP 1536) (RPAQQ \10MBTYPE.XIP 1536) (RPAQQ \EPT.10TO3 1537) (RPAQQ \3MBTYPE.10TO3 1537) (RPAQQ \EPT.UNKNOWN 255) (CONSTANTS \EPT.PUP \EPT.XIP \3MBTYPE.XIP \10MBTYPE.XIP \EPT.10TO3 \3MBTYPE.10TO3 \EPT.UNKNOWN) ) (* "END EXPORTED DEFINITIONS") (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \FREE.PACKET.QUEUE \NEWPACKETCOUNTER) ) ) (/DECLAREDATATYPE 'ETHERPACKET '(BYTE POINTER BYTE POINTER BYTE POINTER FLAG FLAG (BITS 6) POINTER BYTE POINTER BYTE POINTER WORD WORD FIXP 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) '((ETHERPACKET 0 (BITS . 7)) (ETHERPACKET 2 POINTER) (ETHERPACKET 1 (BITS . 7)) (ETHERPACKET 4 POINTER) (ETHERPACKET 1 (BITS . 135)) (ETHERPACKET 6 POINTER) (ETHERPACKET 6 (FLAGBITS . 0)) (ETHERPACKET 6 (FLAGBITS . 16)) (ETHERPACKET 0 (BITS . 133)) (ETHERPACKET 8 POINTER) (ETHERPACKET 10 (BITS . 7)) (ETHERPACKET 12 POINTER) (ETHERPACKET 11 (BITS . 7)) (ETHERPACKET 14 POINTER) (ETHERPACKET 16 (BITS . 15)) (ETHERPACKET 17 (BITS . 15)) (ETHERPACKET 18 FIXP) (ETHERPACKET 20 POINTER) (ETHERPACKET 22 (BITS . 15)) (ETHERPACKET 23 (BITS . 15)) (ETHERPACKET 24 (BITS . 15)) (ETHERPACKET 25 (BITS . 15)) (ETHERPACKET 26 (BITS . 15)) (ETHERPACKET 27 (BITS . 15)) (ETHERPACKET 28 (BITS . 15)) (ETHERPACKET 29 (BITS . 15)) (ETHERPACKET 30 (BITS . 15)) (ETHERPACKET 31 (BITS . 15)) (ETHERPACKET 32 (BITS . 15)) (ETHERPACKET 33 (BITS . 15)) (ETHERPACKET 34 (BITS . 15)) (ETHERPACKET 35 (BITS . 15)) (ETHERPACKET 36 (BITS . 15)) (ETHERPACKET 37 (BITS . 15)) (ETHERPACKET 38 (BITS . 15)) (ETHERPACKET 39 (BITS . 15)) (ETHERPACKET 40 (BITS . 15)) (ETHERPACKET 41 (BITS . 15)) (ETHERPACKET 42 (BITS . 15)) (ETHERPACKET 43 (BITS . 15)) (ETHERPACKET 44 (BITS . 15)) (ETHERPACKET 45 (BITS . 15)) (ETHERPACKET 46 (BITS . 15)) (ETHERPACKET 47 (BITS . 15)) (ETHERPACKET 48 (BITS . 15)) (ETHERPACKET 49 (BITS . 15)) (ETHERPACKET 50 (BITS . 15)) (ETHERPACKET 51 (BITS . 15)) (ETHERPACKET 52 (BITS . 15)) (ETHERPACKET 53 (BITS . 15)) (ETHERPACKET 54 (BITS . 15)) (ETHERPACKET 55 (BITS . 15)) (ETHERPACKET 56 (BITS . 15)) (ETHERPACKET 57 (BITS . 15)) (ETHERPACKET 58 (BITS . 15)) (ETHERPACKET 59 (BITS . 15)) (ETHERPACKET 60 (BITS . 15)) (ETHERPACKET 61 (BITS . 15)) (ETHERPACKET 62 (BITS . 15)) (ETHERPACKET 63 (BITS . 15)) (ETHERPACKET 64 (BITS . 15)) (ETHERPACKET 65 (BITS . 15)) (ETHERPACKET 66 (BITS . 15)) (ETHERPACKET 67 (BITS . 15)) (ETHERPACKET 68 (BITS . 15)) (ETHERPACKET 69 (BITS . 15)) (ETHERPACKET 70 (BITS . 15)) (ETHERPACKET 71 (BITS . 15)) (ETHERPACKET 72 (BITS . 15)) (ETHERPACKET 73 (BITS . 15)) (ETHERPACKET 74 (BITS . 15)) (ETHERPACKET 75 (BITS . 15)) (ETHERPACKET 76 (BITS . 15)) (ETHERPACKET 77 (BITS . 15)) (ETHERPACKET 78 (BITS . 15)) (ETHERPACKET 79 (BITS . 15)) (ETHERPACKET 80 (BITS . 15)) (ETHERPACKET 81 (BITS . 15)) (ETHERPACKET 82 (BITS . 15)) (ETHERPACKET 83 (BITS . 15)) (ETHERPACKET 84 (BITS . 15)) (ETHERPACKET 85 (BITS . 15)) (ETHERPACKET 86 (BITS . 15)) (ETHERPACKET 87 (BITS . 15)) (ETHERPACKET 88 (BITS . 15)) (ETHERPACKET 89 (BITS . 15)) (ETHERPACKET 90 (BITS . 15)) (ETHERPACKET 91 (BITS . 15)) (ETHERPACKET 92 (BITS . 15)) (ETHERPACKET 93 (BITS . 15)) (ETHERPACKET 94 (BITS . 15)) (ETHERPACKET 95 (BITS . 15)) (ETHERPACKET 96 (BITS . 15)) (ETHERPACKET 97 (BITS . 15)) (ETHERPACKET 98 (BITS . 15)) (ETHERPACKET 99 (BITS . 15)) (ETHERPACKET 100 (BITS . 15)) (ETHERPACKET 101 (BITS . 15)) (ETHERPACKET 102 (BITS . 15)) (ETHERPACKET 103 (BITS . 15)) (ETHERPACKET 104 (BITS . 15)) (ETHERPACKET 105 (BITS . 15)) (ETHERPACKET 106 (BITS . 15)) (ETHERPACKET 107 (BITS . 15)) (ETHERPACKET 108 (BITS . 15)) (ETHERPACKET 109 (BITS . 15)) (ETHERPACKET 110 (BITS . 15)) (ETHERPACKET 111 (BITS . 15)) (ETHERPACKET 112 (BITS . 15)) (ETHERPACKET 113 (BITS . 15)) (ETHERPACKET 114 (BITS . 15)) (ETHERPACKET 115 (BITS . 15)) (ETHERPACKET 116 (BITS . 15)) (ETHERPACKET 117 (BITS . 15)) (ETHERPACKET 118 (BITS . 15)) (ETHERPACKET 119 (BITS . 15)) (ETHERPACKET 120 (BITS . 15)) (ETHERPACKET 121 (BITS . 15)) (ETHERPACKET 122 (BITS . 15)) (ETHERPACKET 123 (BITS . 15)) (ETHERPACKET 124 (BITS . 15)) (ETHERPACKET 125 (BITS . 15)) (ETHERPACKET 126 (BITS . 15)) (ETHERPACKET 127 (BITS . 15)) (ETHERPACKET 128 (BITS . 15)) (ETHERPACKET 129 (BITS . 15)) (ETHERPACKET 130 (BITS . 15)) (ETHERPACKET 131 (BITS . 15)) (ETHERPACKET 132 (BITS . 15)) (ETHERPACKET 133 (BITS . 15)) (ETHERPACKET 134 (BITS . 15)) (ETHERPACKET 135 (BITS . 15)) (ETHERPACKET 136 (BITS . 15)) (ETHERPACKET 137 (BITS . 15)) (ETHERPACKET 138 (BITS . 15)) (ETHERPACKET 139 (BITS . 15)) (ETHERPACKET 140 (BITS . 15)) (ETHERPACKET 141 (BITS . 15)) (ETHERPACKET 142 (BITS . 15)) (ETHERPACKET 143 (BITS . 15)) (ETHERPACKET 144 (BITS . 15)) (ETHERPACKET 145 (BITS . 15)) (ETHERPACKET 146 (BITS . 15)) (ETHERPACKET 147 (BITS . 15)) (ETHERPACKET 148 (BITS . 15)) (ETHERPACKET 149 (BITS . 15)) (ETHERPACKET 150 (BITS . 15)) (ETHERPACKET 151 (BITS . 15)) (ETHERPACKET 152 (BITS . 15)) (ETHERPACKET 153 (BITS . 15)) (ETHERPACKET 154 (BITS . 15)) (ETHERPACKET 155 (BITS . 15)) (ETHERPACKET 156 (BITS . 15)) (ETHERPACKET 157 (BITS . 15)) (ETHERPACKET 158 (BITS . 15)) (ETHERPACKET 159 (BITS . 15)) (ETHERPACKET 160 (BITS . 15)) (ETHERPACKET 161 (BITS . 15)) (ETHERPACKET 162 (BITS . 15)) (ETHERPACKET 163 (BITS . 15)) (ETHERPACKET 164 (BITS . 15)) (ETHERPACKET 165 (BITS . 15)) (ETHERPACKET 166 (BITS . 15)) (ETHERPACKET 167 (BITS . 15)) (ETHERPACKET 168 (BITS . 15)) (ETHERPACKET 169 (BITS . 15)) (ETHERPACKET 170 (BITS . 15)) (ETHERPACKET 171 (BITS . 15)) (ETHERPACKET 172 (BITS . 15)) (ETHERPACKET 173 (BITS . 15)) (ETHERPACKET 174 (BITS . 15)) (ETHERPACKET 175 (BITS . 15)) (ETHERPACKET 176 (BITS . 15)) (ETHERPACKET 177 (BITS . 15)) (ETHERPACKET 178 (BITS . 15)) (ETHERPACKET 179 (BITS . 15)) (ETHERPACKET 180 (BITS . 15)) (ETHERPACKET 181 (BITS . 15)) (ETHERPACKET 182 (BITS . 15)) (ETHERPACKET 183 (BITS . 15)) (ETHERPACKET 184 (BITS . 15)) (ETHERPACKET 185 (BITS . 15)) (ETHERPACKET 186 (BITS . 15)) (ETHERPACKET 187 (BITS . 15)) (ETHERPACKET 188 (BITS . 15)) (ETHERPACKET 189 (BITS . 15)) (ETHERPACKET 190 (BITS . 15)) (ETHERPACKET 191 (BITS . 15)) (ETHERPACKET 192 (BITS . 15)) (ETHERPACKET 193 (BITS . 15)) (ETHERPACKET 194 (BITS . 15)) (ETHERPACKET 195 (BITS . 15)) (ETHERPACKET 196 (BITS . 15)) (ETHERPACKET 197 (BITS . 15)) (ETHERPACKET 198 (BITS . 15)) (ETHERPACKET 199 (BITS . 15)) (ETHERPACKET 200 (BITS . 15)) (ETHERPACKET 201 (BITS . 15)) (ETHERPACKET 202 (BITS . 15)) (ETHERPACKET 203 (BITS . 15)) (ETHERPACKET 204 (BITS . 15)) (ETHERPACKET 205 (BITS . 15)) (ETHERPACKET 206 (BITS . 15)) (ETHERPACKET 207 (BITS . 15)) (ETHERPACKET 208 (BITS . 15)) (ETHERPACKET 209 (BITS . 15)) (ETHERPACKET 210 (BITS . 15)) (ETHERPACKET 211 (BITS . 15)) (ETHERPACKET 212 (BITS . 15)) (ETHERPACKET 213 (BITS . 15)) (ETHERPACKET 214 (BITS . 15)) (ETHERPACKET 215 (BITS . 15)) (ETHERPACKET 216 (BITS . 15)) (ETHERPACKET 217 (BITS . 15)) (ETHERPACKET 218 (BITS . 15)) (ETHERPACKET 219 (BITS . 15)) (ETHERPACKET 220 (BITS . 15)) (ETHERPACKET 221 (BITS . 15)) (ETHERPACKET 222 (BITS . 15)) (ETHERPACKET 223 (BITS . 15)) (ETHERPACKET 224 (BITS . 15)) (ETHERPACKET 225 (BITS . 15)) (ETHERPACKET 226 (BITS . 15)) (ETHERPACKET 227 (BITS . 15)) (ETHERPACKET 228 (BITS . 15)) (ETHERPACKET 229 (BITS . 15)) (ETHERPACKET 230 (BITS . 15)) (ETHERPACKET 231 (BITS . 15)) (ETHERPACKET 232 (BITS . 15)) (ETHERPACKET 233 (BITS . 15)) (ETHERPACKET 234 (BITS . 15)) (ETHERPACKET 235 (BITS . 15)) (ETHERPACKET 236 (BITS . 15)) (ETHERPACKET 237 (BITS . 15)) (ETHERPACKET 238 (BITS . 15)) (ETHERPACKET 239 (BITS . 15)) (ETHERPACKET 240 (BITS . 15)) (ETHERPACKET 241 (BITS . 15)) (ETHERPACKET 242 (BITS . 15)) (ETHERPACKET 243 (BITS . 15)) (ETHERPACKET 244 (BITS . 15)) (ETHERPACKET 245 (BITS . 15)) (ETHERPACKET 246 (BITS . 15)) (ETHERPACKET 247 (BITS . 15)) (ETHERPACKET 248 (BITS . 15)) (ETHERPACKET 249 (BITS . 15)) (ETHERPACKET 250 (BITS . 15)) (ETHERPACKET 251 (BITS . 15)) (ETHERPACKET 252 (BITS . 15)) (ETHERPACKET 253 (BITS . 15)) (ETHERPACKET 254 (BITS . 15)) (ETHERPACKET 255 (BITS . 15)) (ETHERPACKET 256 (BITS . 15)) (ETHERPACKET 257 (BITS . 15)) (ETHERPACKET 258 (BITS . 15)) (ETHERPACKET 259 (BITS . 15)) (ETHERPACKET 260 (BITS . 15)) (ETHERPACKET 261 (BITS . 15)) (ETHERPACKET 262 (BITS . 15)) (ETHERPACKET 263 (BITS . 15)) (ETHERPACKET 264 (BITS . 15)) (ETHERPACKET 265 (BITS . 15)) (ETHERPACKET 266 (BITS . 15)) (ETHERPACKET 267 (BITS . 15)) (ETHERPACKET 268 (BITS . 15)) (ETHERPACKET 269 (BITS . 15)) (ETHERPACKET 270 (BITS . 15)) (ETHERPACKET 271 (BITS . 15)) (ETHERPACKET 272 (BITS . 15)) (ETHERPACKET 273 (BITS . 15)) (ETHERPACKET 274 (BITS . 15)) (ETHERPACKET 275 (BITS . 15)) (ETHERPACKET 276 (BITS . 15)) (ETHERPACKET 277 (BITS . 15)) (ETHERPACKET 278 (BITS . 15)) (ETHERPACKET 279 (BITS . 15)) (ETHERPACKET 280 (BITS . 15)) (ETHERPACKET 281 (BITS . 15)) (ETHERPACKET 282 (BITS . 15)) (ETHERPACKET 283 (BITS . 15)) (ETHERPACKET 284 (BITS . 15)) (ETHERPACKET 285 (BITS . 15)) (ETHERPACKET 286 (BITS . 15)) (ETHERPACKET 287 (BITS . 15)) (ETHERPACKET 288 (BITS . 15)) (ETHERPACKET 289 (BITS . 15)) (ETHERPACKET 290 (BITS . 15)) (ETHERPACKET 291 (BITS . 15)) (ETHERPACKET 292 (BITS . 15)) (ETHERPACKET 293 (BITS . 15)) (ETHERPACKET 294 (BITS . 15)) (ETHERPACKET 295 (BITS . 15)) (ETHERPACKET 296 (BITS . 15)) (ETHERPACKET 297 (BITS . 15)) (ETHERPACKET 298 (BITS . 15)) (ETHERPACKET 299 (BITS . 15)) (ETHERPACKET 300 (BITS . 15)) (ETHERPACKET 301 (BITS . 15)) (ETHERPACKET 302 (BITS . 15)) (ETHERPACKET 303 (BITS . 15)) (ETHERPACKET 304 (BITS . 15)) (ETHERPACKET 305 (BITS . 15)) (ETHERPACKET 306 (BITS . 15)) (ETHERPACKET 307 (BITS . 15)) (ETHERPACKET 308 (BITS . 15)) (ETHERPACKET 309 (BITS . 15)) (ETHERPACKET 310 (BITS . 15)) (ETHERPACKET 311 (BITS . 15)) (ETHERPACKET 312 (BITS . 15)) (ETHERPACKET 313 (BITS . 15)) (ETHERPACKET 314 (BITS . 15)) (ETHERPACKET 315 (BITS . 15)) (ETHERPACKET 316 (BITS . 15)) (ETHERPACKET 317 (BITS . 15)) (ETHERPACKET 318 (BITS . 15)) (ETHERPACKET 319 (BITS . 15)) (ETHERPACKET 320 (BITS . 15)) (ETHERPACKET 321 (BITS . 15)) (ETHERPACKET 322 (BITS . 15))) '324) (ADDTOVAR SYSTEMRECLST (DATATYPE ETHERPACKET ((NIL BYTE) (EPLINK POINTER) (EPFLAGS BYTE) (EPUSERFIELD POINTER) (NIL BYTE) (EPPLIST POINTER) (EPTRANSMITTING FLAG) (EPRECEIVING FLAG) (NIL BITS 6) (EPREQUEUE POINTER) (NIL BYTE) (EPSOCKET POINTER) (NIL BYTE) (EPNETWORK POINTER) (EPTYPE WORD) (NIL WORD) (EPTIMESTAMP FIXP) (EPREQUEUEFN POINTER) (NIL 4 WORD) (EPENCAPSULATION 8 WORD) (EPBODY 289 WORD))) ) (DEFINEQ (\ALLOCATE.ETHERPACKET [LAMBDA NIL (* bvm%: "14-Feb-85 21:58") (DECLARE (GLOBALVARS \NEWPACKETCOUNTER)) (PROG ((PACKET (\DEQUEUE \FREE.PACKET.QUEUE))) (RETURN (COND (PACKET (\CLEARWORDS (fetch XIPBASE of PACKET) (FOLDHI \XIPOVLEN BYTESPERWORD)) (* ;  "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 an ETHERPACKET -- might want to let GC do it, but GC doesn't happen often enough") (\DTEST EPKT 'ETHERPACKET) (COND ([NOT (AND (ffetch EPTRANSMITTING of EPKT) (PROGN (freplace EPREQUEUE of EPKT with '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 'AUXPTR) ([LAMBDA (CELL) (PutUnboxed CELL VAL) (SETQ VAL CELL] (CREATECELL \FIXP] (push (fetch EPPLIST of PKT) (CONS KEY VAL))) ((EQ KEY 'AUXPTR) (RPLACD A VAL)) (T (PutUnboxed (CDR A) VAL) (SETQ VAL (CDR A] (RETURN VAL]) ) (RPAQ? \FREE.PACKET.QUEUE (NCREATE 'SYSQUEUE)) (RPAQ? \NEWPACKETCOUNTER 5) (/DECLAREDATATYPE 'NSADDRESS '(FIXP WORD WORD WORD WORD) '((NSADDRESS 0 FIXP) (NSADDRESS 2 (BITS . 15)) (NSADDRESS 3 (BITS . 15)) (NSADDRESS 4 (BITS . 15)) (NSADDRESS 5 (BITS . 15))) '6) (RPAQ? \MY.NSHOSTNUMBER NIL) (RPAQ? \MY.NSNETNUMBER NIL) (RPAQ? \MY.NSADDRESS NIL) (RPAQ? *NSADDRESS-FORMAT* NIL) (CL:PROCLAIM '(CL:SPECIAL *NSADDRESS-FORMAT*)) (RPAQQ BROADCASTNSHOSTNUMBER (NSHOSTNUMBER 65535 65535 65535)) (DEFINEQ (\SETLOCALNSNUMBERS [LAMBDA (TYPE) (* bvm%: "14-Feb-85 00:38") [SETQ \MY.NSHOSTNUMBER (COND ((NEQ (LOGOR (fetch (IFPAGE NSHost0) of \InterfacePage) (fetch (IFPAGE NSHost1) of \InterfacePage) (fetch (IFPAGE NSHost2) of \InterfacePage)) 0) (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 _ 5349 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 'NSADDRESS) BASE) A]) (\PRINTNSADDRESS [LAMBDA (BASE FILE) (* ; "Edited 13-Jan-88 12:44 by bvm") (LET [(\THISFILELINELENGTH (LET [(L (fetch (STREAM LINELENGTH) of (SETQ FILE (\GETSTREAM FILE 'OUTPUT] (SELECTC L (0 (* ; "Some default") \LINELENGTH) (MAX.SMALLP (* ; "Infinite") NIL) L] (DECLARE (SPECVARS \THISFILELINELENGTH)) (* ;  "Set up important printing variable, and call the internal printer") (\NSADDRESS.DEFPRINT BASE FILE) ""]) (\NSADDRESS.DEFPRINT [LAMBDA (BASE STREAM) (* ; "Edited 14-Jan-88 17:41 by bvm") (LET ((*PRINT-BASE* (if (EQ *NSADDRESS-FORMAT* :DECIMAL) then 10 else 8)) (SHARP "#") (NET (+ (CL:ASH (\GETBASE BASE 0) 16) (\GETBASE BASE 1))) (SOCKET (\GETBASE BASE 5)) HOST) (SELECTQ *NSADDRESS-FORMAT* ((:DECIMAL :OCTAL) (* ;  "Need to fetch whole 48-bit host number") (SETQ HOST (+ (CL:ASH (\GETBASE BASE 2) 32) (CL:ASH (\GETBASE BASE 3) 16) (\GETBASE BASE 4)))) NIL) [.SPACECHECK. STREAM (+ (if (< SOCKET 8) then (* ;  "Just one socket digit (plus 2 #'s)") 3 else (* ; "Allow up to 6 socket digits") 8) (SELECTQ *NSADDRESS-FORMAT* (:DECIMAL (+ (if (< NET 10000) then (* ;  "Numbers up to 9-999 all take this") 5 else (* ; "Numbers up to 2^32-1") 13) (if (NEQ 0 (\GETBASE BASE 2)) then (* ; "Numbers up to 2^48-1") 19 elseif (NEQ 0 (\GETBASE BASE 3)) then (* ; "Numbers up to 2^32-1") 13 else (* ; "Numbers up to 2^16-1") 6))) (+ (IQUOTIENT (+ (CL:INTEGER-LENGTH NET) 2) 3) (if HOST then (IQUOTIENT (+ (CL:INTEGER-LENGTH HOST) 2) 3) elseif (< (\GETBASE BASE 2) 8) then (* ; "Guess n.nnnnnn.nnnnnn") 15 else (* ; "Guess nnnnnn.nnnnnn.nnnnnn") 19] (if (EQ *NSADDRESS-FORMAT* :DECIMAL) then (if (EQ NET 0) then (* ; "Seems silly to print %"0-000%"") (PRIN3 "0" STREAM) else (\NSADDRESS.PRINT.DECIMAL NET STREAM)) (PRIN3 SHARP STREAM) (\NSADDRESS.PRINT.DECIMAL HOST STREAM) else (PRIN3 NET STREAM) (PRIN3 SHARP STREAM) (if HOST then (* ;  "OCTAL format prints host as one number") (PRIN3 HOST STREAM) else (PRIN3 (\GETBASE BASE 2) STREAM) (PRIN3 "." STREAM) (PRIN3 (\GETBASE BASE 3) STREAM) (PRIN3 "." STREAM) (PRIN3 (\GETBASE BASE 4) STREAM))) (PRIN3 SHARP STREAM) (if (NEQ SOCKET 0) then (* ; "Omit defaulted socket") (PRIN3 SOCKET STREAM)) T]) (\NSADDRESS.PRINT.DECIMAL [LAMBDA (NUM STREAM) (* ; "Edited 13-Jan-88 22:07 by bvm") (* ;; "Print NUM to STREAM in XNS Services decimal format: numbers are in decimal, separated by dashes every 3rd character. Must be at least one dash. Assumes caller bound *PRINT-BASE* to 10.") (while (> NUM 999) bind (ZERO _ "0") PIECES REM do (* ;  "Collect decimal pieces of the whole number") (CL:MULTIPLE-VALUE-SETQ (NUM REM) (CL:TRUNCATE NUM 1000)) (push PIECES REM) finally (if (NULL PIECES) then (* ;  "Less than 4-digit number, so pad with leading 0") (PRIN3 ZERO STREAM) else (PRIN3 NUM STREAM) (* ;  "Leading number need not be padded") (SETQ NUM (pop PIECES))) (do (PRIN3 "-" STREAM) (* ; "Start an internal component") (if (< NUM 100) then (* ; "Pad small numbers to 3 digits") (PRIN3 ZERO STREAM) (if (< NUM 10) then (PRIN3 ZERO STREAM))) (PRIN3 NUM STREAM) (if (NULL PIECES) then (* ; "Done") (RETURN) else (* ;  "Do another piece. Awkward control structure reduces consing for small numbers") (SETQ NUM (pop PIECES]) (\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%: "24-Apr-86 16:16") (printout FILE .I1.8 (fetch NSHOST0 of NSHOSTNUMBER) "." .I1.8 (fetch NSHOST1 of NSHOSTNUMBER) "." .I1.8 (fetch NSHOST2 of NSHOSTNUMBER]) ) (DECLARE%: DONTEVAL@LOAD DOCOPY (DEFPRINT 'NSADDRESS '\NSADDRESS.DEFPRINT) ) (* ; "Assorted Level 0") (DEFINEQ (\ETHERINIT [LAMBDA NIL (* ; "Edited 13-Jan-88 14:37 by bvm") (* ;;; "This gets us EVENT action to take care of pup stuff around LOGOUT, etc.") (MOVD '\RELEASE.ETHERPACKET 'RELEASE.PUP NIL T) (MOVD '\ALLOCATE.ETHERPACKET 'ALLOCATE.PUP NIL T) (\DEFINEDEVICE NIL (create FDEV DEVICENAME _ 'ETHER EVENTFN _ (FUNCTION \ETHEREVENTFN) DIRECTORYNAMEP _ 'NILL HOSTNAMEP _ 'NILL]) (\ETHEREVENTFN [LAMBDA (DEV EVENT) (* ; "Edited 3-May-2021 23:12 by larry") (PROG (NDB TURNOFFNS TIMESET) (SELECTQ EVENT ((NIL AFTERLOGOUT AFTERSYSOUT AFTERMAKESYS AFTERSAVEVM RESTART) (SETQ \PUP.READY (SETQ \NS.READY (SETQ \IP.READY))) (OR (\ETHER-AVAILABLE) (RETURN)) (\SETETHERFLAGS) (\SETLOCALNSNUMBERS) (\FLUSHNDBS EVENT) (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 10 we can find out our pup number, which is done via NS protocol") (\NSINIT EVENT) (SETQ TIMESET (\NS.SETTIME] (\STARTPUP EVENT) (COND (TURNOFFNS (STOPNS))) (COND (\GATEWAYFLG (\INIT.GATEWAY))) (for FN in RESTARTETHERFNS do (CL:FUNCALL FN EVENT)) T) ((BEFOREMAKESYS BEFORELOGOUT BEFORESYSOUT BEFORESAVEVM) (COND ((EQ EVENT 'BEFORESAVEVM) (* ;  "Save passwords in place outside vmem to avoid having to reenter them later") (\STASH.PASSWORDS)) (T (* ;  "No need to flush this before SAVEVM") (CLRHASH \ETHERPORTS))) (CLRHASH LOGINPASSWORDS)) NIL]) (\ETHER-AVAILABLE [LAMBDA NIL (* ; "Edited 3-May-2021 23:12 by larry") (SUBRCALL ETHER-AVAILABLE]) (\TIME.NOT.SET [LAMBDA NIL (* ; "Edited 13-Jan-88 14:40 by bvm") (* ;; "Called at startup if we fail to set the time. Separate function so you can redefine it to do something interesting, like demand the time") (printout PROMPTWINDOW T "[Time not set]"]) (\SETETHERFLAGS [LAMBDA NIL (* ; "Edited 2-May-2021 12:35 by larry") (* ;; "for Medley there is no 3MB ethernet ; used to be conditional on \MACHINETYPE") (SETQ \10MBFLG 0) (SETQ \3MBFLG NIL) (SETQ *MAXIMUM-PACKET-SIZE* (- (TIMES 2 BYTESPERPAGE) (UNFOLD (INDEXF (FETCH EPBODY)) BYTESPERWORD]) (\FLUSHNDBS [LAMBDA (EVENT) (* ; "Edited 15-Jan-88 00:30 by bvm") (bind NDB QUEUE while (SETQ NDB \LOCALNDBS) do (SETQ \LOCALNDBS (fetch NDBNEXT of NDB)) (replace NDBNEXT of NDB with NIL) (COND ((EQ EVENT 'RESTART) (CL:FUNCALL (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 '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 'INPUT) (replace NDBIQ of NDB with NIL]) (\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 'RESTART) (SETQ IOCB (fetch EPNETWORK of PACKET))) (\RELEASE.IOCB IOCB USE))) (\RELEASE.ETHERPACKET PACKET]) ) (DEFINEQ (\CHECKSUM [LAMBDA (BASE NWORDS INITSUM) (* bvm%: "14-Feb-85 22:20") (PROG ((CHECKSUM (COND (INITSUM (LOGAND INITSUM MASKWORD1'S)) (T 0))) (ADDR BASE) (CNT NWORDS)) (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") (COND ([IGREATERP CHECKSUM (SETQ CHECKSUM (IPLUS16 CHECKSUM (\GETBASE ADDR 0] (* ;  "There was a carry, so add it back in -- 'end around carry'") (add CHECKSUM 1))) [SETQ CHECKSUM (COND ((IGREATERP CHECKSUM 32767) (LOGOR 1 (LLSH (LOGAND CHECKSUM 32767 ) 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]) (\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 65535) (CONSTANTS (\NULLCHECKSUM 65535)) ) (* "END EXPORTED DEFINITIONS") (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \PACKET.FILTERS \ETHERLIGHTNING RESTARTETHERFNS) ) ) (RPAQ? \PACKET.FILTERS NIL) (RPAQ? \ETHERLIGHTNING ) (RPAQ? RESTARTETHERFNS ) (DECLARE%: DONTEVAL@LOAD DOCOPY (\ETHERINIT) (MOVD? 'NILL 'BLOCK) (MOVD? 'NILL '\STASH.PASSWORDS) ) (* ; "Assorted routing stuff") (DECLARE%: DONTCOPY (* "FOLLOWING DEFINITIONS EXPORTED")(DECLARE%: EVAL@COMPILE (DATATYPE NDB ((NETTYPE BYTE) (* ; "10 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) (* ;  "(NDB PACKET) -- fn to send a raw packet on this net. returns NIL on failure") (NIL BYTE) (NDBENCAPSULATOR POINTER) (* ;  "(NDB PACKET HOST LENGTH TYPE) -- fn to encapsulate and send a higher-level packet on this net ") (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) (NDBCANHEARSELF POINTER) (* ;  "True if receiver can hear packets sent by transmitter") (NDBIPNET# POINTER) (NDBIPHOST# POINTER) (NDBPUPTYPE WORD) (* ;  "The packet encapsulation of PUP on this net") (NIL WORD) (NIL POINTER) (* ; "Spares") )) (RECORD ROUTING (RTNET# RTHOPCOUNT RTGATEWAY# RTNDB RTTIMER RTRECENT)) ) (/DECLAREDATATYPE 'NDB '(BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER POINTER BYTE POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER WORD WORD POINTER) '((NDB 0 (BITS . 7)) (NDB 2 POINTER) (NDB 1 (BITS . 7)) (NDB 4 POINTER) (NDB 1 (BITS . 135)) (NDB 6 POINTER) (NDB 0 (BITS . 135)) (NDB 8 POINTER) (NDB 10 (BITS . 7)) (NDB 12 POINTER) (NDB 14 POINTER) (NDB 11 (BITS . 7)) (NDB 16 POINTER) (NDB 18 POINTER) (NDB 20 POINTER) (NDB 22 POINTER) (NDB 24 POINTER) (NDB 26 POINTER) (NDB 28 POINTER) (NDB 30 POINTER) (NDB 32 (BITS . 15)) (NDB 33 (BITS . 15)) (NDB 34 POINTER)) '36) (* "END EXPORTED DEFINITIONS") (DECLARE%: EVAL@COMPILE (RPAQQ \RT.INFINITY 16) (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 \CHECK.ROUTING.TABLE MACRO [(TABLE) (if (NEQ (NTYPX TABLE) \ROUTING.TABLE.TYPENUM) then (CL:ERROR 'CONDITIONS:SIMPLE-TYPE-ERROR :CULPRIT TABLE :EXPECTED-TYPE 'RoutingTable]) ) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \RT.TIMEOUTINTERVAL \RT.AGEINTERVAL \RT.PURGEFLG \GATEWAYFLG \ROUTING.TABLE.MASK \ROUTING.TABLE.TYPENUM) ) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \3MBFLG \10MBFLG \3MBLOCALNDB \10MBLOCALNDB \LOCALNDBS \NSFLG \IPFLG \NS.ROUTING.TABLE \PUP.ROUTING.TABLE \NS.READY \PUP.READY \IP.READY) ) ) (/DECLAREDATATYPE 'NDB '(BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER BYTE POINTER POINTER BYTE POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER WORD WORD POINTER) '((NDB 0 (BITS . 7)) (NDB 2 POINTER) (NDB 1 (BITS . 7)) (NDB 4 POINTER) (NDB 1 (BITS . 135)) (NDB 6 POINTER) (NDB 0 (BITS . 135)) (NDB 8 POINTER) (NDB 10 (BITS . 7)) (NDB 12 POINTER) (NDB 14 POINTER) (NDB 11 (BITS . 7)) (NDB 16 POINTER) (NDB 18 POINTER) (NDB 20 POINTER) (NDB 22 POINTER) (NDB 24 POINTER) (NDB 26 POINTER) (NDB 28 POINTER) (NDB 30 POINTER) (NDB 32 (BITS . 15)) (NDB 33 (BITS . 15)) (NDB 34 POINTER)) '36) (ADDTOVAR SYSTEMRECLST (DATATYPE NDB ((NETTYPE BYTE) (NDBNEXT POINTER) (NDBPUPNET# BYTE) (NDBNSNET# POINTER) (NDBTASK# BYTE) (NDBBROADCASTP POINTER) (NDBPUPHOST# BYTE) (NDBTRANSMITTER POINTER) (NIL BYTE) (NDBENCAPSULATOR POINTER) (NDBCSB POINTER) (NDBIQLENGTH BYTE) (NDBIQ POINTER) (NDBTQ POINTER) (NDBTRANSLATIONS POINTER) (NDBETHERFLUSHER POINTER) (NDBWATCHER POINTER) (NDBCANHEARSELF POINTER) (NDBIPNET# POINTER) (NDBIPHOST# POINTER) (NDBPUPTYPE WORD) (NIL WORD) (NIL POINTER))) ) (DEFINEQ (ENCAPSULATE.ETHERPACKET [LAMBDA (NDB PACKET PDH NBYTES ETYPE) (* bvm%: "10-JUN-83 12:11") (APPLY* (ffetch NDBENCAPSULATOR of (\DTEST NDB 'NDB)) NDB (\DTEST PACKET 'ETHERPACKET) PDH NBYTES ETYPE]) (TRANSMIT.ETHERPACKET [LAMBDA (NDB PACKET) (* bvm%: "10-JUN-83 12:15") (APPLY* (ffetch NDBTRANSMITTER of (\DTEST NDB 'NDB)) NDB (\DTEST PACKET 'ETHERPACKET]) ) (* ;; "Routing table management. Table is naked array of specified size (choices are 8, 16, 32, 64, based on availability of pointer hunks for those sizes). These are global vars rather than constants so you can play with them (but you'd better restart ether immediately)." ) (DEFINEQ (\AGE.ROUTING.TABLE [LAMBDA (TABLE) (* ; "Edited 14-Jan-88 23:37 by bvm") (* ;; "Call this every now and then to age the entries in a routing table.") (LET (ENTRY BUCKET) (\CHECK.ROUTING.TABLE TABLE) (for I from 0 to \ROUTING.TABLE.MASK do (* ;  "Walk down %"hash%" table, scanning each bucket for entries that have expired") [if (SETQ BUCKET (\GETBASEPTR TABLE 0)) then (for (TAIL _ BUCKET) by (CDR TAIL) while TAIL bind PURGED when (AND (NEQ (fetch RTHOPCOUNT of (SETQ ENTRY (CAR TAIL))) 0) (TIMEREXPIRED? (fetch RTTIMER of ENTRY))) do (* ; "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))) (\RT.PURGEFLG (* ; "Purge old entry") (RPLACA TAIL NIL) (SETQ PURGED T))) finally (if PURGED then (\RPLPTR TABLE 0 (DREMOVE NIL BUCKET] (SETQ TABLE (\ADDBASE TABLE WORDSPERCELL]) (\ADD.ROUTING.TABLE.ENTRY [LAMBDA (TABLE ENTRY) (* ; "Edited 14-Jan-88 23:33 by bvm") (* ;; "Add a new ENTRY to routing table TABLE. TABLE is a naked pointer array whose elements (%"buckets%") are lists of routing entries. Hash from the low bits of the net number to one of these buckets.") (\CHECK.ROUTING.TABLE TABLE) (SETQ TABLE (\ADDBASE TABLE (UNFOLD (LOGAND (fetch RTNET# of ENTRY) \ROUTING.TABLE.MASK) WORDSPERCELL))) (* ; "Compute bucket location") (\RPLPTR TABLE 0 (CONS ENTRY (\GETBASEPTR TABLE 0))) ENTRY]) (\CLEAR.ROUTING.TABLE [LAMBDA (OLDTABLE) (* ; "Edited 14-Jan-88 23:56 by bvm") (* ;; "Restore OLDTABLE to virgin state, or create a fresh one") (if (AND OLDTABLE (EQ (NTYPX OLDTABLE) \ROUTING.TABLE.TYPENUM)) then (* ;  "Clear old table. Second clause checks that someone didn't change the size on us.") (for I from 0 to \ROUTING.TABLE.MASK as (BASE _ OLDTABLE) by (\ADDBASE BASE WORDSPERCELL) do (\RPLPTR BASE 0 NIL)) OLDTABLE else (\CREATECELL \ROUTING.TABLE.TYPENUM]) (\MAP.ROUTING.TABLE [LAMBDA (TABLE MAPFN) (* ; "Edited 14-Jan-88 23:47 by bvm") (* ;; "Call MAPFN for each routing info entry in TABLE. We permit MAPFN to remove the entry.") (\CHECK.ROUTING.TABLE TABLE) (for I from 0 to \ROUTING.TABLE.MASK as (BASE _ TABLE) by (\ADDBASE BASE WORDSPERCELL) do (for ENTRY in (APPEND (\GETBASEPTR BASE 0)) do (CL:FUNCALL MAPFN ENTRY]) (PRINTROUTINGTABLE [LAMBDA (TABLE SORTFLG FILE) (* ; "Edited 15-Jan-88 02:41 by bvm") (SELECTQ TABLE (NS (SETQ TABLE \NS.ROUTING.TABLE)) ((NIL PUP) (SETQ TABLE \PUP.ROUTING.TABLE)) NIL) (\CHECK.ROUTING.TABLE TABLE) (SETQ FILE (\GETSTREAM FILE 'OUTPUT)) (LET ([ENTRIES (for I from 0 to \ROUTING.TABLE.MASK as (BASE _ TABLE) by (\ADDBASE BASE WORDSPERCELL) join (APPEND (\GETBASEPTR BASE 0] [TB (if \10MBLOCALNDB then (* ;; "There is at least one 10mb net on this machine, so gateways can be ns addresses, so leave lots of space. Longest ns address is 0#177777.177777.177777# = 23 chars") (CONSTANT (+ 7 2 (NCHARS "0#177777.177777.177777#") 2)) else (* ;  "Gateways are pup numbers, max 3 digits, but we'll be generous and use 5") (CONSTANT (+ 2 (NCHARS " Net# Gateway "] (DECP (AND (EQ TABLE \NS.ROUTING.TABLE) (EQ *NSADDRESS-FORMAT* :DECIMAL))) GATE NET) (printout FILE " Net#" .CENTER (- TB 2) "Gateway" .TAB (- TB 2) "#Hops Recent?" T) (for ENTRY in (COND (SORTFLG (SORT ENTRIES (if (EQ SORTFLG :HOPS) then (* ; "Sort by hops") [FUNCTION (LAMBDA (X Y) (< (fetch RTHOPCOUNT of X) (fetch RTHOPCOUNT of Y] else (* ; "Sort by net, which is car") T))) (T ENTRIES)) do (SETQ NET (fetch RTNET# of ENTRY)) (if DECP then (SPACES (- 7 (IMAX 4 (NCHARS NET))) FILE) (* ; "Right-justify nets that are shorter than 7 chars in decimal rep. Everything is at least as long as 0-nnn.") (\NSADDRESS.PRINT.DECIMAL NET FILE) else (printout FILE .I7.8 NET)) (COND ((NOT (SETQ GATE (fetch RTGATEWAY# of ENTRY))) (SPACES 4 FILE) (PRIN1 "---" FILE)) ((FIXP GATE) (printout FILE .I7.8 GATE)) (T (SPACES 2 FILE) (PRIN3 GATE FILE))) (printout FILE .TAB TB .I2 (fetch RTHOPCOUNT of ENTRY) (COND ((fetch RTRECENT of ENTRY) " Yes") ((TIMEREXPIRED? (fetch RTTIMER of ENTRY)) " timed out") (T " No")) T))) (TERPRI FILE]) (\ROUTINGTABLE.INFOHOOK [LAMBDA (PROC BUTTON) (* ; "Edited 15-Jan-88 03:08 by bvm") (* ;; "Info hook for gate listener processes. Displays routing table in a window. We keep track of the window so as to reuse it.") (LET ((TYPE (PROCESSPROP PROC :PROTOCOL)) (WINDOW (PROCESSPROP PROC :WINDOW)) (TEDITP (GETD 'OPENTEXTSTREAM)) (FONT (FONTCREATE 'GACHA 8)) TABLE STREAM NUMENTRIES) (SETQ NUMENTRIES (if (SETQ TABLE (SELECTQ TYPE (NS \NS.ROUTING.TABLE) (PUP \PUP.ROUTING.TABLE) NIL)) then (\CHECK.ROUTING.TABLE TABLE) (for I from 0 to \ROUTING.TABLE.MASK as (BASE _ TABLE) by (\ADDBASE BASE WORDSPERCELL) sum (LENGTH (\GETBASEPTR BASE 0))) else (* ; "Some other protocol?") 99)) (if (NOT WINDOW) then [PROCESSPROP PROC :WINDOW (SETQ WINDOW (CREATEW (GETBOXREGION (WIDTHIFWINDOW (TIMES (CHARWIDTH (CHARCODE X) FONT) (if \10MBLOCALNDB then (* ;  "Let it get wide--see PRINTROUTINGTABLE") 50 else 36))) (HEIGHTIFWINDOW (TIMES (FONTPROP FONT 'HEIGHT) (IMIN (ADD1 NUMENTRIES ) (if TEDITP then (* ;  "Doesn't have to be very tall, since we can scroll") 30 else 40))) T)) (CONCAT TYPE " Routing Info"] (WINDOWPROP WINDOW :NAME (PROCESSPROP PROC 'NAME)) (* ;  "Save process by name to avoid worrying about circular links") [WINDOWADDPROP WINDOW 'CLOSEFN (FUNCTION (LAMBDA (WINDOW) (* ;  "Forget the window once it's closed") (PROCESSPROP (WINDOWPROP WINDOW :NAME) :WINDOW NIL] else (CLEARW WINDOW)) [PRINTROUTINGTABLE TYPE (EQ BUTTON 'MIDDLE) (SETQ STREAM (if TEDITP then (* ;  "Faster to write to a core file first") (OPENSTREAM '{NODIRCORE} 'BOTH) else (* ; "Write straight to the window") (DSPFONT FONT WINDOW) (WINDOWPROP WINDOW 'DSP] (if TEDITP then (OPENTEXTSTREAM STREAM WINDOW NIL NIL `(FONT ,FONT READONLY T]) ) (RPAQ? \RT.TIMEOUTINTERVAL 90000) (RPAQ? \RT.AGEINTERVAL 30000) (RPAQ? \RT.PURGEFLG T) (RPAQ? \GATEWAYFLG NIL) (RPAQ? \ROUTING.TABLE.MASK 31) (RPAQ? \ROUTING.TABLE.TYPENUM (\TYPENUMBERFROMNAME (PACK* "\PTRHUNK" (ADD1 \ROUTING.TABLE.MASK)))) (RPAQ? \3MBFLG T) (RPAQ? \10MBFLG ) (RPAQ? \3MBLOCALNDB ) (RPAQ? \10MBLOCALNDB ) (RPAQ? \LOCALNDBS ) (RPAQ? \NSFLG ) (RPAQ? \IPFLG ) (* ; "10 to 3 translation ugliness") (DEFINEQ (\TRANSLATE.10TO3 [LAMBDA (NSADDR NDB) (* ; "Edited 14-Jan-88 19:40 by bvm") (* ;; "Translate from an NSADDR 48-bit address 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") (for TRANS in (ffetch NDBTRANSLATIONS of (\DTEST NDB 'NDB)) when (EQNSADDRESS.HOST NSADDR (CAR TRANS)) do (* ; "translation already in cache") (RETURN (CADR TRANS)) finally (* ;;  "Initiate a probe, and return failure for now. Next call may find it in the cache") (LET ((PACKET (\ALLOCATE.ETHERPACKET))) (replace EPTYPE of PACKET with \EPT.10TO3) (freplace TRANSOPERATION of PACKET with \TRANS.OP.REQUEST) (\BLT (LOCF (FETCH BASETRANSNSHOST of PACKET)) (LOCF (FETCH NSHNM0 OF NSADDR)) 3) (\BLT (LOCF (FETCH BASETRANSSENDERNSHOST of PACKET)) (LOCF (FETCH NSHNM0 OF \MY.NSADDRESS)) 3) (freplace TRANSSENDERPUPHOST of PACKET with (ffetch NDBPUPHOST# of NDB)) (ENCAPSULATE.ETHERPACKET NDB PACKET 0 \TRANS.DATALENGTH \EPT.10TO3) (AND XIPTRACEFLG (\MAYBEPRINTPACKET PACKET 'PUT)) (freplace EPREQUEUE of PACKET with 'FREE) (TRANSMIT.ETHERPACKET NDB PACKET)) (RETURN NIL]) (\NOTE.10TO3 [LAMBDA (NSADDR PUPADDRESS NDB) (* ; "Edited 14-Jan-88 19:40 by bvm") (* ;  "Update cache to include this pairing") (for TRANS in (ffetch NDBTRANSLATIONS of (\DTEST NDB 'NDB)) bind (HOST _ (fetch PUPHOST# of PUPADDRESS)) when (EQNSADDRESS.HOST NSADDR (CAR TRANS)) do (* ;  "translation already in cache--update it") (RETURN (RPLACA (CDR TRANS) HOST)) finally (* ; "Add a new translation to cache") (LET ((BOX (create NSADDRESS))) (* ;  "Copy address into an NSADDRESS object") (\BLT (LOCF (FETCH NSHNM0 OF BOX)) (LOCF (FETCH NSHNM0 OF NSADDR)) 3) (push (ffetch NDBTRANSLATIONS of NDB) (LIST BOX HOST (CLOCK 0]) (\HANDLE.RAW.10TO3 [LAMBDA (PACKET TYPE) (* ; "Edited 15-Jan-88 00:47 by bvm") (* ;; "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 'GET)) [SELECTC (fetch TRANSOPERATION of PACKET) (\TRANS.OP.REQUEST (COND ([AND (EQNSADDRESS.HOST (fetch TRANSNSADDRESS of PACKET) \MY.NSADDRESS) (>= (fetch 3MBLENGTH of PACKET) (+ \3MBENCAPSULATION.WORDS (FOLDHI \TRANS.DATALENGTH BYTESPERWORD ] (* ;  "It's for us, and it's big enough") (\NOTE.10TO3 (fetch TRANSSENDERNSADDRESS of PACKET) (fetch TRANSSENDERPUPHOST of PACKET) NDB) (* ; "Add sender's address to cache") (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 'TRANS XIPIGNORETYPES)) (PRINT10TO3 PACKET 'PUT XIPTRACEFILE)) (replace EPREQUEUE of PACKET with 'FREE) (TRANSMIT.ETHERPACKET NDB PACKET) (RETURN)))) (\TRANS.OP.RESPONSE (* ;  "Add the information to the cache") (\NOTE.10TO3 (fetch TRANSNSADDRESS 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 ((TRANSNSHOST (\LOADNSHOSTNUMBER (LOCF DATUM)) (\STORENSHOSTNUMBER (LOCF DATUM) NEWVALUE] (ACCESSFNS BASETRANSSENDERNSHOST ((TRANSSENDERNSHOST (\LOADNSHOSTNUMBER (LOCF DATUM)) (\STORENSHOSTNUMBER (LOCF DATUM) NEWVALUE] [ACCESSFNS ETHERTRANS ([TRANSNSADDRESS (PROGN (* ;  "Kludge to get a pointer that looks like a full ns address") (\ADDBASE DATUM (CONSTANT (+ (INDEXF (FETCH (ETHERPACKET EPBODY) of T)) (INDEXF (FETCH (ETHERTRANS BASETRANSNSHOST ) of T)) -2] (TRANSSENDERNSADDRESS (\ADDBASE DATUM (CONSTANT (+ (INDEXF (FETCH (ETHERPACKET EPBODY) of T)) (INDEXF (FETCH (ETHERTRANS BASETRANSSENDERNSHOST ) of T)) -2] (TYPE? (type? ETHERPACKET DATUM))) ) (DECLARE%: EVAL@COMPILE (RPAQQ \TRANS.OP.REQUEST 4161) (RPAQQ \TRANS.OP.RESPONSE 3640) (RPAQQ \TRANS.DATALENGTH 18) (CONSTANTS \TRANS.OP.REQUEST \TRANS.OP.RESPONSE \TRANS.DATALENGTH) ) ) (* ; "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) (* ; "Edited 3-May-91 17:10 by jds") (PROG ((TYPE (fetch EPTYPE of PACKET)) NDB) (SELECTQ (SELECTC TYPE (\EPT.PUP PUPTRACEFLG) XIPTRACEFLG) (NIL) (PEEK (PRIN1 (SELECTQ CALLER ((GET RAWGET) (COND ((BROADCASTP PACKET) '*) (T '+))) ((PUT RAWPUT) (COND ((BROADCASTP PACKET) '^) (T '!))) '?) (OR FILE (SELECTC TYPE (\EPT.PUP PUPTRACEFILE) XIPTRACEFILE)))) (RAW [SELECTQ CALLER ((RAWGET RAWPUT) (PRINTPACKET PACKET CALLER FILE PRE.NOTE T)) (PRIN1 (SELECTQ CALLER (GET '%#) (PUT '^) '?) (OR FILE (SELECTC TYPE (\EPT.PUP PUPTRACEFILE) XIPTRACEFILE]) (PROGN (PRINTPACKET PACKET CALLER FILE PRE.NOTE T) (BLOCK]) (PRINT10TO3 [LAMBDA (EPKT CALLER FILE PRE.NOTE DOFILTER) (* bvm%: "14-Feb-85 00:38") (COND ((OR (NOT DOFILTER) (NOT (MEMB 'TRANS XIPIGNORETYPES))) (OR FILE (SETQ FILE XIPTRACEFILE)) (FRESHLINE 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") (* ;;; ": subsequent commands apply starting at this byte offset") (* ;;; ": 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 _ 'WORDS) (STREAM _ (GETSTREAM FILE '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) 'S))) (IFSSTRING (* ;  "Hack. Data is assumed to be a string whose first word is its length. For Leaf") (SETQ TMP (\GETBASE BASE (FOLDLO OFFSET BYTESPERWORD))) (printout STREAM '{ .P2 TMP '}) (add OFFSET 2) (SETQ TILOFFSET (CEIL (IPLUS OFFSET TMP) BYTESPERWORD)) [COND ((NEQ DATATYPE 'BYTES) (SETQ DATATYPE 'CHARS]) (|...| (PRIN1 '|...| 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 127)) (\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 '%[ CHAR '%]] (add OFFSET 1)) (BYTES (printout STREAM '%[ (\GETBASEBYTE BASE OFFSET) '%]) (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 'ETHERPACKET] by (fetch EPLINK of PACKET) while PACKET do (PRINTPACKET PACKET CALLER FILE]) (TIME.SINCE.PACKET [LAMBDA (PACKET) (* bvm%: "26-OCT-83 15:46") (* ;; "Returns time in milliseconds since PACKET's EPTIMESTAMP was last set") (PROG ((CLK1 (\RCLK (\CREATECELL \FIXP))) (CLK0 (\CREATECELL \FIXP))) (\BLT CLK0 (LOCF (fetch EPTIMESTAMP of PACKET)) WORDSPERCELL) (RETURN (IQUOTIENT (\BOXIDIFFERENCE CLK1 CLK0) \RCLKMILLISECOND]) (MAKE-NETWORK-TRACE-WINDOW [LAMBDA (FLGVAR STREAMVAR TITLE REGION FLG) (* ; "Edited 14-Jan-88 18:06 by bvm") (* ;; "Create a window for controlling network tracing. FLGVAR and STREAMVAR are the variables controlling whether and where tracing occurs. TITLE and REGION are for creating the window, FLG is the initial value of FLGVAR (defaults to T) ") (LET (W DS) [if (WINDOWP (SETQ W (EVALV STREAMVAR))) then (SETQ DS (WINDOWPROP W 'DSP)) elseif [NOT (AND (DISPLAYSTREAMP W) (SETQ W (WFROMDS (SETQ DS W) T] then (SETQ DS (WINDOWPROP (SETQ W (CREATEW REGION TITLE)) 'DSP] (TOTOPW W) (WINDOWPROP W 'FLG&STREAM (CONS FLGVAR STREAMVAR)) [WINDOWPROP W 'BUTTONEVENTFN (FUNCTION (LAMBDA (WINDOW) (* ; "Left or middle changes state") (COND ((LASTMOUSESTATE (NOT UP)) (\CHANGE.ETHER.TRACING WINDOW (CAR (WINDOWPROP WINDOW 'FLG&STREAM] [WINDOWPROP W 'CLOSEFN (FUNCTION (LAMBDA (WINDOW) (* ; "Closing turns off tracing") (DESTRUCTURING-BIND (FLG . STRM) (WINDOWPROP WINDOW 'FLG&STREAM) (COND ((EQ (WINDOWPROP WINDOW 'DSP) (EVALV STRM)) (SET FLG NIL) (SET STRM T] [WINDOWPROP W 'SHRINKFN (FUNCTION (LAMBDA (WINDOW) (* ;  "Turn off tracing while window shrunk") (DESTRUCTURING-BIND (FLG . STRM) (WINDOWPROP WINDOW 'FLG&STREAM) (COND ((EQ (WINDOWPROP WINDOW 'DSP) (EVALV STRM)) (WINDOWPROP WINDOW FLG (EVALV FLG)) (SET FLG NIL] [WINDOWPROP W 'EXPANDFN (FUNCTION (LAMBDA (WINDOW) (* ;  "Restore tracing to previous state") (DESTRUCTURING-BIND (FLG . STRM) (WINDOWPROP WINDOW 'FLG&STREAM) (COND ((EQ (WINDOWPROP WINDOW 'DSP) (EVALV STRM)) (SET FLG (WINDOWPROP WINDOW FLG NIL] (DSPFONT (FONTCREATE 'GACHA 8) DS) (DSPSCROLL T DS) (TOTOPW W) (SET STREAMVAR DS) (SET FLGVAR (OR FLG T]) (\CHANGE.ETHER.TRACING [LAMBDA (WINDOW FLGNAME) (* bvm%: "11-JUL-83 17:14") (printout WINDOW .TAB0 0 "[Tracing " (COND [(LASTMOUSESTATE LEFT) (SELECTQ (EVALV FLGNAME) (NIL (SET FLGNAME T) "On]") (T (SET FLGNAME 'PEEK) "Brief]") (COND ((OR (NOT \RAWTRACING) (EQ (EVALV FLGNAME) 'RAW)) (SET FLGNAME NIL) "Off]") (T (SET FLGNAME 'RAW) "only Raw]"] (T (COND (\RAWTRACING (SETQ \RAWTRACING NIL) "Raw Off]") (T (SETQ \RAWTRACING T) "Raw On]"]) ) (RPAQ? \RAWTRACING ) (ADDTOVAR \PACKET.PRINTERS (512 . PRINTPUP) (1537 . PRINT10TO3)) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \RAWTRACING \PACKET.PRINTERS PUPTRACEFILE XIPTRACEFILE \RCLKMILLISECOND) ) (* ; "For PUP/XIPTRACETIME, functions to convert time from internal ticks to decimal fractions of a second." ) (DEFINEQ (\CENTICLOCK [LAMBDA (PACKET) (* bvm%: "26-OCT-83 15:42") (* ;;; "Returns a relative time in centiseconds. If PACKET is given, the time is a translation of its EPTIMESTAMP; otherwise the time is now") (PROG ((CLK \CENTICLOCKBOX)) (COND (PACKET (\BLT CLK (LOCF (fetch EPTIMESTAMP of PACKET)) WORDSPERCELL)) (T (\RCLK CLK))) (replace CENTICLOCKSIGNBIT of CLK with 0) (RETURN (IQUOTIENT CLK (OR \CENTICLOCKFACTOR (SETQ \CENTICLOCKFACTOR (ITIMES 10 \RCLKMILLISECOND ]) ) (RPAQQ \CENTICLOCKFACTOR NIL) (RPAQ \CENTICLOCKBOX (NCREATE 'FIXP)) (ADDTOVAR \SYSTEMCACHEVARS \CENTICLOCKFACTOR) (DECLARE%: EVAL@COMPILE DONTCOPY (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \CENTICLOCKFACTOR \CENTICLOCKBOX) ) (DECLARE%: EVAL@COMPILE (BLOCKRECORD CENTICLOCK ((CENTICLOCKSIGNBIT BITS 1) (CENTICLOCKMAGNITUDE BITS 31))) ) ) (* ; "3MB stuff, which is not needed in DandeLion") (DEFINEQ (\3MBGETPACKET [LAMBDA NIL (* bvm%: "26-OCT-83 15:16") (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) (\RCLK (LOCF (fetch EPTIMESTAMP of PACKET))) (replace EPNETWORK of PACKET with \3MBLOCALNDB) (replace EPTYPE of PACKET with (fetch 3MBTYPE of PACKET)) [COND (\RAWTRACING (\MAYBEPRINTPACKET PACKET 'RAWGET] PACKET]) (\3MB.CREATENDB [LAMBDA NIL (* bvm%: "15-Feb-85 22:18") (create NDB NDBPUPHOST# _ (\SERIALNUMBER) NDBPUPNET# _ 0 NDBNSNET# _ 0 NETTYPE _ 3 NDBPUPTYPE _ \3MBTYPE.PUP NDBTRANSMITTER _ (FUNCTION \3MBSENDPACKET) NDBENCAPSULATOR _ (FUNCTION \3MBENCAPSULATE) NDBBROADCASTP _ (FUNCTION \3MB.BROADCASTP) NDBETHERFLUSHER _ (FUNCTION NILL) NDBWATCHER _ (ADD.PROCESS '(\3MBWATCHER) 'RESTARTABLE 'SYSTEM 'AFTEREXIT 'DELETE]) (\3MBSENDPACKET [LAMBDA (NDB PACKET) (* ; "Edited 17-May-88 14:34 by bvm") (* ;; "Sends raw seething etherpacket on the 3mb net denoted by NDB") (SETQ PACKET (\DTEST PACKET 'ETHERPACKET)) (LET ((NWORDS (fetch 3MBLENGTH of PACKET)) S) (AND \RAWTRACING (\MAYBEPRINTPACKET PACKET 'RAWPUT)) [COND ((> (UNFOLD (- NWORDS \3MBENCAPSULATION.WORDS) BYTESPERWORD) *MAXIMUM-PACKET-SIZE*) (CL:CERROR "Drop the packet" "Attempt to send ~D-byte packet, longer than this machine's packet size limit" (UNFOLD (- NWORDS \3MBENCAPSULATION.WORDS) BYTESPERWORD))) ((OR (NULL \ETHERLIGHTNING) (NEQ (RAND 0 \ETHERLIGHTNING) 0)) (if [NOT (UNINTERRUPTABLY (LET ((PBI (\GETPACKETBUFFER))) (if PBI then (* ;  "Got bcpl buffer, so blt our packet into there and send it off") (\BLT (fetch PBIRAWSTART of PBI) (fetch 3MBBASE of PACKET) (ADD1 NWORDS)) (\WRITERAWPBI PBI) (\BOXIPLUS (LOCF (fetch NETIOOPS of \MISCSTATS)) 1))))] then (* ; "Failed to get a packet buffer") (if [AND \RAWTRACING (SETQ S (SELECTC (fetch EPTYPE of PACKET) (\EPT.PUP (AND PUPTRACEFLG PUPTRACEFILE)) (AND XIPTRACEFLG XIPTRACEFILE] then (PRIN1 'x S] (\REQUEUE.ETHERPACKET PACKET) T]) (\3MBWATCHER [LAMBDA NIL (* bvm%: "26-OCT-83 15:21") (* ;;; "Process that watches the 3mb net and pulls packets in, passing them to the raw packet handler") (PROG ((CNTR 0) PACKET) LP [COND ((SETQ PACKET (\3MBGETPACKET)) (* ; "Got something") (\HANDLE.RAW.PACKET PACKET) (COND ((ILESSP (add CNTR 1) \MAXWATCHERGETS) (* ;  "Hack to get better ether service in lieu of preemption") (GO LP] (BLOCK) (SETQ CNTR 0) (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%: "14-Feb-85 00:38") (EQ (fetch 3MBDESTHOST of PACKET) 0]) (\3MBFLUSH [LAMBDA (ASPROC) (* bvm%: "18-FEB-83 17:10") (PROG NIL LP (RETURN (PROG1 (while (\READRAWPBI) sum 1) (COND (ASPROC (BLOCK 5000) (GO LP))))]) ) (RPAQ? \MAXWATCHERGETS 5) (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 13) (PBITIMER WORD) (PBILENGTH WORD) (PBIENCAPSULATION 2 WORD) (PBIFIRSTPUPWORD 10 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) (RPAQQ \3MBTYPE.PUP 512) (CONSTANTS \3MBENCAPSULATION.WORDS \3MBTYPE.PUP) ) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS \MAXWATCHERGETS *MAXIMUM-PACKET-SIZE*) ) ) (* ; "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 '\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 (* ; "Edited 15-Jan-88 01:30 by bvm") (PROG (PROC) (AND (SETQ PROC (FIND.PROCESS '\PUPGATELISTENER)) (SUSPEND.PROCESS PROC)) (AND (SETQ PROC (FIND.PROCESS '\NSGATELISTENER)) (SUSPEND.PROCESS PROC))) (\ETHEREVENTFN NIL 'RESTART]) (TURN.OFF.ETHER [LAMBDA NIL (* bvm%: "12-JUL-83 14:03") (BREAKCONNECTION T) (DEL.PROCESS '\PUPGATELISTENER) (DEL.PROCESS '\NSGATELISTENER) (CLOSEPUPSOCKET T) (AND (GETD 'CLOSENSOCKET) (CLOSENSOCKET T)) (\FLUSHNDBS '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 ")")) (DECLARE%: EVAL@COMPILE DONTCOPY (DECLARE%: DOEVAL@COMPILE DONTCOPY (LOCALVARS . T) ) ) (* ; "Opcodes") (DEFINEQ (\DEVICE.INPUT [LAMBDA (TASKREG) (* bvm%: "12-JUL-82 13:29") ((OPCODES MISC1 1) (\DTEST TASKREG 'SMALLP]) (\DEVICE.OUTPUT [LAMBDA (VALUE TASKREG) (* bvm%: "12-JUL-82 13:29") ((OPCODES MISC2 2) (\DTEST VALUE 'SMALLP) (\DTEST TASKREG 'SMALLP]) (\D0.STARTIO [LAMBDA (BITS) (* bvm%: "12-JUL-82 13:28") ((OPCODES MISC1 0) (\DTEST BITS 'SMALLP]) ) (DECLARE%: DONTCOPY (RPAQQ D0DEVICES ((\DEVICE.3MBETHERIN 7) (\DEVICE.3MBETHEROUT 6) (\DEVICE.10MBETHER 21) (\DEVICE.SA4000 3) (\DEVICE.DISPLAY 2))) (DECLARE%: EVAL@COMPILE (RPAQQ \DEVICE.3MBETHERIN 7) (RPAQQ \DEVICE.3MBETHEROUT 6) (RPAQQ \DEVICE.10MBETHER 21) (RPAQQ \DEVICE.SA4000 3) (RPAQQ \DEVICE.DISPLAY 2) (CONSTANTS (\DEVICE.3MBETHERIN 7) (\DEVICE.3MBETHEROUT 6) (\DEVICE.10MBETHER 21) (\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 ("Venue & Xerox Corporation" 1982 1983 1984 1985 1986 1987 1988 1990 1991 1992 1993 2021)) (DECLARE%: DONTCOPY (FILEMAP (NIL (10792 19248 (CANONICAL.HOSTNAME 10802 . 12391) (\ENQUEUE 12393 . 15038) (\DEQUEUE 15040 . 16367) (\QUEUELENGTH 16369 . 16669) (\ONQUEUE 16671 . 16937) (\UNQUEUE 16939 . 19246)) (52949 56815 (\ALLOCATE.ETHERPACKET 52959 . 54000) (\RELEASE.ETHERPACKET 54002 . 55075) (RELEASE.PUP 55077 . 55222 ) (\FLUSH.PACKET.QUEUE 55224 . 55575) (\REQUEUE.ETHERPACKET 55577 . 56091) (\EP.PUT.AUX 56093 . 56813) ) (57389 68770 (\SETLOCALNSNUMBERS 57399 . 58784) (\LOADNSADDRESS 58786 . 59078) (\STORENSADDRESS 59080 . 59261) (\PRINTNSADDRESS 59263 . 60346) (\NSADDRESS.DEFPRINT 60348 . 65293) ( \NSADDRESS.PRINT.DECIMAL 65295 . 67426) (\LOADNSHOSTNUMBER 67428 . 68057) (\STORENSHOSTNUMBER 68059 . 68463) (PRINTNSHOSTNUMBER 68465 . 68768)) (68883 74631 (\ETHERINIT 68893 . 69463) (\ETHEREVENTFN 69465 . 71997) (\ETHER-AVAILABLE 71999 . 72157) (\TIME.NOT.SET 72159 . 72485) (\SETETHERFLAGS 72487 . 72938 ) (\FLUSHNDBS 72940 . 74118) (\FLUSH.NDB.QUEUE 74120 . 74629)) (74632 77924 (\CHECKSUM 74642 . 76574) (\HANDLE.RAW.OTHER 76576 . 76931) (\HANDLE.RAW.PACKET 76933 . 77445) (\ADD.PACKET.FILTER 77447 . 77679 ) (\DEL.PACKET.FILTER 77681 . 77922)) (85757 86282 (ENCAPSULATE.ETHERPACKET 85767 . 86039) ( TRANSMIT.ETHERPACKET 86041 . 86280)) (86570 99166 (\AGE.ROUTING.TABLE 86580 . 88729) ( \ADD.ROUTING.TABLE.ENTRY 88731 . 89427) (\CLEAR.ROUTING.TABLE 89429 . 90156) (\MAP.ROUTING.TABLE 90158 . 90686) (PRINTROUTINGTABLE 90688 . 94313) (\ROUTINGTABLE.INFOHOOK 94315 . 99164)) (99651 106436 ( \TRANSLATE.10TO3 99661 . 101445) (\NOTE.10TO3 101447 . 103063) (\HANDLE.RAW.10TO3 103065 . 106434)) ( 110418 125240 (PRINTPACKET 110428 . 110989) (\MAYBEPRINTPACKET 110991 . 112648) (PRINT10TO3 112650 . 114018) (PRINTPACKETDATA 114020 . 119310) (PRINTPACKETQUEUE 119312 . 119741) (TIME.SINCE.PACKET 119743 . 120228) (MAKE-NETWORK-TRACE-WINDOW 120230 . 123772) (\CHANGE.ETHER.TRACING 123774 . 125238)) ( 125611 126426 (\CENTICLOCK 125621 . 126424)) (126881 132981 (\3MBGETPACKET 126891 . 128311) ( \3MB.CREATENDB 128313 . 129028) (\3MBSENDPACKET 129030 . 131213) (\3MBWATCHER 131215 . 131953) ( \3MBENCAPSULATE 131955 . 132503) (\3MB.BROADCASTP 132505 . 132676) (\3MBFLUSH 132678 . 132979)) ( 135935 137878 (ASSURE.ETHER.ON 135945 . 136275) (INITPUPLEVEL1 136277 . 136757) (TURN.ON.ETHER 136759 . 136904) (RESTART.ETHER 136906 . 137280) (TURN.OFF.ETHER 137282 . 137600) (PRINTWORDS 137602 . 137876)) (138153 138688 (\DEVICE.INPUT 138163 . 138328) (\DEVICE.OUTPUT 138330 . 138524) (\D0.STARTIO 138526 . 138686))))) STOP