Reputation: 431
With the .NET Framework we can retrieve the received and sent bytes with the following functions.
NetworkInterface.GetIPv4Statistics().BytesReceived
NetworkInterface.GetIPv4Statistics().BytesSent
But i cannot find the alternative in native C. The closest i found was the GetIpStatistics
. However this seems to be global instead of per interface.
Can anyone point me into the right direction?
Upvotes: 1
Views: 152
Reputation: 172
Allthough we can all furiously debate what the correct terminology is, I think you can find what you seek by calling the GetIfTable function.
This will return a MIB_IFTABLE struct, which in turn has MIB_IFROW elements that contain the data you're looking for for the various network interfaces on your machine.
Upvotes: 1