(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED "19-Jan-93 10:53:19" {DSK}lde>lispcore>sources>LLNSDECLS.;2 13142 changes to%: (RECORDS NSADDRESS NSOCKET XIP ERRORXIP NSHOSTNUMBER) previous date%: "17-Dec-92 12:59:22" {DSK}lde>lispcore>sources>LLNSDECLS.;1) (* ; " Copyright (c) 1985, 1986, 1987, 1988, 1990, 1992, 1993 by Venue & Xerox Corporation. All rights reserved. ") (PRETTYCOMPRINT LLNSDECLSCOMS) (RPAQQ LLNSDECLSCOMS [(COMS (* ;  "XIP layout (Xerox Internet Packet)") (RECORDS XIP) (CONSTANTS \XIPOVLEN \MAX.XIPDATALENGTH) (CONSTANTS * RAWXIPTYPES)) (COMS (* ; "NSOCKET datatype") (RECORDS NSOCKET) (* ; "Well-known NS sockets") (CONSTANTS (\NS.WKS.RoutingInformation 1) (\NS.WKS.Echo 2) (\NS.WKS.PUPLOOKUP 9))) (COMS (* ; "ERRORXIP -- overlays XIP") (RECORDS ERRORXIP) (CONSTANTS * XIPERRORCODES)) (COMS (* ; "NSADDRESS") (RECORDS NSADDRESS NSHOSTNUMBER) (MACROS LOADNSHOSTNUMBER STORENSHOSTNUMBER \MOVENSADDRESSES \SWAPNSADDRESSES) (CONSTANTS (\#WDS.NSADDRESS 6) (\#WDS.NSHOSTNUMBER 3)) (MACROS \LOCALNSHOSTNUMBER \LOCALNSNETNUMBER \LOCALNSADDRESS \BLTLOCALHOSTNUMBER) (GLOBALVARS BROADCASTNSHOSTNUMBER \MY.NSADDRESS \MY.NSHOSTNUMBER \MY.NSNETNUMBER) (MACROS EQNSHOSTNUMBER EQNSADDRESS.HOST EQBROADCASTBASE EQNSHOSTBASE) (FNS TRANSLATE.NSH) (ADDVARS (DONTCOMPILEFNS TRANSLATE.NSH]) (* ; "XIP layout (Xerox Internet Packet)") (DECLARE%: EVAL@COMPILE (ACCESSFNS XIP [(XIPBASE (LOCF (fetch (ETHERPACKET EPBODY) of DATUM] [BLOCKRECORD XIPBASE ((XIPCHECKSUM WORD) (XIPLENGTH WORD) (XIPTCONTROL BYTE) (XIPTYPE BYTE) (XIPDESTNET FIXP) (XIPDESTWORD1 3 WORD) (XIPDESTSOCKET WORD) (XIPSOURCENET FIXP) (XIPSOURCEWORD1 3 WORD) (XIPSOURCESOCKET WORD) (XIPFIRSTDATAWORD WORD) (* ; "Start of data") ) [ACCESSFNS XIPLENGTH ((XIPCHECKSUMBASE (LOCF DATUM] [ACCESSFNS XIPFIRSTDATAWORD ((XIPCONTENTS (LOCF DATUM] [ACCESSFNS XIPSOURCEWORD1 ((XIPSOURCEHOST (\LOADNSHOSTNUMBER (LOCF DATUM)) (\STORENSHOSTNUMBER (LOCF DATUM) NEWVALUE] [ACCESSFNS XIPDESTWORD1 ((XIPDESTHOST (\LOADNSHOSTNUMBER (LOCF DATUM)) (\STORENSHOSTNUMBER (LOCF DATUM) NEWVALUE] [ACCESSFNS XIPSOURCENET ((XIPSOURCENSADDRESS (\LOADNSADDRESS (LOCF DATUM)) (\STORENSADDRESS (LOCF DATUM) NEWVALUE] (ACCESSFNS XIPDESTNET ((XIPDESTNSADDRESS (\LOADNSADDRESS (LOCF DATUM)) (\STORENSADDRESS (LOCF DATUM) NEWVALUE] (TYPE? (type? ETHERPACKET DATUM))) ) (DECLARE%: EVAL@COMPILE (RPAQQ \XIPOVLEN 30) (RPAQQ \MAX.XIPDATALENGTH 546) (CONSTANTS \XIPOVLEN \MAX.XIPDATALENGTH) ) (RPAQQ RAWXIPTYPES ((\XIPT.ROUTINGINFO 1) (\XIPT.ECHO 2) (\XIPT.ERROR 3) (\XIPT.EXCHANGE 4) (\XIPT.SPP 5) (\XIPT.PUPLOOKUP 6))) (DECLARE%: EVAL@COMPILE (RPAQQ \XIPT.ROUTINGINFO 1) (RPAQQ \XIPT.ECHO 2) (RPAQQ \XIPT.ERROR 3) (RPAQQ \XIPT.EXCHANGE 4) (RPAQQ \XIPT.SPP 5) (RPAQQ \XIPT.PUPLOOKUP 6) (CONSTANTS (\XIPT.ROUTINGINFO 1) (\XIPT.ECHO 2) (\XIPT.ERROR 3) (\XIPT.EXCHANGE 4) (\XIPT.SPP 5) (\XIPT.PUPLOOKUP 6)) ) (* ; "NSOCKET datatype") (DECLARE%: EVAL@COMPILE (DATATYPE NSOCKET ((NIL BITS 4) (NSOCLINK POINTER) (* ; "So that we can Queue them") (ID# WORD) (NSOCHANDLE WORD) (NSOC#OPENP FLAG) (NSOC#CONNECTIONP FLAG) (NIL BITS 2) (INQUEUE POINTER) (INQUEUELENGTH WORD) (NSOC#ALLOCATION WORD) (NSOCEVENT POINTER)) INQUEUE _ (create SYSQUEUE) NSOC#ALLOCATION _ \MAX.EPKTS.ON.NSOCKET) ) (/DECLAREDATATYPE 'NSOCKET '((BITS 4) POINTER WORD WORD FLAG FLAG (BITS 2) POINTER WORD WORD POINTER) '((NSOCKET 0 (BITS . 3)) (NSOCKET 0 POINTER) (NSOCKET 2 (BITS . 15)) (NSOCKET 3 (BITS . 15)) (NSOCKET 4 (FLAGBITS . 0)) (NSOCKET 4 (FLAGBITS . 16)) (NSOCKET 4 (BITS . 33)) (NSOCKET 4 POINTER) (NSOCKET 6 (BITS . 15)) (NSOCKET 7 (BITS . 15)) (NSOCKET 8 POINTER)) '10) (* ; "Well-known NS sockets") (DECLARE%: EVAL@COMPILE (RPAQQ \NS.WKS.RoutingInformation 1) (RPAQQ \NS.WKS.Echo 2) (RPAQQ \NS.WKS.PUPLOOKUP 9) (CONSTANTS (\NS.WKS.RoutingInformation 1) (\NS.WKS.Echo 2) (\NS.WKS.PUPLOOKUP 9)) ) (* ; "ERRORXIP -- overlays XIP") (DECLARE%: EVAL@COMPILE (ACCESSFNS ERRORXIP ((ERRORXIPBASE (fetch XIPCONTENTS of DATUM))) (BLOCKRECORD ERRORXIPBASE ((ERRORXIPCODE WORD) (ERRORXIPARG WORD) (ERRORXIPBODY WORD) (* ;  "As many words of offending XIP as sender felt like including...") ))) ) (RPAQQ XIPERRORCODES ((\XIPE.CHECKSUM 1) (\XIPE.NOSOCKET 2) (\XIPE.SOCKETFULL 3) (\XIPE.GATEWAY.CHECKSUM 513) (\XIPE.NOROUTE 514) (\XIPE.LOOPED 515) (\XIPE.TOOLARGE 516))) (DECLARE%: EVAL@COMPILE (RPAQQ \XIPE.CHECKSUM 1) (RPAQQ \XIPE.NOSOCKET 2) (RPAQQ \XIPE.SOCKETFULL 3) (RPAQQ \XIPE.GATEWAY.CHECKSUM 513) (RPAQQ \XIPE.NOROUTE 514) (RPAQQ \XIPE.LOOPED 515) (RPAQQ \XIPE.TOOLARGE 516) (CONSTANTS (\XIPE.CHECKSUM 1) (\XIPE.NOSOCKET 2) (\XIPE.SOCKETFULL 3) (\XIPE.GATEWAY.CHECKSUM 513) (\XIPE.NOROUTE 514) (\XIPE.LOOPED 515) (\XIPE.TOOLARGE 516)) ) (* ; "NSADDRESS") (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 '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) (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 \BLTLOCALHOSTNUMBER MACRO ((BASE) (\BLT BASE (LOCF (fetch (IFPAGE NSHost0) of \InterfacePage )) 3))) ) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS BROADCASTNSHOSTNUMBER \MY.NSADDRESS \MY.NSHOSTNUMBER \MY.NSNETNUMBER) ) (DECLARE%: EVAL@COMPILE (PUTPROPS EQNSHOSTNUMBER MACRO (X (TRANSLATE.NSH X))) [PUTPROPS EQNSADDRESS.HOST MACRO (OPENLAMBDA (X Y) (* ;; "True if the 48-bit host components of 2 NSADDRESS's (or pointers to equivalent storage) are the same") (AND (EQ (FFETCH NSHNM2 OF X) (FFETCH NSHNM2 OF Y)) (EQ (FFETCH NSHNM1 OF X) (FFETCH NSHNM1 OF Y)) (EQ (FFETCH NSHNM0 OF X) (FFETCH NSHNM0 OF Y] (PUTPROPS EQBROADCASTBASE MACRO (OPENLAMBDA (X) (EQ (LOGAND (\GETBASE X 0) (\GETBASE X 1) (\GETBASE X 2)) 65535))) [PUTPROPS EQNSHOSTBASE MACRO (OPENLAMBDA (X Y) (AND (type? NSHOSTNUMBER Y) (EQ (\GETBASE X 2) (fetch (NSHOSTNUMBER NSHOST2) of Y)) (EQ (\GETBASE X 1) (fetch (NSHOSTNUMBER NSHOST1) of Y)) (EQ (\GETBASE X 0) (fetch (NSHOSTNUMBER NSHOST0) of Y] ) (DEFINEQ (TRANSLATE.NSH (LAMBDA (ARGS) (* bvm%: "28-Nov-83 17:32") (SETQ ARGS (CDR (DWIMIFY (CONS (QUOTE PROGN) ARGS) T))) (PROG ((ARG1 (CAR ARGS)) (ARG2 (CADR ARGS))) (RETURN (COND ((OR (NLISTP ARG1) (SELECTQ (CAR (SETQ ARG1 (OR (GETHASH ARG1 CLISPARRAY) ARG1))) ((LOADNSHOSTNUMBER \LOADNSHOSTNUMBER) NIL) T)) (LIST (QUOTE EQUAL) ARG1 ARG2)) ((EQ ARG2 (QUOTE BROADCASTNSHOSTNUMBER)) (LIST (QUOTE EQBROADCASTBASE) (CADR ARG1))) (T (LIST (QUOTE EQNSHOSTBASE) (CADR ARG1) ARG2)))))) ) ) (ADDTOVAR DONTCOMPILEFNS TRANSLATE.NSH) (PUTPROPS LLNSDECLS COPYRIGHT ("Venue & Xerox Corporation" 1985 1986 1987 1988 1990 1992 1993)) (DECLARE%: DONTCOPY (FILEMAP (NIL (12489 12978 (TRANSLATE.NSH 12499 . 12976))))) STOP