             [ FirstUnicastAddress>> loop-list [ Address>> SOCKET_ADDRESS>sockaddr sockaddr>ip ] map ]
         } cleave>array
     ] interfaces-map ;
+
+: get-best-interface ( inet -- interface )
+    make-sockaddr 0 DWORD <ref>
+    [ GetBestInterfaceEx win32-error=0/f ] keep DWORD deref ;

CONSTANT: MIB_IF_TYPE_SLIP 28
CONSTANT: MAX_DNS_SUFFIX_STRING_LENGTH 256 ! 246?
CONSTANT: MAX_DHCPV6_DUID_LENGTH 130


STRUCT: IP_ADDRESS_STRING
    { String char[16] } ;


PRIVATE>

: interfaces-each ( quot -- seq )
    [ [ iterate-interfaces ] dip each ] with-destructors ; inline

