chiark / gitweb /
Attempt to port the lot to CLisp.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 24 May 2006 08:20:50 +0000 (09:20 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 24 May 2006 08:20:50 +0000 (09:20 +0100)
This is going to need more work, because CLisp is lacking an interface
to gethostbyname.  We may grow a dependency on CFFI.

.gitignore
net.lisp
zone.lisp

index c02f71bec53cfc920229090b5d5ecc6231377c0c..b94a63c6eb59386da1c5c2aa6e9c4ed863d0c365 100644 (file)
@@ -1 +1,3 @@
 *.x86f
 *.x86f
+*.fas
+*.lib
index 35e43404cb733c0057947ae40d56b527b044100c..d957f53d684a00fd3611f689c96695b89f5224bc 100644 (file)
--- a/net.lisp
+++ b/net.lisp
@@ -256,19 +256,20 @@ (defun ipnet-changeable-bytes (mask)
 ;;;--------------------------------------------------------------------------
 ;;; Name resolution.
 
 ;;;--------------------------------------------------------------------------
 ;;; Name resolution.
 
-#+cmu
 (defun resolve-hostname (name)
   "Resolve a hostname to an IP address using the DNS, or return nil."
 (defun resolve-hostname (name)
   "Resolve a hostname to an IP address using the DNS, or return nil."
-  (let ((he (ext:lookup-host-entry name)))
-    (and he
-        (ext:host-entry-addr he))))
+  #+cmu (let ((he (ext:lookup-host-entry name)))
+         (and he
+              (ext:host-entry-addr he)))
+  #-cmu nil
+)
 
 
-#+cmu
 (defun canonify-hostname (name)
   "Resolve a hostname to canonical form using the DNS, or return nil."
 (defun canonify-hostname (name)
   "Resolve a hostname to canonical form using the DNS, or return nil."
-  (let ((he (ext:lookup-host-entry name)))
-    (and he
-        (ext:host-entry-name he))))
+  #+cmu (let ((he (ext:lookup-host-entry name)))
+         (and he
+              (ext:host-entry-name he)))
+  #-cmu nil)
 
 ;;;--------------------------------------------------------------------------
 ;;; Host names and specifiers.
 
 ;;;--------------------------------------------------------------------------
 ;;; Host names and specifiers.
index 35e6f8072e869014dca96f4f817044675fe7cc2f..64488c2a0d11f3875462fc00fa505f5c8753b661 100644 (file)
--- a/zone.lisp
+++ b/zone.lisp
@@ -145,7 +145,8 @@ (defstruct (zone (:predicate zonep))
 ;;; Zone defaults.  It is intended that scripts override these.
 
 (defvar *default-zone-source*
 ;;; Zone defaults.  It is intended that scripts override these.
 
 (defvar *default-zone-source*
-  (let ((hn (unix:unix-gethostname)))
+  (let ((hn #+cmu (unix:unix-gethostname)
+           #+clisp (unix:get-host-name)))
     (and hn (concatenate 'string (canonify-hostname hn) ".")))
   "The default zone source: the current host's name.")
 
     (and hn (concatenate 'string (canonify-hostname hn) ".")))
   "The default zone source: the current host's name.")
 
@@ -754,8 +755,8 @@ (defun zone-write (zone &optional (stream *standard-output*))
 ;;; Zone file `~(~A~)'
 ;;;   (generated ~A)
 
 ;;; Zone file `~(~A~)'
 ;;;   (generated ~A)
 
-$ORIGIN ~@0*~(~A.~)
-$TTL ~@2*~D~2%"
+$ORIGIN ~0@*~(~A.~)
+$TTL ~2@*~D~2%"
            (zone-name zone)
            (iso-date :now :datep t :timep t)
            (zone-default-ttl zone))
            (zone-name zone)
            (iso-date :now :datep t :timep t)
            (zone-default-ttl zone))