2000-09-26 10:35:26 -04:00
|
|
|
;;; Scheme 48 module definitions for TCP/IP protocol suites.
|
|
|
|
;;; Copyright (c) 1995 by Olin Shivers.
|
|
|
|
|
2001-09-12 14:53:50 -04:00
|
|
|
(define-interface format-net-interface
|
|
|
|
(export format-internet-host-address
|
|
|
|
format-port))
|
|
|
|
|
|
|
|
(define-structure format-net format-net-interface
|
|
|
|
(open scsh
|
|
|
|
scheme
|
|
|
|
let-opt) ; :optional
|
|
|
|
(files format-net))
|
|
|
|
|
2001-11-13 13:37:05 -05:00
|
|
|
(define-interface sunet-utilities-interface
|
2002-01-08 09:02:39 -05:00
|
|
|
(export host-name-or-ip))
|
2001-11-13 13:37:05 -05:00
|
|
|
|
|
|
|
(define-structure sunet-utilities sunet-utilities-interface
|
|
|
|
(open scsh
|
|
|
|
scheme
|
2002-01-08 09:02:39 -05:00
|
|
|
format-net
|
2001-11-13 13:37:05 -05:00
|
|
|
handle-fatal-error)
|
|
|
|
(files sunet-utilities))
|
2001-09-12 14:53:50 -04:00
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface smtp-interface
|
|
|
|
(export sendmail %sendmail
|
|
|
|
expn vrfy mail-help
|
|
|
|
smtp-transactions
|
|
|
|
smtp-transactions/no-close
|
|
|
|
smtp/open smtp/helo smtp/mail smtp/rcpt smtp/data
|
|
|
|
smtp/send smtp/soml smtp/saml smtp/rset smtp/expn
|
|
|
|
smtp/help smtp/noop smtp/quit smtp/turn
|
|
|
|
handle-smtp-reply
|
|
|
|
read-smtp-reply
|
|
|
|
parse-smtp-reply
|
|
|
|
smtp-stuff))
|
|
|
|
|
|
|
|
(define-interface smtp-internals-interface
|
|
|
|
(export read-crlf-line ; These two should be in an
|
|
|
|
write-crlf ; auxiliary module.
|
|
|
|
|
|
|
|
smtp-query
|
|
|
|
nullary-smtp-command
|
|
|
|
unary-smtp-command))
|
2000-09-26 10:35:26 -04:00
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-structures
|
|
|
|
((smtp smtp-interface)
|
|
|
|
(smtp-internals smtp-internals-interface))
|
2000-09-26 10:35:26 -04:00
|
|
|
|
|
|
|
(open scsh ; write-string read-string/partial force-output
|
|
|
|
; system-name user-login-name and sockets
|
|
|
|
crlf-io ; read-crlf-line write-crlf
|
|
|
|
receiving ; values receive
|
|
|
|
let-opt ; let-optionals
|
|
|
|
error-package ; error
|
|
|
|
scheme)
|
|
|
|
(files smtp))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface crlf-io-interface
|
|
|
|
(export read-crlf-line
|
|
|
|
read-crlf-line-timeout
|
|
|
|
write-crlf))
|
|
|
|
|
|
|
|
(define-structure crlf-io crlf-io-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open ascii ; ascii->char
|
|
|
|
scsh ; read-line write-string force-output
|
|
|
|
receiving ; MV return (RECEIVE and VALUES)
|
|
|
|
let-opt ; let-optionals
|
2001-04-27 12:19:34 -04:00
|
|
|
threads ; sleep
|
2000-09-26 10:35:26 -04:00
|
|
|
scheme)
|
|
|
|
(files crlf-io))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface rfc822-interface
|
|
|
|
(export read-rfc822-headers
|
|
|
|
read-rfc822-field
|
|
|
|
%read-rfc822-headers
|
|
|
|
%read-rfc822-field
|
|
|
|
rejoin-header-lines
|
|
|
|
get-header-all
|
|
|
|
get-header-lines
|
|
|
|
get-header
|
|
|
|
))
|
|
|
|
|
|
|
|
(define-structure rfc822 rfc822-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open receiving ; MV return (RECEIVE and VALUES)
|
|
|
|
scsh-utilities ; index
|
2001-04-27 12:19:34 -04:00
|
|
|
string-lib
|
2000-09-26 10:35:26 -04:00
|
|
|
let-opt ; let-optionals
|
|
|
|
strings ; lowercase-string uppercase-string
|
|
|
|
crlf-io ; read-crlf-line
|
|
|
|
ascii ; ascii->char
|
|
|
|
error-package ; error
|
|
|
|
scsh ; join-strings
|
|
|
|
scheme)
|
|
|
|
(files rfc822))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface strings-interface
|
|
|
|
(export string-map
|
|
|
|
downcase-string
|
|
|
|
upcase-string
|
|
|
|
char-set-index
|
|
|
|
char-set-rindex
|
|
|
|
string-reduce
|
|
|
|
skip-whitespace
|
|
|
|
string-prefix?
|
|
|
|
string-suffix?
|
|
|
|
trim-spaces))
|
|
|
|
|
|
|
|
(define-structure strings strings-interface
|
2001-05-17 12:48:41 -04:00
|
|
|
(open char-set-lib let-opt scheme)
|
2000-09-26 10:35:26 -04:00
|
|
|
(files stringhax))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface uri-interface
|
|
|
|
(export parse-uri
|
|
|
|
uri-escaped-chars
|
|
|
|
unescape-uri
|
|
|
|
escape-uri
|
|
|
|
resolve-uri
|
|
|
|
split-uri-path
|
|
|
|
uri-path-list->path
|
|
|
|
simplify-uri-path))
|
|
|
|
|
|
|
|
(define-structure uri uri-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open scsh-utilities
|
2001-04-27 12:19:34 -04:00
|
|
|
string-lib
|
2000-09-26 10:35:26 -04:00
|
|
|
let-opt
|
|
|
|
receiving
|
2001-08-20 07:31:03 -04:00
|
|
|
|
2000-09-26 10:35:26 -04:00
|
|
|
ascii
|
|
|
|
strings
|
2001-05-17 12:48:41 -04:00
|
|
|
char-set-lib
|
2000-09-26 10:35:26 -04:00
|
|
|
bitwise
|
|
|
|
field-reader-package
|
|
|
|
scheme)
|
|
|
|
(files uri))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface url-interface
|
|
|
|
(export userhost? ; USERHOST
|
|
|
|
make-userhost ; record struct
|
|
|
|
|
|
|
|
userhost:user
|
|
|
|
userhost:password
|
|
|
|
userhost:host
|
|
|
|
userhost:port
|
|
|
|
|
|
|
|
set-userhost:user
|
|
|
|
set-userhost:password
|
|
|
|
set-userhost:host
|
|
|
|
set-userhost:port
|
|
|
|
|
|
|
|
parse-userhost ; parse &
|
|
|
|
userhost->string ; unparse.
|
|
|
|
|
|
|
|
http-url? ; HTTP-URL
|
|
|
|
make-http-url ; record struct
|
|
|
|
|
|
|
|
http-url:userhost
|
|
|
|
http-url:path
|
|
|
|
http-url:search
|
|
|
|
http-url:frag-id
|
|
|
|
|
|
|
|
set-http-url:userhost
|
|
|
|
set-http-url:path
|
|
|
|
set-http-url:search
|
|
|
|
set-http-url:frag-id
|
|
|
|
|
|
|
|
parse-http-url ; parse &
|
|
|
|
http-url->string)) ; unparse.
|
|
|
|
|
|
|
|
(define-structure url url-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open defrec-package
|
|
|
|
receiving
|
2001-08-20 07:31:03 -04:00
|
|
|
|
2001-04-27 12:19:34 -04:00
|
|
|
string-lib
|
2001-05-17 12:48:41 -04:00
|
|
|
char-set-lib
|
2001-08-20 07:31:03 -04:00
|
|
|
uri
|
2000-09-26 10:35:26 -04:00
|
|
|
scsh-utilities
|
|
|
|
httpd-error
|
|
|
|
scheme)
|
|
|
|
(files url))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface httpd-error-interface
|
|
|
|
(export http-error?
|
|
|
|
http-error
|
|
|
|
fatal-syntax-error?
|
|
|
|
fatal-syntax-error))
|
|
|
|
|
|
|
|
(define-structure httpd-error httpd-error-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open conditions signals handle scheme)
|
|
|
|
(files httpd-error))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface handle-fatal-error-interface
|
|
|
|
(export with-fatal-error-handler*
|
|
|
|
(with-fatal-error-handler :syntax)))
|
|
|
|
|
|
|
|
(define-structure handle-fatal-error handle-fatal-error-interface
|
2000-09-26 11:32:01 -04:00
|
|
|
(open scheme conditions handle)
|
|
|
|
(files handle-fatal-error))
|
2000-09-26 10:35:26 -04:00
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface httpd-core-interface
|
|
|
|
(export server/version
|
|
|
|
server/protocol
|
|
|
|
server/admin
|
|
|
|
set-server/admin!
|
|
|
|
|
|
|
|
http-log
|
|
|
|
*http-log?*
|
|
|
|
*http-log-port*
|
|
|
|
|
|
|
|
httpd
|
|
|
|
|
|
|
|
make-request ; HTTP request
|
|
|
|
request? ; record type.
|
|
|
|
request:method
|
|
|
|
request:uri
|
|
|
|
request:url
|
|
|
|
request:version
|
|
|
|
request:headers
|
|
|
|
request:socket
|
|
|
|
set-request:method
|
|
|
|
set-request:uri
|
|
|
|
set-request:url
|
|
|
|
set-request:version
|
|
|
|
set-request:headers
|
|
|
|
set-request:socket
|
|
|
|
|
|
|
|
version< version<=
|
|
|
|
v0.9-request?
|
|
|
|
version->string
|
|
|
|
|
|
|
|
;; Integer reply codes
|
|
|
|
reply-code->text
|
|
|
|
http-reply/ok
|
|
|
|
http-reply/created
|
|
|
|
http-reply/accepted
|
|
|
|
http-reply/prov-info
|
|
|
|
http-reply/no-content
|
|
|
|
http-reply/mult-choice
|
|
|
|
http-reply/moved-perm
|
|
|
|
http-reply/moved-temp
|
|
|
|
http-reply/method
|
|
|
|
http-reply/not-mod
|
|
|
|
http-reply/bad-request
|
|
|
|
http-reply/unauthorized
|
|
|
|
http-reply/payment-req
|
|
|
|
http-reply/forbidden
|
|
|
|
http-reply/not-found
|
|
|
|
http-reply/method-not-allowed
|
|
|
|
http-reply/none-acceptable
|
|
|
|
http-reply/proxy-auth-required
|
|
|
|
http-reply/timeout
|
|
|
|
http-reply/conflict
|
|
|
|
http-reply/gone
|
|
|
|
http-reply/internal-error
|
|
|
|
http-reply/not-implemented
|
|
|
|
http-reply/bad-gateway
|
|
|
|
http-reply/service-unavailable
|
|
|
|
http-reply/gateway-timeout
|
|
|
|
|
|
|
|
time->http-date-string
|
|
|
|
begin-http-header
|
|
|
|
send-http-error-reply
|
|
|
|
|
|
|
|
set-my-fqdn!
|
|
|
|
set-my-port!))
|
|
|
|
|
|
|
|
(define-structure httpd-core httpd-core-interface
|
2001-04-27 12:19:34 -04:00
|
|
|
(open threads
|
2002-01-08 09:02:39 -05:00
|
|
|
thread-fluids ; fork-thread
|
2001-04-27 12:19:34 -04:00
|
|
|
scsh
|
2000-09-26 10:35:26 -04:00
|
|
|
receiving
|
|
|
|
let-opt
|
|
|
|
crlf-io
|
|
|
|
rfc822
|
|
|
|
strings
|
2001-05-17 12:48:41 -04:00
|
|
|
char-set-lib
|
2000-09-26 10:35:26 -04:00
|
|
|
defrec-package
|
2001-04-27 12:19:34 -04:00
|
|
|
define-record-types
|
2000-09-26 10:35:26 -04:00
|
|
|
handle
|
|
|
|
conditions ; condition-stuff
|
|
|
|
defenum-package
|
|
|
|
httpd-error
|
2000-09-26 11:32:01 -04:00
|
|
|
handle-fatal-error
|
2001-08-20 07:31:03 -04:00
|
|
|
uri
|
|
|
|
url
|
2000-09-26 10:35:26 -04:00
|
|
|
formats
|
2001-10-29 03:39:15 -05:00
|
|
|
sunet-utilities
|
2000-09-26 10:35:26 -04:00
|
|
|
scheme)
|
|
|
|
(files httpd-core))
|
|
|
|
|
|
|
|
|
|
|
|
;;; For parsing submissions from HTML forms.
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface parse-html-forms-interface
|
|
|
|
(export parse-html-form-query unescape-uri+))
|
|
|
|
|
|
|
|
(define-structure parse-html-forms parse-html-forms-interface
|
2001-04-27 12:19:34 -04:00
|
|
|
(open scsh scsh-utilities let-opt string-lib
|
2001-08-20 07:31:03 -04:00
|
|
|
receiving uri strings
|
|
|
|
|
|
|
|
scheme)
|
2000-09-26 10:35:26 -04:00
|
|
|
(files parse-forms))
|
|
|
|
|
|
|
|
|
|
|
|
;;; For writing CGI scripts in Scheme.
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface cgi-script-interface (export cgi-form-query))
|
|
|
|
|
|
|
|
(define-structure cgi-script cgi-script-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open scsh
|
|
|
|
error-package
|
|
|
|
parse-html-forms
|
|
|
|
scheme)
|
|
|
|
(files cgi-script))
|
|
|
|
|
|
|
|
;;; Provides the server interface to CGI scripts.
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface cgi-server-interface
|
|
|
|
(export cgi-default-bin-path
|
|
|
|
cgi-handler
|
|
|
|
initialise-request-invariant-cgi-env))
|
|
|
|
|
|
|
|
(define-structure cgi-server cgi-server-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open strings
|
2001-04-27 12:19:34 -04:00
|
|
|
string-lib
|
2000-09-26 10:35:26 -04:00
|
|
|
rfc822
|
|
|
|
crlf-io ; WRITE-CRLF
|
2001-08-20 07:31:03 -04:00
|
|
|
uri
|
|
|
|
url ; HTTP-URL record type
|
2000-09-26 10:35:26 -04:00
|
|
|
httpd-core ; REQUEST record type, HTTP-ERROR & reply codes
|
|
|
|
; version stuff
|
|
|
|
httpd-basic-handlers ; HTTP-HOMEDIR, SERVE-ROOTED-FILE-PATH
|
|
|
|
httpd-error ; HTTP-ERROR
|
|
|
|
scsh-utilities ; INDEX
|
|
|
|
scsh ; syscalls
|
|
|
|
formats ; format
|
2001-09-12 14:53:50 -04:00
|
|
|
format-net ; FORMAT-INTERNET-HOST-ADDRESS
|
2001-10-29 03:39:15 -05:00
|
|
|
sunet-utilities ; host-name-or-empty
|
2000-09-26 10:35:26 -04:00
|
|
|
scheme)
|
|
|
|
(files cgi-server))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface htmlout-interface
|
|
|
|
(export emit-tag
|
|
|
|
emit-close-tag
|
|
|
|
|
|
|
|
emit-p
|
|
|
|
emit-title
|
|
|
|
emit-header ; And so forth...
|
2000-09-26 10:35:26 -04:00
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
with-tag
|
|
|
|
with-tag*
|
2000-09-26 10:35:26 -04:00
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
escape-html
|
|
|
|
emit-text))
|
|
|
|
|
|
|
|
(define-structure htmlout htmlout-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open scsh scsh-utilities strings formats ascii receiving scheme)
|
|
|
|
(files htmlout))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface httpd-basic-handlers-interface
|
|
|
|
(export alist-path-dispatcher
|
|
|
|
home-dir-handler
|
|
|
|
tilde-home-dir-handler
|
|
|
|
rooted-file-handler
|
|
|
|
rooted-file-or-directory-handler
|
|
|
|
null-path-handler
|
|
|
|
serve-rooted-file-path
|
|
|
|
file-serve
|
|
|
|
file-server-and-dir
|
|
|
|
http-homedir
|
|
|
|
send-file
|
|
|
|
dotdot-check
|
|
|
|
file-extension->content-type
|
|
|
|
copy-inport->outport))
|
|
|
|
|
|
|
|
(define-structure httpd-basic-handlers httpd-basic-handlers-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open scsh ; syscalls
|
|
|
|
formats ; FORMAT
|
|
|
|
httpd-core ; REQUEST record type, HTTP-ERROR & reply codes,
|
|
|
|
; v0.9-request, begin-http-header
|
|
|
|
httpd-error
|
2001-08-20 07:31:03 -04:00
|
|
|
htmlout
|
2000-09-26 10:35:26 -04:00
|
|
|
conditions ; CONDITION-STUFF
|
2001-08-20 07:31:03 -04:00
|
|
|
url ; HTTP-URL record type
|
2001-09-12 14:53:50 -04:00
|
|
|
handle-fatal-error ; WITH-FATAL-ERROR-HANDLER
|
|
|
|
string-lib ; STRING-JOIN
|
2000-09-26 10:35:26 -04:00
|
|
|
scheme)
|
|
|
|
(files httpd-handlers))
|
|
|
|
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface seval-handler-interface
|
|
|
|
(export seval-handler))
|
|
|
|
|
|
|
|
(define-structure seval-handler seval-handler-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open scsh ; syscalls & INDEX
|
|
|
|
httpd-error
|
|
|
|
httpd-core ; REQUEST record type, HTTP-ERROR & reply codes,
|
|
|
|
; v0.9-request, reply formatting stuff.
|
2001-08-20 07:31:03 -04:00
|
|
|
uri ; UNESCAPE-URI
|
|
|
|
htmlout ; Formatted HTML output
|
2000-09-26 10:35:26 -04:00
|
|
|
error-package ; ERROR
|
|
|
|
pp ; Pretty-printer
|
|
|
|
strings rfc822
|
|
|
|
toothless-eval ; EVAL-SAFELY
|
|
|
|
handle ; IGNORE-ERROR
|
|
|
|
strings ; SKIP-WHITESPACE
|
|
|
|
parse-html-forms ; PARSE-HTML-FORM-QUERY
|
2001-09-12 14:53:50 -04:00
|
|
|
threads ; SLEEP
|
2000-09-26 10:35:26 -04:00
|
|
|
scheme)
|
|
|
|
(files seval))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface httpd-access-control-interface
|
|
|
|
(export access-denier
|
|
|
|
access-allower
|
|
|
|
access-controller
|
|
|
|
access-controlled-handler))
|
|
|
|
|
|
|
|
(define-structure httpd-access-control httpd-access-control-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open big-scheme
|
|
|
|
strings
|
|
|
|
httpd-core
|
|
|
|
httpd-error
|
|
|
|
scsh
|
|
|
|
scheme)
|
|
|
|
(files httpd-access-control))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface info-gateway-interface
|
|
|
|
(export info-handler
|
|
|
|
find-info-file
|
|
|
|
info-gateway-error))
|
|
|
|
|
|
|
|
(define-structure info-gateway info-gateway-interface
|
2000-09-26 10:35:26 -04:00
|
|
|
(open big-scheme
|
2001-04-27 12:19:34 -04:00
|
|
|
string-lib
|
2000-09-26 10:35:26 -04:00
|
|
|
conditions signals handle
|
|
|
|
strings
|
2001-08-20 07:31:03 -04:00
|
|
|
htmlout
|
2000-09-26 10:35:26 -04:00
|
|
|
httpd-core
|
|
|
|
httpd-error
|
2001-08-20 07:31:03 -04:00
|
|
|
url
|
|
|
|
uri
|
2000-09-26 10:35:26 -04:00
|
|
|
scsh
|
2001-09-12 14:53:50 -04:00
|
|
|
handle-fatal-error
|
2000-09-26 10:35:26 -04:00
|
|
|
scheme)
|
|
|
|
(files info-gateway))
|
2000-09-26 11:32:01 -04:00
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface rman-gateway-interface
|
|
|
|
(export rman-handler
|
|
|
|
man
|
|
|
|
parse-man-entry
|
|
|
|
cat-man-page
|
|
|
|
find-man-file
|
|
|
|
file->man-directory
|
|
|
|
cat-n-decode
|
|
|
|
nroff-n-decode))
|
|
|
|
|
|
|
|
(define-structure rman-gateway rman-gateway-interface
|
2000-09-26 11:32:01 -04:00
|
|
|
(open httpd-core
|
|
|
|
httpd-error
|
|
|
|
conditions
|
2001-08-20 07:31:03 -04:00
|
|
|
url
|
|
|
|
uri
|
|
|
|
htmlout
|
2000-09-26 11:32:01 -04:00
|
|
|
httpd-basic-handlers
|
|
|
|
handle-fatal-error
|
|
|
|
scsh
|
|
|
|
let-opt
|
2001-09-12 14:53:50 -04:00
|
|
|
string-lib
|
2000-09-26 11:32:01 -04:00
|
|
|
scheme)
|
|
|
|
(files rman-gateway))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
(define-interface ls-interface
|
2002-02-20 08:40:09 -05:00
|
|
|
(export ls-crlf?
|
|
|
|
ls
|
2001-08-20 07:31:03 -04:00
|
|
|
arguments->ls-flags))
|
|
|
|
|
|
|
|
(define-structure ls ls-interface
|
2001-06-03 12:45:17 -04:00
|
|
|
(open scheme handle
|
2000-09-26 11:32:01 -04:00
|
|
|
big-scheme bitwise
|
2002-02-20 08:40:09 -05:00
|
|
|
fluids
|
|
|
|
crlf-io
|
2000-09-26 11:32:01 -04:00
|
|
|
scsh)
|
|
|
|
(files ls))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
(define-interface ftpd-interface
|
|
|
|
(export ftpd
|
|
|
|
ftpd-inetd))
|
|
|
|
|
|
|
|
(define-structure ftpd ftpd-interface
|
2000-09-26 11:32:01 -04:00
|
|
|
(open scheme
|
|
|
|
conditions handle signals
|
|
|
|
structure-refs
|
|
|
|
handle-fatal-error
|
|
|
|
scsh
|
2001-07-13 13:21:39 -04:00
|
|
|
threads threads-internal ; last one to get CURRENT-THREAD
|
2002-01-08 09:02:39 -05:00
|
|
|
thread-fluids ; fork-thread
|
2001-04-27 12:19:34 -04:00
|
|
|
fluids
|
|
|
|
string-lib
|
2001-06-20 05:08:01 -04:00
|
|
|
big-util
|
2001-04-27 12:19:34 -04:00
|
|
|
defrec-package
|
2001-11-13 08:50:24 -05:00
|
|
|
crlf-io strings ls
|
|
|
|
format-net) ; pretty print of internet-addresses
|
2000-09-26 11:32:01 -04:00
|
|
|
(access big-scheme)
|
|
|
|
(files ftpd))
|
2001-08-20 07:31:03 -04:00
|
|
|
|
2001-09-12 14:53:50 -04:00
|
|
|
;; some utilities for the following stuff
|
|
|
|
;; hope we can vanish this soon
|
|
|
|
|
|
|
|
(define-interface ecm-utilities-interface
|
|
|
|
(export system-fqdn
|
|
|
|
safe-first
|
|
|
|
safe-second
|
|
|
|
write-crlf
|
|
|
|
dump))
|
|
|
|
|
|
|
|
(define-structure ecm-utilities ecm-utilities-interface
|
|
|
|
(open scsh
|
|
|
|
string-lib
|
|
|
|
scheme)
|
|
|
|
(files ecm-utilities))
|
|
|
|
|
|
|
|
|
|
|
|
;; netrc.scm is a module for parsing ~/.netrc files, to obtain login
|
|
|
|
;; and password information for different network hosts.
|
|
|
|
|
|
|
|
(define-interface netrc-interface
|
|
|
|
(export user-mail-address
|
|
|
|
netrc:lookup
|
|
|
|
netrc:lookup-password
|
|
|
|
netrc:lookup-login
|
2001-12-18 13:08:08 -05:00
|
|
|
netrc:parse
|
2001-12-27 11:45:32 -05:00
|
|
|
netrc:try-parse
|
|
|
|
netrc-refuse?))
|
2001-09-12 14:53:50 -04:00
|
|
|
|
|
|
|
(define-structure netrc netrc-interface
|
|
|
|
(open defrec-package
|
2001-12-18 13:08:08 -05:00
|
|
|
records
|
2001-09-12 14:53:50 -04:00
|
|
|
scsh
|
|
|
|
error-package
|
|
|
|
ecm-utilities
|
|
|
|
string-lib
|
2001-12-27 11:45:32 -05:00
|
|
|
conditions signals handle
|
2001-12-18 13:08:08 -05:00
|
|
|
let-opt
|
2001-09-12 14:53:50 -04:00
|
|
|
scheme)
|
|
|
|
(files netrc))
|
|
|
|
|
|
|
|
|
|
|
|
;; ftp.scm is a module for transfering files between networked
|
|
|
|
;; machines using the File Transfer Protocol
|
|
|
|
(define-interface ftp-interface
|
|
|
|
(export ftp:connect
|
|
|
|
ftp:login
|
|
|
|
ftp:type
|
|
|
|
ftp:rename
|
|
|
|
ftp:delete
|
|
|
|
ftp:cd
|
|
|
|
ftp:cdup
|
|
|
|
ftp:pwd
|
|
|
|
ftp:rmdir
|
|
|
|
ftp:mkdir
|
|
|
|
ftp:modification-time
|
|
|
|
ftp:size
|
|
|
|
ftp:abort
|
|
|
|
ftp:quit
|
|
|
|
ftp:ls
|
|
|
|
ftp:dir
|
|
|
|
ftp:get
|
|
|
|
ftp:put
|
|
|
|
ftp:append
|
|
|
|
ftp:quot))
|
|
|
|
|
|
|
|
(define-structure ftp ftp-interface
|
|
|
|
(open netrc
|
|
|
|
scsh
|
|
|
|
defrec-package
|
|
|
|
receiving
|
|
|
|
handle
|
|
|
|
conditions
|
|
|
|
signals
|
|
|
|
error-package
|
|
|
|
ecm-utilities
|
|
|
|
string-lib
|
|
|
|
let-opt
|
|
|
|
scheme)
|
|
|
|
(files ftp))
|
|
|
|
|
|
|
|
|
|
|
|
;; pop3.scm is a module for accessing email on a maildrop server,
|
|
|
|
;; using the POP3 protocol.
|
|
|
|
(define-interface pop3-interface
|
|
|
|
(export pop3:connect
|
|
|
|
pop3:login
|
|
|
|
pop3:stat
|
|
|
|
pop3:get
|
|
|
|
pop3:headers
|
|
|
|
pop3:last
|
|
|
|
pop3:delete
|
|
|
|
pop3:reset
|
|
|
|
pop3:quit))
|
|
|
|
|
|
|
|
(define-structure pop3 pop3-interface
|
|
|
|
(open netrc
|
|
|
|
scsh
|
|
|
|
defrec-package
|
|
|
|
handle
|
|
|
|
conditions
|
|
|
|
signals
|
|
|
|
ecm-utilities
|
|
|
|
string-lib
|
|
|
|
scheme)
|
|
|
|
(files pop3))
|
|
|
|
|
|
|
|
|
|
|
|
;; nettime.scm is a module for requesting the time on remote machines,
|
|
|
|
;; using the time or the daytime protocol
|
|
|
|
(define-interface nettime-interface
|
|
|
|
(export net:time
|
|
|
|
net:daytime))
|
|
|
|
|
|
|
|
|
|
|
|
(define-structure nettime nettime-interface
|
|
|
|
(open scsh
|
|
|
|
scheme)
|
|
|
|
(files nettime))
|
|
|
|
|
2001-08-20 07:31:03 -04:00
|
|
|
|
|
|
|
;;; Here is toothless.scm
|
|
|
|
;;; Shouldn't the definitions be in an extra file? Andreas.
|
|
|
|
|
|
|
|
;;; -*- Scheme -*-
|
|
|
|
;;; This file defines a Scheme 48 module that is R4RS without features that
|
|
|
|
;;; could examine or effect the file system. You can also use it
|
|
|
|
;;; as a model of how to execute code in other protected environments
|
|
|
|
;;; in S48.
|
|
|
|
;;;
|
|
|
|
;;; Copyright (c) 1995 by Olin Shivers.
|
|
|
|
|
|
|
|
(define-interface loser-interface (export loser))
|
|
|
|
|
|
|
|
(define-structure loser (export loser)
|
|
|
|
(open scheme error-package)
|
|
|
|
(begin (define (loser name)
|
|
|
|
(lambda x (error "Illegal call" name)))))
|
|
|
|
|
|
|
|
;;; The toothless structure is R4RS without the dangerous procedures.
|
|
|
|
|
|
|
|
(define-interface toothless-interface (interface-of scheme))
|
|
|
|
|
|
|
|
(define-structure toothless toothless-interface
|
|
|
|
(open scheme loser)
|
|
|
|
(begin
|
|
|
|
(define call-with-input-file (loser "call-with-input-file"))
|
|
|
|
(define call-with-output-file (loser "call-with-output-file"))
|
|
|
|
(define load (loser "load"))
|
|
|
|
(define open-input-file (loser "open-input-file"))
|
|
|
|
(define open-output-file (loser "open-output-file"))
|
|
|
|
(define transcript-on (loser "transcript-on"))
|
|
|
|
(define with-input-from-file (loser "with-input-from-file"))
|
|
|
|
(define with-input-to-file (loser "with-input-to-file"))
|
|
|
|
(define eval (loser "eval"))
|
|
|
|
(define interaction-environment (loser "interaction-environment"))
|
|
|
|
(define scheme-report-environment (loser "scheme-report-environment"))))
|
|
|
|
|
|
|
|
;;; (EVAL-SAFELEY exp)
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;; Create a brand new package, import the TOOTHLESS structure, and
|
|
|
|
;;; evaluate EXP in it. When the evaluation is done, you throw away
|
|
|
|
;;; the environment, so EXP's side-effects don't persist from one
|
|
|
|
;;; EVAL-SAFELY call to the next. If EXP raises an error exception,
|
|
|
|
;;; we abort and return #f.
|
|
|
|
|
|
|
|
(define-interface toothless-eval-interface (export eval-safely))
|
|
|
|
|
|
|
|
(define-structure toothless-eval toothless-eval-interface
|
|
|
|
(open evaluation ; eval
|
|
|
|
package-commands-internal ; config-package, get-reflective-tower
|
|
|
|
packages ; structure-package, make-simple-package
|
|
|
|
environments ; environment-ref
|
|
|
|
handle ; ignore-errors
|
|
|
|
scheme)
|
|
|
|
(access toothless) ; Force it to be loaded.
|
|
|
|
(begin
|
|
|
|
|
|
|
|
(define toothless-struct (environment-ref (config-package) 'toothless))
|
|
|
|
(define toothless-package (structure-package toothless-struct))
|
|
|
|
|
|
|
|
(define (new-safe-package)
|
|
|
|
(make-simple-package (list toothless-struct) #t
|
|
|
|
(get-reflective-tower toothless-package) ; ???
|
|
|
|
'safe-env))
|
|
|
|
|
|
|
|
(define (eval-safely exp)
|
|
|
|
(ignore-errors (lambda () (eval exp (new-safe-package)))))))
|
2001-10-29 03:39:15 -05:00
|
|
|
|
2002-01-25 11:50:23 -05:00
|
|
|
(define-interface dns-interface
|
|
|
|
(export dns-get-address
|
|
|
|
dns-get-mail-exchanger
|
|
|
|
dns-find-nameserver))
|
|
|
|
|
|
|
|
(define-structure dns dns-interface
|
|
|
|
(open scheme
|
|
|
|
scsh
|
|
|
|
big-util
|
|
|
|
tables
|
|
|
|
ascii
|
|
|
|
formats
|
|
|
|
signals
|
|
|
|
random)
|
|
|
|
(files dns))
|