             [ Next>> ] bi dup
         ] loop drop
     ] { } make ;
+    
+
+! second struct starts at 720h
+
+
+<PRIVATE
+
+: loop-list ( obj -- seq )
+    [ [ dup [ Next>> ] when ] keep ] loop>array nip ;
+
+! Don't use this, use each/map-adapters
+: iterate-interfaces ( -- seq )
+    AF_UNSPEC GAA_FLAG_INCLUDE_PREFIX 0 uint <ref>
+    65,536 [ malloc &free ] [ ULONG <ref> ] bi
+    [ GetAdaptersAddresses win32-error=0/f ] 2keep
+    uint deref drop
+    IP_ADAPTER_ADDRESSES memory>struct loop-list ;
+
+PRIVATE>
+
+
+: interfaces-each ( quot -- seq )
+    [ [ iterate-interfaces ] dip each ] with-destructors ; inline
+
+: interfaces-map ( quot -- seq )
+    [ [ iterate-interfaces ] dip { } map-as ] with-destructors ; inline
+
+: interface-mac-addrs ( -- seq )
+    [
+        {
+            [ Description>> ]
+            [ [ PhysicalAddress>> ] [ PhysicalAddressLength>> ] bi head ]
+        } cleave>array
+    ] interfaces-map ;
+    
+: interface-ips ( -- seq )
+    [
+        {
+            [ Description>> ]
+            [ FirstUnicastAddress>> loop-list [ Address>> SOCKET_ADDRESS>sockaddr sockaddr>ip ] map ]
+        } cleave>array
+    ] interfaces-map ;

    { EnableDns UINT }
    { ExtraSpace char[4096] } ;

TYPEDEF: FIXED_INFO* PFIXED_INFO

FUNCTION: DWORD GetNetworkParams ( PFIXED_INFO pFixedInfo, PULONG pOutBufLen ) ;

: get-fixed-info ( -- FIXED_INFO )

CONSTANT: MAX_DOMAIN_NAME_LEN+4 132
CONSTANT: MAX_HOSTNAME_LEN+4 132
CONSTANT: MAX_SCOPE_ID_LEN+4 260
CONSTANT: MAX_ADAPTER_NAME_LENGTH+4 264
CONSTANT: MAX_ADAPTER_DESCRIPTION_LENGTH+4 136
CONSTANT: ERROR_BUFFER_OVERFLOW 111
CONSTANT: MIB_IF_TYPE_ETHERNET 6
CONSTANT: MIB_IF_TYPE_TOKENRING 9
CONSTANT: MIB_IF_TYPE_FDDI 15
CONSTANT: MIB_IF_TYPE_PPP 23
CONSTANT: MIB_IF_TYPE_LOOPBACK 24
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] } ;
