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:
parent
da9f65fee8
commit
8741947e54
|
@ -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)
|
(define (make-info-viewer make-info-select-list)
|
||||||
(lambda (info buffer)
|
(lambda (info buffer)
|
||||||
(let ((info info)
|
(let ((info info)
|
||||||
|
@ -123,7 +132,7 @@
|
||||||
(map (lambda (address)
|
(map (lambda (address)
|
||||||
(make-unmarked-text-element
|
(make-unmarked-text-element
|
||||||
(cons 'address address) #t
|
(cons 'address address) #t
|
||||||
(format #f " ~a" address)))
|
(ip-address-32->dotted-string address)))
|
||||||
(host-info:addresses hi)))
|
(host-info:addresses hi)))
|
||||||
num-lines))
|
num-lines))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue