anchor.diff:  	   (if (zerop yiaddr)
   	       nil
   	       (progn
  -		 (dhcp-send (list (make-dhcp-option +opt-dhcp-message-type+ +dhcp-request+)
  +		 (dhcp-send interface
  +			    (list (make-dhcp-option +opt-dhcp-message-type+ +dhcp-request+)
   				  (make-dhcp-option +opt-ip-address+ oaddr)
   				  (make-dhcp-option +opt-dhcp-server+ dhcpserver))
  +			    xid
   			    :siaddr siaddr)
   		 (let* ((ack (sys.net:receive connection 4))
   			(ack-options (decode-all-options ack))
   			(confirmation (get-option ack-options +opt-dhcp-message-type+)))
   		   (if (= (aref confirmation 0) +dhcp-ack+)
  -		       (values yiaddr (get-option options +opt-netmask+) (get-option options +opt-router+)
  -			       (get-option options +opt-dns-servers+) (get-option options +opt-dhcp-server+)
  -			       (get-option options +opt-ntp-server+))
  +		       (make-instance 'dhcp-lease :ip-address yiaddr :netmask (get-option options +opt-netmask+)
  +				      :gateway (get-option options +opt-router+) :dns-servers (get-option options +opt-dns-servers+)
  +				      :dhcp-server (get-option options +opt-dhcp-server+) :interface interface
  +				      :ntp-servers (get-option options +opt-ntp-server+)
  +				      :lease-timestamp (get-universal-time) :lease-timeout (get-option options +opt-lease-time+))
  +		       
   		       nil)))))
         (sys.net:disconnect connection))))
  +
  +(defun renew-lease (dhcp-server)
  +  (let ((xid (make-xid)))
  +    (mezzano.network.udp:with-udp-connection )))
  +
  +(defun dhcp-interaction ()
  +  (make-thread
  +   #'(lambda ()
  +       (let (lease)
  +	 (loop
  +	    (loop for pause = 2 then (min 60 (* 2 pause))
  +	       for lease = 
  +	       until lease do
  +		 (setf lease (acquire-lease))
  +		 (sleep pause))
  +	 
  +	    (loop while lease do
  +		 (sleep (lease-timeout lease))
  +		 (setf lease (renew-lease lease))))))))
  
positive.code: 		     ((typep value '(unsigned-byte 8)) 1)
  		     ((typep value '(unsigned-byte 16)) 2)
  		     ((typep value '(unsigned-byte 32)) 4)
  		     (t (cerror "Invalid DHCP option format ~A ~A" type value))))
  	 (option (make-array (+ 2 size) :element-type '(unsigned-byte 8) :initial-element 0)))
      (when (minusp size)
        (return-from make-dhcp-option option))
  
negative.code: (defconstant +opt-domain-name+ 15)
  (defconstant +opt-end+ 255)
  
  (define-condition dhcp-error ()
    ())
  
  (define-condition dhcp-invalid-option (dhcp-error) 
    ((type :reader type :initarg :type)
     (value :reader value :initarg :value))
    (:report (lambda (condition stream)
  	     (format stream "Invalid DHCP option: ~A ~A" (type condition) (value condition)))))
  
  (defclass dhcp-lease ()
    ((ip-address :reader ip-address :initarg :ip-address)
     (netmask :reader netmask :initarg :netmask)
     (gateway :reader gateway :initarg :gateway)
     (interface :reader interface :initarg :interface)
     (ntp-servers :reader ntp-servers :initarg :ntp-servers)
     (dns-servers :reader dns-servers :initarg :dns-servers)
     (dhcp-server :reader dhcp-server :initarg :dhcp-server)
     (lease-timeout :accessor lease-timeout :initarg :lease-timeout)
     (lease-timestamp :accessor lease-timestamp :initarg :lease-timestamp)))
  
  (defun build-dhcp-packet (&key xid mac-address options (siaddr 0))
    (assert (typep mac-address '(simple-array (unsigned-byte 8) (6))))
    (let ((packet (make-array 512 :element-type '(unsigned-byte 8) :initial-element 0)))
      (setf (aref packet 0) #x01 ;OP
            (aref packet 1) #x01 ;HTYPE
            (aref packet 2) #x06 ;HLEN
            (aref packet 3) #x00 ;HOPS
            (ub32ref/be packet 4) xid
  	  (ub16ref/be packet 8) #x0000 ;SECS
  	  (ub16ref/be packet 10) #x8000 ;FLAGS
            (ub32ref/be packet 12) #x00000000 ;CIADDR
  