;;; along with this program; if not, write to the Free Software Foundation,
;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-(cl:defpackage #:net-sys
- (:use #:common-lisp)
- (:export #:gethostname #:resolve-hostname #:canonify-hostname))
-(cl:in-package #:net-sys)
+(cl:in-package #:net)
;;;--------------------------------------------------------------------------
;;; Functions provided.
(name :pointer)
(len :uint))
+(export 'gethostname)
(defun gethostname ()
"Return the hostname (not necessarily canonical) of the current host."
(sb-unix:unix-gethostname)
#+clisp
- (unix:get-host-name)
+ (os:uname-nodename (os:uname))
#+ecl
(cffi:with-foreign-pointer-as-string (buffer 256 len)
#-(or cmu sbcl clisp ecl)
"<unknown-host>")
+(export 'resolve-hostname)
(defun resolve-hostname (name)
"Resolve a hostname to an IP address using the DNS, or return nil."
#-(or cmu sbcl clisp ecl)
nil)
+(export 'canonify-hostname)
(defun canonify-hostname (name)
"Resolve a hostname to canonical form using the DNS, or return nil."