Skip to content

Commit

Permalink
improve network stats on freebsd (dotnet/corefx#42484)
Browse files Browse the repository at this point in the history
Commit migrated from dotnet/corefx@dfb3c9e
  • Loading branch information
wfurt authored Nov 8, 2019
1 parent 50d8a5f commit fe7c663
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/libraries/Native/Unix/System.Native/pal_networkstatistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ int32_t SystemNative_GetEstimatedTcpConnectionCount()
return count;
}

#ifdef __FreeBSD__
int32_t SystemNative_GetActiveTcpConnectionInfos(__attribute__((unused)) NativeTcpConnectionInformation* infos, int32_t* infoCount)
{
*infoCount = 0;
return 0;
}
#else
static size_t GetEstimatedTcpPcbSize()
{
void* oldp = NULL;
Expand Down Expand Up @@ -348,6 +355,7 @@ int32_t SystemNative_GetActiveTcpConnectionInfos(NativeTcpConnectionInformation*
free(buffer);
return 0;
}
#endif

int32_t SystemNative_GetEstimatedUdpListenerCount()
{
Expand All @@ -357,6 +365,13 @@ int32_t SystemNative_GetEstimatedUdpListenerCount()
return count;
}

#ifdef __FreeBSD__
int32_t SystemNative_GetActiveUdpListeners(__attribute__((unused)) IPEndPointInfo* infos, int32_t* infoCount)
{
*infoCount = 0;
return 0;
}
#else
static size_t GetEstimatedUdpPcbSize()
{
void* oldp = NULL;
Expand Down Expand Up @@ -436,6 +451,7 @@ int32_t SystemNative_GetActiveUdpListeners(IPEndPointInfo* infos, int32_t* infoC
free(buffer);
return 0;
}
#endif

int32_t SystemNative_GetNativeIPInterfaceStatistics(char* interfaceName, NativeIPInterfaceStatistics* retStats)
{
Expand Down
1 change: 1 addition & 0 deletions src/libraries/Native/Unix/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ check_c_source_compiles(
"
#include <sys/types.h>
#include <sys/socketvar.h>
#include <sys/queue.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
Expand Down

0 comments on commit fe7c663

Please sign in to comment.