This is going to need more work, because CLisp is lacking an interface
to gethostbyname. We may grow a dependency on CFFI.
;;;--------------------------------------------------------------------------
;;; Name resolution.
;;;--------------------------------------------------------------------------
;;; Name resolution.
(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
+)
(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.
;;; 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.")
;;; 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))