diff --git a/scheme/network-viewer.scm b/scheme/network-viewer.scm index 5052297..86521b2 100644 --- a/scheme/network-viewer.scm +++ b/scheme/network-viewer.scm @@ -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))