-(defun get-host-by-name (host-name)
- "Returns a HOST-ENT instance for HOST-NAME or throws some kind of condition.
-HOST-NAME may also be an IP address in dotted quad notation or some other
-weird stuff - see gethostbyname(3) for grisly details."
- (make-host-ent (sockint::gethostbyname host-name)))
-
-(defun get-host-by-address (address)
- "Returns a HOST-ENT instance for ADDRESS, which should be a vector of
- (integer 0 255), or throws some kind of error. See gethostbyaddr(3) for
-grisly details."
- (sockint::with-in-addr packed-addr ()
- (let ((addr-vector (coerce address 'vector)))
- (loop for i from 0 below (length addr-vector)
- do (setf (sb-alien:deref (sockint::in-addr-addr packed-addr) i)
- (elt addr-vector i)))
- (make-host-ent (sockint::gethostbyaddr packed-addr
- 4
- sockint::af-inet)))))
-