c - How does netstat know the number of bytes received and sent? -
i want create simple application displays number of bytes downloaded , uploaded. noticed netstat (when using -e switch):
how netstat knows information, call windows api function or something?
netstat uses1 ip helper api, part of core windows networking api. running dumpbin /imports on netstat produces: (snipped brevity)
iphlpapi.dll 140007000 import address table 1400080a0 import name table 0 time date stamp 0 index of first forwarder reference a3 internalgetboundtcp6endpointtable a4 internalgetboundtcpendpointtable c2 internalgetudptablewithownermodule b5 internalgettcp6table2 b9 internalgettcptable2 b6 internalgettcp6tablewithownermodule bb internalgettcptablewithownermodule internalgetudp6tablewithownermodule 80 getudpstatisticsex 64 getipstatisticsex 4d geticmpstatisticsex 7a gettcpstatisticsex the last 4 ip helper functions ones you're interested in. getudpstatisticsex, getipstatisticsex, geticmpstatisticsex , gettcpstatisticsex
1this most likely answer question, completeness netstat imports queryperformancecounter might using produce output. without source code netstat, there's no way know 100% certainty.

Comments
Post a Comment