(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP") (FILECREATED " 8-Aug-88 11:21:37" {ERINYES}MEDLEY>RPCLOWLEVEL.;3 3722 changes to%: (VARS RPCLOWLEVELCOMS) (FNS STRING.ZEROBYTES) previous date%: " 8-Aug-88 11:13:29" {ERINYES}MEDLEY>RPCLOWLEVEL.;2) (* " Copyright (c) 1987, 1988 by Stanford University and Xerox Corporation. All rights reserved. ") (PRETTYCOMPRINT RPCLOWLEVELCOMS) (RPAQQ RPCLOWLEVELCOMS ((PROPS (RPCLOWLEVEL MAKEFILE-ENVIRONMENT FILETYPE)) (FNS TCP.STREAM.SOCKET TCP.SOCKET.EVENT STRING.ZEROBYTES STRING.BOUTS STRING.BINS \IP.APPEND.BYTES UDP.APPEND.BYTES UDP.GET.BYTES UDP.MYGET.STRING \UDP.SET.CHECKSUM.ZERO) (DECLARE%: EVAL@COMPILE DONTCOPY (FILES (SOURCE) TCPEXPORTS)) (DECLARE%: DONTEVAL@LOAD DOCOPY (P (CHANGENAME (QUOTE UDP.SEND) (QUOTE \UDP.SET.CHECKSUM) (QUOTE \UDP.SET.CHECKSUM.ZERO)))))) (PUTPROPS RPCLOWLEVEL MAKEFILE-ENVIRONMENT (:READTABLE "INTERLISP" :PACKAGE "INTERLISP")) (PUTPROPS RPCLOWLEVEL FILETYPE :COMPILE-FILE) (DEFINEQ (TCP.STREAM.SOCKET (LAMBDA (STREAM) (* ; "Edited 27-Apr-88 21:51 by drc:") (* ;;; "Return IPSOCKET of a TCP Stream") (fetch TCB.IPSOCKET of (fetch F1 of STREAM))) ) (TCP.SOCKET.EVENT (LAMBDA (IPSOCKET) (* ; "Edited 27-Apr-88 21:51 by drc:") (* ;;; "For some reason Eric did not include this function, but it is identical to UDP.SOCKET.NUMBER, anyway.") (fetch (IPSOCKET IPSEVENT) of IPSOCKET)) ) (STRING.ZEROBYTES (LAMBDA (STRING FIRST NBYTES) (* ; "Edited 5-Aug-88 18:20 by bvm") (* ;;; "Zero bytes of a string") (\CLEARBYTES (fetch (STRINGP BASE) of STRING) FIRST NBYTES)) ) (STRING.BOUTS (LAMBDA (STREAM STRING FIRST NBYTES) (* ; "Edited 27-Apr-88 21:51 by drc:") (* ;;; "Write substring to stream") (\BOUTS STREAM (fetch (STRINGP BASE) of STRING) FIRST NBYTES)) ) (STRING.BINS (LAMBDA (STREAM STRING FIRST NBYTES) (* ; "Edited 27-Apr-88 21:51 by drc:") (* ;;; "Read substring from stream") (\BINS STREAM (fetch (STRINGP BASE) of STRING) FIRST NBYTES)) ) (\IP.APPEND.BYTES (LAMBDA (IP ADDR OFFSET LENGTH) (* ; "Edited 27-Apr-88 21:51 by drc:") (* ;;; "Append bytes (not necessarily a string) to IPPACKET. ") (\MOVEBYTES ADDR OFFSET (fetch (IP IPBASE) of IP) (fetch (IP IPTOTALLENGTH) of IP) LENGTH) (add (ffetch (IP IPTOTALLENGTH) of IP) LENGTH)) ) (UDP.APPEND.BYTES (LAMBDA (UDP ADDR OFFSET NBYTES) (* ; "Edited 27-Apr-88 21:52 by drc:") (* ;;; "Append bytes (not necessarily a string) to UDP Packet") (\IP.APPEND.BYTES UDP ADDR OFFSET NBYTES) (add (fetch (UDP UDPLENGTH) of UDP) NBYTES)) ) (UDP.GET.BYTES (LAMBDA (UDP SOFFSET DEST DOFFSET NBYTES) (* ; "Edited 27-Apr-88 21:52 by drc:") (* ;;; "Move bytes out of UDP Packet to another buffer without string creation") (\MOVEBYTES (fetch (UDP UDPCONTENTS) of UDP) SOFFSET DEST DOFFSET NBYTES) DEST) ) (UDP.MYGET.STRING (LAMBDA (UDP OFFSET LENGTH) (* ; "Edited 27-Apr-88 21:52 by drc:") (* ;;; "Fetch string from packet. String does not go to end of packet as in UDP.GET.STRING.") (OR (SMALLP OFFSET) (SETQ OFFSET 0)) (LET* ((STRING (ALLOCSTRING LENGTH))) (\MOVEBYTES (fetch (UDP UDPCONTENTS) of UDP) OFFSET (fetch (STRINGP BASE) of STRING) (fetch (STRINGP OFFST) of STRING) LENGTH) STRING)) ) (\UDP.SET.CHECKSUM.ZERO (LAMBDA (UDP) (* ; "Edited 27-Apr-88 21:52 by drc:") (* ;;; "Avoid doing a UDP checksum. Packet already gets IP Checksum.") (replace (UDP UDPCHECKSUM) of UDP with 0)) ) ) (DECLARE%: EVAL@COMPILE DONTCOPY (FILESLOAD (SOURCE) TCPEXPORTS) ) (DECLARE%: DONTEVAL@LOAD DOCOPY (CHANGENAME (QUOTE UDP.SEND) (QUOTE \UDP.SET.CHECKSUM) (QUOTE \UDP.SET.CHECKSUM.ZERO)) ) (PUTPROPS RPCLOWLEVEL COPYRIGHT ("Stanford University and Xerox Corporation" 1987 1988)) (DECLARE%: DONTCOPY (FILEMAP (NIL (1018 3418 (TCP.STREAM.SOCKET 1028 . 1196) (TCP.SOCKET.EVENT 1198 . 1432) ( STRING.ZEROBYTES 1434 . 1619) (STRING.BOUTS 1621 . 1815) (STRING.BINS 1817 . 2010) (\IP.APPEND.BYTES 2012 . 2309) (UDP.APPEND.BYTES 2311 . 2557) (UDP.GET.BYTES 2559 . 2821) (UDP.MYGET.STRING 2823 . 3218) (\UDP.SET.CHECKSUM.ZERO 3220 . 3416))))) STOP