How can I access Ethernet statistics from C/C++ code like netstat -e?
Interface Statistics Received Sent Bytes 21010071 15425579 Unicast packets 95512 94166 Non-unicast packets 12510 7 Discards 0 0 Errors 0 3 Unknown protocols 0
A good place to start for network statistics would be the GetIpStatistics call in the Windows IPHelper functions.
There are a couple of other approaches that are possibly more portable:-