Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

IP Helper can assist you in managing IP addresses that are associated with interfaces on the local computer. Use the functions described following for IP address management.

The GetIpAddrTablefunction retrieves a table that contains the mapping of IP addresses to interfaces. More than one IP address may be associated with the same interface.

Use the AddIPAddressfunction to add an IP address to a particular interface. To remove IP addresses that were previously added using AddIPAddress, use the DeleteIPAddressfunction. IP addresses added using the AddIPAddressfunction will not remain after reboot. Typically a valid interface already has an IP Address assigned to it. This function is used when an application needs to add an IP address or needs to add multiple IP addresses. For example, this function can be used to map IP addresses to devices that do not support IP, but are using Windows Embedded CE as a front end to access the network. When AddIPAddressis called, an ARP packet is sent to ensure that the address is not in use.

The IpReleaseAddressand IpRenewAddressfunctions require the local computer to be using Dynamic Host Configuration Protocol (DHCP). The IpReleaseAddressfunction releases an IP address that was previously obtained from DHCP. The IpRenewAddressfunction renews (or acquires) a DHCP lease on a particular IP address.

The following table describes each GetIpAddrTablevariable.

Value Description

pIpAddrTable

Pointer to a buffer that, on successful return, contains the interface–to–IP address mapping table as a MIB_IPADDRTABLE structure.

pdwSize

Specifies the size of the buffer pointed to by the pIpAddrTableparameter. If the buffer is not large enough to hold the returned mapping table, the function sets this parameter equal to the required buffer size.

bOrder

Specifies whether the returned mapping table should be sorted in ascending order by IP address. If this parameter is TRUE, the table is sorted.

MIB_IPADDRTABLE

(The table is read-only, but addresses can be added and removed using AddIPAddressand DeleteIPAddress)

dwNumEntries

Specifies the number of IP address entries in the table.

table[ANY_SIZE]

Pointer to a table of IP address entries implemented as an array of MIB_ADDRROWstructures.

The following table describes each AddIPAddressvariable.

Value Description

Address

Specifies the IP address to add to the adapter.

IpMask

Specifies the subnet mask for the IP address.

IfIndex

Specifies the adapter to which to add the address.

NTEXontext

Pointer to a ULONGvariable that, on successful return, points to the Net Table Entry (NTE) context for this IP address. The caller can later use this context in a call to DeleteIPAddress.

NTEInstance

Pointer to a ULONGvariable that, on successful return, points to the NTE instance for this IP address.

The following table describes each DeleteIPAddressvariable.

Value Description

NTEContext

Specifies the Net Table Entry (NTE) context for the IP address. This context was returned by the previous call to AddIPAddress.

The following table describes each IpReleaseAddressvariable and IP_ADAPTER_INDEX_MAPmember.

Value Description

AdapterInfo

Pointer to an IP_ADAPTER_INDEX_MAPstructure that identifies the adapter associated with the IP address to release.

IP_ADAPTER_INDEX_MAP

Index

Specifies the index of the adapter.

Name[MAX_ADAPTER_NAME]

Pointer to a Unicode string that contains the name of the adapter.

The following table describes each IpRenewAddressvariable.

Value Description

AdapterInfo

Pointer to an IP_ADAPTER_INDEX_MAPstructure that identifies the adapter associated with the IP address to release. See IpReleaseAddressabove for a description of IP_ADAPTER_INDEX_MAPmembers.

See Also