[noctool-cvs] CVS source

imattsson imattsson at common-lisp.net
Thu Jun 12 06:11:01 UTC 2008


Update of /project/noctool/cvsroot/source
In directory clnet:/tmp/cvs-serv30287

Modified Files:
	packages.lisp config.lisp 
Log Message:
IM

Added a local variable in the config package and a new config statement,
to set local network name.


--- /project/noctool/cvsroot/source/packages.lisp	2008/06/05 05:50:31	1.5
+++ /project/noctool/cvsroot/source/packages.lisp	2008/06/12 06:11:00	1.6
@@ -10,21 +10,21 @@
   (:nicknames #:noctool-graphs)
   (:use :cl
 	#+sbcl :sb-mop)
-  (:export #:graph.type #:serialize-data #:show #:make-graph #:meter-graph #:gauge-graph #:avg-graph #:max-graph #:add-value #:fixed-graph-display #:percentile-graph-display #:add-graphs #:add-graph-info #:interval #:store))
+  (:export #:graph-type #:serialize-data #:show #:make-graph #:meter-graph #:gauge-graph #:avg-graph #:max-graph #:add-value #:fixed-graph-display #:percentile-graph-display #:add-graphs #:add-graph-info #:interval #:store))
 
 (defpackage #:net.hexapodia.noctool
   (:nicknames #:noctool)
   (:use #:cl #:usocket #:net.hexapodia.noctool-scheduler #:net.hexapodia.noctool-graphs
 	#+sbcl :sb-mop)
   (:export
-   #:*proxies* #:*peers* #:*equipment* #:*views* #:last-updated #:unix-host #:linux-host #:cpu-monitor #:load-monitor #:ping-monitor #:remote-node #:decode-base64 #:encode-base64 #:octetify #:destination
+   #:*proxies* #:*peers* #:*equipment* #:*views* #:*noctool-package* #:id #:last-updated #:unix-host #:linux-host #:cpu-monitor #:load-monitor #:ping-monitor #:remote-node #:decode-base64 #:encode-base64 #:octetify #:destination
    ))
 
 (defpackage #:net.hexapodia.noctool-config
   (:nicknames #:noctool-config)
-  (:use #:net.hexapodia.noctool #:cl)
+  (:use #:net.hexapodia.noctool #:net.hexapodia.noctool-graphs #:cl)
   (:shadow #:load)
-  (:export #:cluster #:ping #:load #:machine #:user #:ip #:ssh-port #:disk #:disks #:disk-ignore #:local-password #:peer))
+  (:export #:cluster #:ping #:load #:machine #:user #:ip #:ssh-port #:disk #:disks #:disk-ignore #:local-password #:local-hostname #:peer))
 
 (defpackage #:net.hexapodia.noctool-network
   (:use #:net.hexapodia.noctool #:cl #:usocket)
--- /project/noctool/cvsroot/source/config.lisp	2008/05/29 07:21:12	1.7
+++ /project/noctool/cvsroot/source/config.lisp	2008/06/12 06:11:01	1.8
@@ -10,6 +10,7 @@
 (defvar *config-object* nil)
 (defvar *disk-container* nil)
 (defvar *my-password* nil)
+(defvar *my-name* nil)
 
 (defun bodge-package ()
   (when (find-package *scrap-package-name*)
@@ -79,16 +80,20 @@
 
 (defmacro peer (name remote-passwd &optional this-passwd port)
   `(push (make-instance 'remote-node
-			:destination ,name
-			:remote-passwd ,(decode-base64 remote-passwd :result :octet)
-			:my-passwd ,(choose-password this-passwd
-						    remote-passwd)
-			,@(when port (list :dst-port port)))
-	 *loaded-objects*))
+	  :destination ,name
+	  :remote-passwd ,(decode-base64 remote-passwd :result :octet)
+	  :my-name (or *my-name* (error "No local hostname defined"))
+	  :my-passwd ,(choose-password this-passwd
+				       remote-passwd)
+	  ,@(when port (list :dst-port port)))
+    *loaded-objects*))
 
 (defmacro local-password (string)
   `(setf *my-password* ,(decode-base64 string :result :octet)))
 
+(defmacro local-hostname (string-des)
+  `(setf *my-name* ,(string string-des)))
+
 (defmacro machine (name type &rest specifics)
   (let ((*config-object* (new-symbol))
 	(*macro-nesting* (cons :machine *macro-nesting*)))




More information about the noctool-cvs mailing list