<p>How can I access Ethernet statistics from C/C++ code like <strong>netstat -e</strong>?</p>

<pre><code>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
</code></pre>

Szia,
from
http://en.wikipedia.org/wiki/Netstat
On the Windows platform, netstat
  information can be retrieved by
  calling the GetTcpTable and
  GetUdpTable functions in the IP Helper
  API, or IPHLPAPI.DLL. Information
  returned includes local and remote IP
  addresses, local and remote ports, and
  (for GetTcpTable) TCP status codes. In
  addition to the command-line
  netstat.exe tool that ships with
  Windows, there are GUI-based netstat
  programs available.
  On the Windows platform, this command
  is available only if the Internet
  Protocol (TCP/IP) protocol is
  installed as a component in the
  properties of a network adapter in
  Network Connections.
MFC sample at CodeProject:
http://www.codeproject.com/KB/applications/wnetstat.aspx