(use-package :sb-bsd-sockets)
(defparameter *addresses* (host-ent-addresses (get-host-by-name name)))
(defun inet-ntoa (packed-address)
(format nil "~{~D~^.~}" (coerce packed-address 'list)))
(defparameter *address* (inet-ntoa (make-inet-address *name*)))
(use-package :sb-bsd-sockets)
(defparameter *name* (get-host-by-address #(192 48 96 9)))
(use-package :sb-bsd-sockets)
(defparameter *packed-address* (make-inet-address "208.146.140.1"))
(defparameter *ascii-address* (inet-ntoa *packed-address*)) (use-package :sb-bsd-sockets)
(let* ((packed (get-host-by-name *hostname*)) (address (host-ent-address packed)))
(format t "I will use ~A as the address for ~A~%" address *hostname*))
(use-package :sb-bsd-sockets)
(defparameter *name* (host-ent-name
(get-host-by-address (make-inet-address *address*))))
(defparameter *addresses* (host-ent-addresses (get-host-by-name *name*)))
(defparameter *found* (member *address* *addresses* :test 'equal :key 'inet-ntoa))
|