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.


Download Executable - 15 KBs
Download source - 51 KB


  • Network Programing

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

    Originally posted by: Ghazanfar

    This is really good for network metrics

  • 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...
    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: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.

  • 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



    • 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

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

  • 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

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

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

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

  • 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

  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • On-demand Event Event Date: September 17, 2014 Another day, another end-of-support deadline. You've heard enough about the hazards of not migrating to Windows Server 2008 or 2012. What you may not know is that there's plenty in it for you and your business, like increased automation and performance, time-saving technical features, and a lower total cost of ownership. Check out this webcast and join Rich Holmes, Pomeroy's practice director of virtualization, as he discusses the future state of your servers, …

  • Agile methodologies give development and test teams the ability to build software at a faster rate than ever before. Combining DevOps with hybrid cloud architectures give teams not just the principles, but also the technology necessary to achieve their goals. By combining hybrid cloud and DevOps: IT departments maintain control, visibility, and security Dev/test teams remain agile and collaborative Organizational barriers are broken down Innovation and automation can thrive Download this white paper to …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds