TCPInfo | CodeGuru

TCPInfo

Environment: Made in VC++ 6 for Win 98/NT/2000 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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Oct 31, 2001
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: Made in VC++ 6 for Win 98/NT/2000

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.

  1. Getting the TCP statistics such as active connections, segments sent and received etc.
  2. Getting the UDP statistics such as datagrams sent and received etc.
  3. Getting the IP statistics such as Reassembly time outs, invalid datagrams
    sent or received etc.
  4. Getting the ICMP statistics such as total ICMP messages sent or received,
    echo requests sent and echo replies received etc.
  5. Getting the active TCP connections with local and remote addresses and
    ports.
  6. 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.

  1. GetTcpStatistics()
    This API fills a MIB_TCPSTATS structure with TCP statistics. See sample application
    for usage.
  2. GetUdpStatistics()
    This API fills a MIB_UDPSTATS structure with UDP statistics. See sample application
    for usage.
  3. GetIpStatistics()
    This API fills a MIB_IPSTATS structure with IP statistics. See sample application for usage.
  4. GetIcmpStatistics()
    This API fills a MIB_ICMP structure with ICMP statistics about outgoing and incoming ICMP messages. See the sample application for usage.
  5. 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.
  6. 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 KBs

Download source – 51 KB

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.