TCPInfo
Posted
by Farooque Khan
on October 31st, 2001
Internet Protocol Helper (IP Helper) is an API that assists in the network administration of the local computer. You can use IP Helper to programmatically retrieve information about the network configuration of the local computer, and to modify that configuration. This article and the associated code demonstrate usage of some of the API's. The sample application is developed using these API's and can be used for following purposes.
- Getting the TCP statistics such as active connections, segments sent and received etc.
- Getting the UDP statistics such as datagrams sent and received etc.
- Getting the IP statistics such as Reassembly time outs, invalid datagrams sent or received etc.
- Getting the ICMP statistics such as total ICMP messages sent or received, echo requests sent and echo replies received etc.
- Getting the active TCP connections with local and remote addresses and ports.
- Getting the active UDP connections with local address and ports.
These are some of the functions IP Helper APIs can do. In the sample application following APIs were used.
- GetTcpStatistics()
This API fills a MIB_TCPSTATS structure with TCP statistics. See sample application for usage. - GetUdpStatistics()
This API fills a MIB_UDPSTATS structure with UDP statistics. See sample application for usage. - GetIpStatistics()
This API fills a MIB_IPSTATS structure with IP statistics. See sample application for usage. - GetIcmpStatistics()
This API fills a MIB_ICMP structure with ICMP statistics about outgoing and incoming ICMP messages. See the sample application for usage. - GetTcpTable()
This API fills a buffer with the information about active TCP connections. Apart from the status of the connections (Established, closing etc.) the local and remote addresses and ports involved are also returned. See the sample application for the usage of this API. - GetUdpTable()
This API fills a buffer with UDP connections information. Only the local address and ports of the connection are returned. See the sample application for the usage of this API.
Downloads
Download Executable - 15 KBsDownload source - 51 KB

Comments
Network Programing
Posted by Legacy on 12/19/2003 12:00amOriginally posted by: Ghazanfar
This is really good for network metrics
Replyundeclared identifiers problem...
Posted by Legacy on 09/27/2003 12:00amOriginally posted by: moshe masas
--------------------Configuration: TCPInfo - Win32 Release--------------------
My devastudo generated the following errors output above...
Compiling resources...
ReplyCompiling...
StdAfx.cpp
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\Iphlpapi.h(183) : error C2065: 'PMIB_ICMP_EX' : undeclared identifier
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\Iphlpapi.h(183) : error C2146: syntax error : missing ')' before identifier 'pStats'
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\Iphlpapi.h(183) : warning C4229: anachronism used : modifiers on data are ignored
C:\PROGRAM FILES\MICROSOFT SDK\INCLUDE\Iphlpapi.h(185) : error C2059: syntax error : ')'
Error executing cl.exe.
How can I manage special computers on my local network
Posted by Legacy on 08/05/2003 12:00amOriginally posted by: PM Tuan
How can I manage a number of special computers on my local network? Can I use IP Helper on Adress Resolution Protocol to do this? And with what OS?
ReplyThank you for reply person.
SetTcpEntry --- Network Access is Denied
Posted by Legacy on 03/29/2003 12:00amOriginally posted by: Abbas
I have been trying to use SetTcpEntry function to block a TCP port.
The function does not work when logged on as a non-administrator user. It fails saying "Network Access is denied"
Can any one help
Thanks in Advance
Regards
Abbas
-
ReplyYou implement in .Net ?
Posted by vitoto on 05/27/2005 12:57amHi, i need use this Function in .Net any idea ? Look, Networking Information Class in Net Framework 2.0
Replysegments to bytes?
Posted by Legacy on 01/21/2003 12:00amOriginally posted by: Scampi
How I can convert segments to bytes?
ReplyI need to how bytes i send and receive.
Super Thanks to you!!
Posted by Legacy on 01/02/2003 12:00amOriginally posted by: SuperP
Thank you!!
I love you.
You don't know how many hours I spend to find this code!!
Happy new year
Reply
This is Really Good!!!!
Posted by Legacy on 12/10/2002 12:00amOriginally posted by: Simon Thomas
ReplyHow can I retrieve adapt info (name, description, ip-address) on NT SP 4.0 platforms?
Posted by Legacy on 11/29/2002 12:00amOriginally posted by: FYF
How can I retrieve adapt info (name, description, ip-address) on NT SP 4.0 platforms?
Reply.NET
Posted by Legacy on 11/22/2002 12:00amOriginally posted by: Kuntal
Can I use IP Helper API in Visual Studio.NET C#?
ReplyIf yes then how?
Thanks in advance.
Bytes
Posted by Legacy on 11/01/2002 12:00amOriginally posted by: Hovik
How i can convert segments to bytes
ReplyI what to now how bytes i send and recieved
Loading, Please Wait ...