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 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


Comments

  • Network Programing

    Posted by Legacy on 12/19/2003 12:00am

    Originally posted by: Ghazanfar

    This is really good for network metrics

    Reply
  • undeclared identifiers problem...

    Posted by Legacy on 09/27/2003 12:00am

    Originally posted by: moshe masas

    --------------------Configuration: TCPInfo - Win32 Release--------------------
    My devastudo generated the following errors output above...

    Compiling resources...
    Compiling...
    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.

    Reply
  • How can I manage special computers on my local network

    Posted by Legacy on 08/05/2003 12:00am

    Originally 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?
    Thank you for reply person.

    Reply
  • SetTcpEntry --- Network Access is Denied

    Posted by Legacy on 03/29/2003 12:00am

    Originally 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

    • You implement in .Net ?

      Posted by vitoto on 05/27/2005 12:57am

      Hi, i need use this Function in .Net any idea ? Look, Networking Information Class in Net Framework 2.0

      Reply
    Reply
  • segments to bytes?

    Posted by Legacy on 01/21/2003 12:00am

    Originally posted by: Scampi

    How I can convert segments to bytes?
    I need to how bytes i send and receive.

    Reply
  • Super Thanks to you!!

    Posted by Legacy on 01/02/2003 12:00am

    Originally 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:00am

    Originally posted by: Simon Thomas

    Ive tried the executable this works fine. I havent compiled the source code for myself- I am sure this works. Can you tell me where you got your source code from as I am attempting to write a similiar sort of program but I dont want to copy exactly what you have written.
    
    Many Thanks.
    Keep coding!!

    Reply
  • How can I retrieve adapt info (name, description, ip-address) on NT SP 4.0 platforms?

    Posted by Legacy on 11/29/2002 12:00am

    Originally 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:00am

    Originally posted by: Kuntal

    Can I use IP Helper API in Visual Studio.NET C#?
    If yes then how?
    Thanks in advance.

    Reply
  • Bytes

    Posted by Legacy on 11/01/2002 12:00am

    Originally posted by: Hovik

    How i can convert segments to bytes
    I what to now how bytes i send and recieved

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • A help desk is critical to the operations of an IT services business. As a centralized intake location for technical issues, it allows for a responsive and timely solution to get clients and their staff back to business as usual. In addition to handling immediate IT issues, a help desk performs several proactive tasks to ensure clients' IT systems remain operational and downtime is minimized. Thus, utilizing a help desk and following best practices can improve the productivity, efficiency and satisfaction of …

  • The rapid evolution of enterprise storage technologies, combined with external forces, like the explosion of big data, can cause Linux® and server administrators to play catch-up when it comes to storage. Running a bunch of monolithic storage devices and proprietary, disconnected technologies forces administrators to spend valuable time creating and managing complex solutions. To reduce complexity and enable rapid deployment of new technologies and applications, server administrators need a single open …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds