[cl-net-snmp-cvs] r70 - in trunk: . debian smi

ctian at common-lisp.net ctian at common-lisp.net
Wed Oct 17 10:09:31 UTC 2007


Author: ctian
Date: Wed Oct 17 06:09:30 2007
New Revision: 70

Added:
   trunk/LICENSE
   trunk/README
   trunk/smi/ipaddress.lisp
      - copied unchanged from r61, trunk/smi/ipaddr.lisp
Removed:
   trunk/smi/ipaddr.lisp
Modified:
   trunk/debian/changelog
   trunk/debian/docs
   trunk/net-snmp.asd
   trunk/smi/counter.lisp
   trunk/smi/gauge.lisp
   trunk/smi/package.lisp
Log:
Add license note.

Added: trunk/LICENSE
==============================================================================
--- (empty file)
+++ trunk/LICENSE	Wed Oct 17 06:09:30 2007
@@ -0,0 +1,21 @@
+Copyright (c) 2007, Chun Tian (binghe)
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of the NetEase.com, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Added: trunk/README
==============================================================================
--- (empty file)
+++ trunk/README	Wed Oct 17 06:09:30 2007
@@ -0,0 +1 @@
+^_^

Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	(original)
+++ trunk/debian/changelog	Wed Oct 17 06:09:30 2007
@@ -1,3 +1,10 @@
+cl-net-snmp (1.1) unstable; urgency=low
+
+  * [fix] snmp-walk
+  * [new] counter, gauge, opaque
+
+ -- Chun Tian (binghe) <binghe at 163.org>  Wed, 17 Oct 2007 18:06:37 +0800
+
 cl-net-snmp (0.6) unstable; urgency=low
 
   * Initial release.

Modified: trunk/debian/docs
==============================================================================
--- trunk/debian/docs	(original)
+++ trunk/debian/docs	Wed Oct 17 06:09:30 2007
@@ -1,3 +1,3 @@
 README
-copyright
+LICENSE
 

Modified: trunk/net-snmp.asd
==============================================================================
--- trunk/net-snmp.asd	(original)
+++ trunk/net-snmp.asd	Wed Oct 17 06:09:30 2007
@@ -11,7 +11,7 @@
 
 (defsystem net-snmp
   :description "Simple Network Manangement Protocol"
-  :version "1.0"
+  :version "1.1"
   :author "Chun Tian (binghe) <binghe.lisp at gmail.com>"
   :depends-on (:cl-fad          ; for directory and file
                :cl-ppcre        ; for oid resolve
@@ -31,7 +31,7 @@
 			     (:file "integer"   :depends-on ("package"))
 			     (:file "string"    :depends-on ("package"))
 			     (:file "sequence"  :depends-on ("package"))
-                             (:file "ipaddr"    :depends-on ("package"))
+                             (:file "ipaddress" :depends-on ("package"))
 			     (:file "oid"       :depends-on ("package"))
                              (:file "timeticks" :depends-on ("package"))
                              (:file "pdu"       :depends-on ("package"))

Modified: trunk/smi/counter.lisp
==============================================================================
--- trunk/smi/counter.lisp	(original)
+++ trunk/smi/counter.lisp	Wed Oct 17 06:09:30 2007
@@ -1,31 +1,45 @@
 (in-package :smi)
 
 (defclass counter (general-type) ())
-
 (defclass counter32 (counter) ())
+(defclass counter64 (counter) ())
 
 (defun counter (v)
-  (make-instance 'counter :value v))
+  (make-instance 'counter32 :value v))
 
 (defun counter32 (v)
   (make-instance 'counter32 :value v))
 
-(defmethod print-object ((obj counter) stream)
-  (print-unreadable-object (obj stream :type t)
-    (format stream "~A" (value-of obj))))
+(defun counter64 (v)
+  (make-instance 'counter64 :value v))
 
-(defmethod ber-encode ((value counter))
+(defmethod ber-encode ((value counter32))
   (assert (<= 0 value 4294967295))
   (multiple-value-bind (v l) (ber-encode-integer value)
     (nconc (ber-encode-type 1 0 1)
            (ber-encode-length l)
            v)))
 
-(defmethod ber-decode-value ((stream stream) (type (eql :counter)) length)
+(defmethod ber-encode ((value counter64))
+  (assert (<= 0 value))
+  (multiple-value-bind (v l) (ber-encode-integer value)
+    (nconc (ber-encode-type 1 0 6)
+           (ber-encode-length l)
+           v)))
+
+(defmethod ber-decode-value ((stream stream) (type (eql :counter32)) length)
   (declare (type stream stream)
            (type fixnum length)
            (ignore type))
-  (make-instance 'counter :value (ber-decode-integer-value stream length)))
+  (make-instance 'counter32 :value (ber-decode-integer-value stream length)))
+
+(defmethod ber-decode-value ((stream stream) (type (eql :counter64)) length)
+  (declare (type stream stream)
+           (type fixnum length)
+           (ignore type))
+  (make-instance 'counter64 :value (ber-decode-integer-value stream length)))
 
 (eval-when (:load-toplevel :execute)
-  (install-asn.1-type :counter 1 0 1))
+  (install-asn.1-type :counter32 1 0 1)
+  (install-asn.1-type :counter64 1 0 6))
+

Modified: trunk/smi/gauge.lisp
==============================================================================
--- trunk/smi/gauge.lisp	(original)
+++ trunk/smi/gauge.lisp	Wed Oct 17 06:09:30 2007
@@ -2,21 +2,10 @@
 
 (defclass gauge (general-type) ())
 
-(defclass gauge32 (gauge) ())
-
 (defun gauge (v)
   (make-instance 'gauge :value v))
 
-(defun gauge32 (v)
-  (make-instance 'gauge32 :value v))
-
-(defmethod print-object ((obj gauge) stream)
-  (with-slots (value) obj
-    (print-unreadable-object (obj stream :type t)
-      (format stream "~A" value))))
-
 (defmethod ber-encode ((value gauge))
-  (assert (<= 0 value 4294967295))
   (multiple-value-bind (v l) (ber-encode-integer value)
     (nconc (ber-encode-type 1 0 2)
            (ber-encode-length l)

Modified: trunk/smi/package.lisp
==============================================================================
--- trunk/smi/package.lisp	(original)
+++ trunk/smi/package.lisp	Wed Oct 17 06:09:30 2007
@@ -3,7 +3,9 @@
 (defpackage com.netease.smi
   (:nicknames smi)
   (:use :common-lisp :asn.1 #-(and lispworks win32) :net.sockets)
-  (:export ;; object-id
+  (:export ;; general
+           value-of general-type
+           ;; object-id
            object-id oid make-object-id rev-ids rev-names
            oid-<
            ;; pdu
@@ -25,7 +27,7 @@
            ;; timeticks
            timeticks ticks hours minutes seconds s/100
            ;; other
-           opaque gauge counter value-of))
+           opaque gauge counter counter32 counter64))
 
 (in-package :smi)
 
@@ -33,4 +35,8 @@
 (defclass general-type ()
   ((value :accessor value-of :initarg :value)))
 
+(defmethod print-object ((obj general-type) stream)
+  (print-unreadable-object (obj stream :type t)
+    (format stream "~A" (value-of obj))))
+
 (defparameter *version* 2)



More information about the Cl-net-snmp-cvs mailing list