65.9K
CodeProject is changing. Read more.
Home

Using IP Helper API’s

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.94/5 (9 votes)

Nov 1, 2001

2 min read

viewsIcon

288273

downloadIcon

3931

This article demonstrates the usage of the Internet Protocol Helper API's

Sample Image - TCPInfo.jpg

Introduction

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 API’s can do. In the sample application following API's 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