IP Helper Functions

Chapter 16

IP Helper Functions

This chapter will introduce you to API functions that allow you to query and manage IP characteristics on your computer. The functions are designed to help you programmatically achieve the functionality that is available in the following standard IP utilities:

  • IPCONFIG.EXE (or WINIPCFG.EXE in Microsoft Windows 95, Windows 98, and Windows Me) Displays IPv4 configuration information and permits you to release and renew DHCP-assigned IPv4 addresses.

  • IPV6.EXE A new API has been introduced that enumerates IPv6 addresses similar to the IPV6.EXE or NETSH.EXE commands. This utility will simply be entitled IPCONFIGV6.EXE.

  • NETSTAT.EXE Displays the TCP connection table, the UDP listener table, and the IPv4 protocol statistics.

  • ROUTE.EXE Displays and manipulates IPv4 routing tables.

  • ARP.EXE Displays and modifies the IPv4-to-physical address translation tables that ARP uses.

The functions described in this chapter are available mainly in Windows 98, Windows Me, Windows 2000, and Windows XP. Several are also available in Windows NT 4.0 Service Pack 4 or later; however, none are available in Windows 95. We will point out platform specifics as we discuss each function. The prototypes for all of the functions described in this chapter are defined in IPHLPAPI.H. In addition, many of the data structures are defined in IPTYPES.H. When you are building your application, you must link it to the library file IPHLPAPI.LIB.

The samples provided for this chapter, which mimic the well-known system utilities, are located in the directory SAMPLES\CHAPTER16.

Note that the IP Helper APIs were developed before the availability of IPv6 on the Windows platforms. Therefore, all of the APIs return information about IPv4 only except for a single new IP Helper API GetAdaptersAddresses, which is discussed in the next section.



Network Programming for Microsoft Windows
Network Programming for Microsoft Windows (Microsoft Professional Series)
ISBN: 0735605602
EAN: 2147483647
Year: 2001
Pages: 172
Authors: Anthony Jones

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net