anchor.diff:  CLASS ::= the class of query, almost always :IN (internet).
   "
     (declare (type string name)
  -	   (type symbol type class))
  +           (type symbol type class))
     (list :name name :type type :class class))
   
   ;; --------------------
   
   ;; message
  +;; TODO: support compression when encoding
   
   (defstruct message 
     header questions answers authorities additionals)
  
positive.code:        (encode-label "" stream))
      (let ((p (position #\. name :test #'char= :start pos)))
        (cond
  	(p
  	 (encode-label (subseq name pos p) stream)
  	 (setf pos (1+ p)))
  	(t 
  	 (encode-label (subseq name pos) stream)
  	 (setf pos (length name)))))))
  
  
  (defun decode-name (stream)
    "Decode a list of labels from the stream. Returns a dotted string."
    (with-output-to-string (s)
      (do ((done nil)
  	 (first t))
  	(done)
        (multiple-value-bind (label pointer) (decode-label stream)
  	(when pointer (setf done t))
  	(cond
  	  ((null label) (setf done t))
  	  ((string= label "")
  	   (setf done t))
  	  (t 
  	   (unless first (write-char #\. s))
  	   (setf first nil)
  	   (write-string label s)))))))
  
  ;; -------------------------
  
  
negative.code: 
  (defun decode-rr (stream)
    (let* ((name (decode-name stream))
           (type (nibbles:read-ub16/be stream))
           (class (nibbles:read-ub16/be stream))
           (ttl (nibbles:read-sb32/be stream)))
      (let ((len (nibbles:read-ub16/be stream))
            (tname (car (find type *type-codes*
                              :key #'cadr :test #'=))))
        (let ((v (nibbles:make-octet-vector len)))
          (read-sequence v stream)
          (flexi-streams:with-input-from-sequence (s v)
            (make-rr :name name
                     :type tname
                     :class (car (find class *class-codes*
                                       :key #'cadr :test #'=))
                     :ttl ttl
                     :rdata (decode-rdata tname s)))))))
  
  ;;; -----------------------------
  
  