Getting Started with IP Helper
The following is a step-by-step guide to getting started programming using the IP Helper application programming interface (API). It is designed to provide an understanding of basic IP Helper functions and data structures, and how they work together.
The application that is used for illustration is a very basic IP Helper application. More advanced code examples are included in the samples included with the Microsoft Windows Software Development Kit (SDK).
The first step is the same for most IP Helper applications.
The following sections describe the remaining steps for creating this basic IP Helper application.
- Retrieving Information Using GetNetworkParams
- Managing Network Adapters Using GetAdaptersInfo
- Managing Interfaces Using GetInterfaceInfo
- Managing IP Addresses Using GetIpAddrTable
- Managing DHCP Leases Using IpReleaseAddress and IpRenewAddress
- Managing IP Addresses Using AddIPAddress and DeleteIPAddress
- Retrieving Information Using GetIpStatistics
- Retrieving Information Using GetTcpStatistics
The complete source code for this basic IP Helper example.
Advanced IP Helper Samples
Several more advanced IP Helper samples are included with the Microsoft Windows Software Development Kit (SDK). By default, the IP Helper sample source code is installed by the Windows SDK released for Windows 7 in the following directory:
C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\NetDs\IPHelp
The more advanced samples listed below are found in the following directories:
EnableRouter
This directory contains a sample that demonstrates how to use the EnableRouter and UnenableRouter IP Helper functions to enable and disable IPv4 forwarding on the local computer.
iparp
This directory contains a sample program that demonstrates how to use the IP Helper functions to display and manipulate entries in the IPv4 ARP table on the local computer.
ipchange
This directory contains a sample program that demonstrates how to use IP Helper functions to programmatically change an IP address for a specific network adapter on your machine. This program also demonstrates how to retrieve existing network adapter IP configuration information.
IPConfig
This directory contains a sample program that demonstrates how to programmatically retrieve IPv4 configuration information similar to the IPCONFIG.EXE utility. It demonstrates how to use the GetNetworkParams and GetAdaptersInfo functions. Note that the GetAdaptersInfo function only retrieves IPv4 information.
IPRenew
This directory contains a sample program that demonstrates how to programmatically release and renew IPv4 addresses obtained through DHCP. This program also demonstrates how to retrieve existing network adapter configuration information.
IPRoute
This directory contains a sample program that demonstrates how to use the IP Helper functions to manipulate the IPv4 routing table.
ipstat
This directory contains a sample program that demonstrates how to use the IP Helper functions to show IPv4 connections for a protocol. By default, statistics are shown for IP, ICMP, TCP and UDP.
Netinfo
This directory contains a sample program that demonstrates how to the use the new IP Helper APIs introduced on Windows Vista and later to display/change address and interface information for IPv4 and IPv6.