Alexandre Julliard : iphlpapi: Implemented AllocateAndGetIpNetTableFromStack for Solaris.

Alexandre Julliard julliard at winehq.org
Wed Mar 11 10:04:19 CDT 2009


Module: wine
Branch: master
Commit: e5ec9aeb79b68da38fcb240bf25fb0b9eb4fbb15
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e5ec9aeb79b68da38fcb240bf25fb0b9eb4fbb15

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar 10 17:10:08 2009 +0100

iphlpapi: Implemented AllocateAndGetIpNetTableFromStack for Solaris.

---

 dlls/iphlpapi/ipstats.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 846a41b..9a157cd 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -1280,6 +1280,35 @@ DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BO
         }
         else ret = ERROR_NOT_SUPPORTED;
     }
+#elif defined(HAVE_SYS_TIHDR_H) && defined(T_OPTMGMT_ACK)
+    {
+        void *data;
+        int fd, len, namelen;
+        mib2_ipNetToMediaEntry_t *entry;
+        char name[64];
+
+        if ((fd = open_streams_mib( NULL )) != -1)
+        {
+            if ((data = read_mib_entry( fd, MIB2_IP, MIB2_IP_MEDIA, &len )))
+            {
+                for (entry = data; (char *)(entry + 1) <= (char *)data + len; entry++)
+                {
+                    row.dwPhysAddrLen = min( entry->ipNetToMediaPhysAddress.o_length, MAXLEN_PHYSADDR );
+                    memcpy( row.bPhysAddr, entry->ipNetToMediaPhysAddress.o_bytes, row.dwPhysAddrLen );
+                    row.dwAddr = entry->ipNetToMediaNetAddress;
+                    row.dwType = entry->ipNetToMediaType;
+                    namelen = min( sizeof(name) - 1, entry->ipNetToMediaIfIndex.o_length );
+                    memcpy( name, entry->ipNetToMediaIfIndex.o_bytes, namelen );
+                    name[namelen] = 0;
+                    getInterfaceIndexByName( name, &row.dwIndex );
+                    if (!(table = append_ipnet_row( heap, flags, table, &count, &row ))) break;
+                }
+                HeapFree( GetProcessHeap(), 0, data );
+            }
+            close( fd );
+        }
+        else ret = ERROR_NOT_SUPPORTED;
+    }
 #elif defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
     {
       int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO};




More information about the wine-cvs mailing list