print ip address in dotted notation

part of darcs patch Thu Sep 22 20:36:04 EEST 2005  Eric Knauel <knauel@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 16:36:22 +00:00
parent da9f65fee8
commit 8741947e54
1 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,12 @@
(define (ip-address-32->dotted-string address)
(let ((extract (lambda (shift)
(number->string
(bitwise-and (arithmetic-shift address (- shift))
255)))))
(string-append
(extract 24) "." (extract 16) "."
(extract 8) "." (extract 0))))
(define (make-info-viewer make-info-select-list)
(lambda (info buffer)
(let ((info info)
@ -123,7 +132,7 @@
(map (lambda (address)
(make-unmarked-text-element
(cons 'address address) #t
(format #f " ~a" address)))
(ip-address-32->dotted-string address)))
(host-info:addresses hi)))
num-lines))