(bind-func _print_interface_addresses
(lambda (ifs:ifaddrs*)
(let ((address (cast (tref ifs 3) sockaddr_in*))
(ipv:i8* (cast (tref-ptr address 0) i8*)))
(if (= (pref ipv 1) (i16toi8 AF_INET))
(begin
(printf "%s " (tref ifs 1))
(printf "[IPv4]: %s\n" (inet_ntoa (tref (tref-ptr address 2) 0)))))
(if (null? (tref ifs 0))
void
(_print_interface_addresses (tref ifs 0))))))