iphlpapi: Remove the no longer needed getNumTcpEntries function.

This commit is contained in:
Alexandre Julliard 2009-03-02 12:54:35 +01:00
parent 3573c64970
commit 18a5a77bac
2 changed files with 6 additions and 13 deletions

View File

@ -693,6 +693,7 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
#else #else
FILE *fp; FILE *fp;
MIB_TCPTABLE *tcp_table;
if (!stats) if (!stats)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
@ -772,7 +773,11 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
stats->dwOutRsts = strtoul(ptr, &endPtr, 10); stats->dwOutRsts = strtoul(ptr, &endPtr, 10);
ptr = endPtr; ptr = endPtr;
} }
stats->dwNumConns = getNumTcpEntries(); if (!AllocateAndGetTcpTableFromStack( &tcp_table, FALSE, GetProcessHeap(), 0 ))
{
stats->dwNumConns = tcp_table->dwNumEntries;
HeapFree( GetProcessHeap(), 0, tcp_table );
}
} }
} }
fclose(fp); fclose(fp);
@ -1565,15 +1570,6 @@ DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOr
} }
DWORD getNumTcpEntries(void)
{
#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_NETINET_IN_PCB_H)
return getNumWithOneHeader ("net.inet.tcp.pcblist");
#else
return getNumWithOneHeader ("/proc/net/tcp");
#endif
}
static MIB_TCPTABLE *append_tcp_row( HANDLE heap, DWORD flags, MIB_TCPTABLE *table, static MIB_TCPTABLE *append_tcp_row( HANDLE heap, DWORD flags, MIB_TCPTABLE *table,
DWORD *count, const MIB_TCPROW *row ) DWORD *count, const MIB_TCPROW *row )
{ {

View File

@ -55,9 +55,6 @@ DWORD getUDPStats(MIB_UDPSTATS *stats);
/* Returns the number of entries in the route table. */ /* Returns the number of entries in the route table. */
DWORD getNumRoutes(void); DWORD getNumRoutes(void);
/* Returns the number of entries in the TCP state table. */
DWORD getNumTcpEntries(void);
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags); DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags);
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags); DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags);
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags); DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags);