iphlpapi: Remove the no longer needed getNumUdpEntries function.
This commit is contained in:
parent
7a5c5099bc
commit
3573c64970
|
@ -793,6 +793,7 @@ DWORD getUDPStats(MIB_UDPSTATS *stats)
|
||||||
int mib[] = {CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_STATS};
|
int mib[] = {CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_STATS};
|
||||||
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
|
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
|
||||||
struct udpstat udp_stat;
|
struct udpstat udp_stat;
|
||||||
|
MIB_UDPTABLE *udp_table;
|
||||||
size_t needed;
|
size_t needed;
|
||||||
if (!stats)
|
if (!stats)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
@ -809,7 +810,12 @@ DWORD getUDPStats(MIB_UDPSTATS *stats)
|
||||||
stats->dwOutDatagrams = udp_stat.udps_opackets;
|
stats->dwOutDatagrams = udp_stat.udps_opackets;
|
||||||
stats->dwNoPorts = udp_stat.udps_noport;
|
stats->dwNoPorts = udp_stat.udps_noport;
|
||||||
stats->dwInErrors = udp_stat.udps_hdrops + udp_stat.udps_badsum + udp_stat.udps_fullsock + udp_stat.udps_badlen;
|
stats->dwInErrors = udp_stat.udps_hdrops + udp_stat.udps_badsum + udp_stat.udps_fullsock + udp_stat.udps_badlen;
|
||||||
stats->dwNumAddrs = getNumUdpEntries();
|
if (!AllocateAndGetUdpTableFromStack( &udp_table, FALSE, GetProcessHeap(), 0 ))
|
||||||
|
{
|
||||||
|
stats->dwNumAddrs = udp_table->dwNumEntries;
|
||||||
|
HeapFree( GetProcessHeap(), 0, udp_table );
|
||||||
|
}
|
||||||
|
else stats->dwNumAddrs = 0;
|
||||||
|
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
#else
|
#else
|
||||||
|
@ -1453,14 +1459,6 @@ done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD getNumUdpEntries(void)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_NETINET_IN_PCB_H)
|
|
||||||
return getNumWithOneHeader ("net.inet.udp.pcblist");
|
|
||||||
#else
|
|
||||||
return getNumWithOneHeader("/proc/net/udp");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static MIB_UDPTABLE *append_udp_row( HANDLE heap, DWORD flags, MIB_UDPTABLE *table,
|
static MIB_UDPTABLE *append_udp_row( HANDLE heap, DWORD flags, MIB_UDPTABLE *table,
|
||||||
DWORD *count, const MIB_UDPROW *row )
|
DWORD *count, const MIB_UDPROW *row )
|
||||||
|
|
|
@ -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 UDP state table. */
|
|
||||||
DWORD getNumUdpEntries(void);
|
|
||||||
|
|
||||||
/* Returns the number of entries in the TCP state table. */
|
/* Returns the number of entries in the TCP state table. */
|
||||||
DWORD getNumTcpEntries(void);
|
DWORD getNumTcpEntries(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue