From 7d593efdac74772541cd65e959a890a70ffd8e97 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 24 May 2006 09:20:50 +0100 Subject: [PATCH] Attempt to port the lot to CLisp. This is going to need more work, because CLisp is lacking an interface to gethostbyname. We may grow a dependency on CFFI. --- .gitignore | 2 ++ net.lisp | 17 +++++++++-------- zone.lisp | 7 ++++--- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index c02f71b..b94a63c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.x86f +*.fas +*.lib diff --git a/net.lisp b/net.lisp index 35e4340..d957f53 100644 --- a/net.lisp +++ b/net.lisp @@ -256,19 +256,20 @@ ;;;-------------------------------------------------------------------------- ;;; Name resolution. -#+cmu (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." - (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. diff --git a/zone.lisp b/zone.lisp index 35e6f80..64488c2 100644 --- a/zone.lisp +++ b/zone.lisp @@ -145,7 +145,8 @@ ;;; 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.") @@ -754,8 +755,8 @@ ;;; 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)) -- 2.11.0