driver: Use asdf rather than CLC to start the program.
[zone] / net.lisp
index 35e4340..751ecfd 100644 (file)
--- a/net.lisp
+++ b/net.lisp
@@ -1,7 +1,5 @@
 ;;; -*-lisp-*-
 ;;;
-;;; $Id$
-;;;
 ;;; Network (numbering) tools
 ;;;
 ;;; (c) 2006 Straylight/Edgeware
 ;;; it under the terms of the GNU General Public License as published by
 ;;; the Free Software Foundation; either version 2 of the License, or
 ;;; (at your option) any later version.
-;;; 
+;;;
 ;;; This program is distributed in the hope that it will be useful,
 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;;; GNU General Public License for more details.
-;;; 
+;;;
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with this program; if not, write to the Free Software Foundation,
 ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 ;;; Packaging.
 
 (defpackage #:net
-  (:use #:common-lisp #:mdw.base #:mdw.str #:collect)
+  (:use #:common-lisp #:mdw.base #:mdw.str #:collect #:net-sys)
   (:export #:ipaddr #:string-ipaddr #:ipaddr-byte #:ipaddr-string #:ipaddrp
           #:integer-netmask #:ipmask #:ipmask-cidl-slash #:make-ipnet
             #:string-ipnet #:ipnet #:ipnet-net #:ipnet-mask #:with-ipnet
             #:ipnet-pretty #:ipnet-string #:ipnet-broadcast #:ipnet-hosts
             #:ipnet-host #:ipaddr-networkp #:ipnet-subnetp
             #:ipnet-changeable-bytes
-          #:host-find# #:host-create #:defhost #:parse-ipaddr
+          #:host-find #:host-create #:defhost #:parse-ipaddr
             #:resolve-hostname #:canonify-hostname
             #:net #:net-find #:net-get-as-ipnet #:net-create #:defnet
             #:net-next-host #:net-host))
@@ -75,8 +73,7 @@
    `stringify'.  The START and END arguments may be used to parse out a
    substring."
   (setf str (stringify str))
-  (unless end
-    (setf end (length str)))
+  (setf-default end (length str))
   (let ((addr 0) (noct 0))
     (loop
       (let* ((pos (position #\. str :start start :end end))
 (defun string-ipnet (str &key (start 0) (end nil))
   "Parse an IP-network from the string STR."
   (setf str (stringify str))
-  (unless end (setf end (length str)))
+  (setf-default end (length str))
   (let ((sl (position #\/ str :start start :end end)))
     (if sl
        (make-ipnet (parse-ipaddr (subseq str start sl))
       (return (- 4 i)))))
 
 ;;;--------------------------------------------------------------------------
-;;; 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
-(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))))
-
-;;;--------------------------------------------------------------------------
 ;;; Host names and specifiers.
 
 (defun parse-ipaddr (addr)