Alexandre Julliard : iphlpapi: Remove the no longer needed getNumArpEntries function.

Alexandre Julliard julliard at winehq.org
Mon Mar 2 09:01:54 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar  2 12:53:41 2009 +0100

iphlpapi: Remove the no longer needed getNumArpEntries function.

---

 dlls/iphlpapi/ipstats.c |   45 ---------------------------------------------
 dlls/iphlpapi/ipstats.h |    3 ---
 2 files changed, 0 insertions(+), 48 deletions(-)

diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index d01bf22..5ce373f 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -1268,51 +1268,6 @@ done:
     return ret;
 }
 
-DWORD getNumArpEntries(void)
-{
-#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
-  int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO};
-#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
-  DWORD arpEntries = 0;
-  size_t needed;
-  char *buf, *lim, *next;
-  struct rt_msghdr *rtm;
-  struct sockaddr_inarp *sinarp;
-  struct sockaddr_dl *sdl;
-
-  if (sysctl (mib, MIB_LEN,  NULL, &needed, NULL, 0) == -1)
-  {
-     ERR ("failed to get size of arp table\n");
-     return 0;
-  }
-
-  buf = HeapAlloc (GetProcessHeap (), 0, needed);
-  if (!buf) return 0;
-
-  if (sysctl (mib, MIB_LEN, buf, &needed, NULL, 0) == -1)
-  {
-     ERR ("failed to get arp table\n");
-     HeapFree (GetProcessHeap (), 0, buf);
-     return 0;
-  }
-
-  lim = buf + needed;
-  next = buf;
-  while(next < lim)
-  {
-      rtm = (struct rt_msghdr *)next;
-      sinarp=(struct sockaddr_inarp *)(rtm + 1);
-      sdl = (struct sockaddr_dl *)((char *)sinarp + ROUNDUP(sinarp->sin_len));
-      if(sdl->sdl_alen) /* arp entry */
-      arpEntries++;
-      next += rtm->rtm_msglen;
-  }
-  HeapFree (GetProcessHeap (), 0, buf);
-  return arpEntries;
-#endif
-  return getNumWithOneHeader("/proc/net/arp");
-}
-
 static MIB_IPNETTABLE *append_ipnet_row( HANDLE heap, DWORD flags, MIB_IPNETTABLE *table,
                                          DWORD *count, const MIB_IPNETROW *row )
 {
diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h
index 3e05d56..88c4839 100644
--- a/dlls/iphlpapi/ipstats.h
+++ b/dlls/iphlpapi/ipstats.h
@@ -55,9 +55,6 @@ DWORD getUDPStats(MIB_UDPSTATS *stats);
 /* Returns the number of entries in the route table. */
 DWORD getNumRoutes(void);
 
-/* Returns the number of entries in the arp table. */
-DWORD getNumArpEntries(void);
-
 /* Returns the number of entries in the UDP state table. */
 DWORD getNumUdpEntries(void);
 




More information about the wine-cvs mailing list