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. |
You can use IP Helper to perform Address Resolution Protocol (ARP) operations for the local computer. Use the following functions to retrieve and modify the ARP table.
The GetIpNetTableretrieves the ARP table. The ARP table contains the mapping of IP addresses to physical addresses. Physical addresses are sometimes referred to as Media Access Controller (MAC) addresses. Changes to this table can be made with SetIpNetEntry.
Use the CreateIpNetEntryand DeleteIpNetEntryfunctions to add or remove particular ARP entries to or from the table. The FlushIpNetTablefunction deletes all entries from the table.
To create or delete proxy ARP entries, use the CreateProxyArpEntryand DeleteProxyArpEntryfunctions.
The SendARPfunction sends an ARP request to the local network.
The following table describes each GetIpNetTablevariable.
Value | Description |
---|---|
pIpNetTable |
Pointer to a buffer that, on successful return, contains the IP-to-physical address mapping table as a MIB_IPNETTABLE structure. |
pdwSize |
Specifies the size of the buffer pointed to by the pIpNetTableparameter. 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_IPNETTABLE |
dwNumEntries Specifies the number of ARP entries in the table. table[ANY_SIZE] Pointer to a table of ARP entries implemented as an array of MIB_IPNETROWstructures. |
MIB_IPNETROW (All fields are read-write, and can be changed by the API user with the SetIpNetEntryfunction) |
dwIndex Specifies the index of the adapter. dwPhysAddrLen Specifies the length of the physical address. bPhysAddr[MAXLEN_PHYSADDR] Specifies the physical address. dwAddr Specifies the IP address. dwType Specifies the type of ARP entry. This type can be one of the following values. 4 Static 3 Dynamic 2 Invalid 1 Other |
The following table describes each CreateIpNetEntryvariable.
Value | Description |
---|---|
pArpEntry |
Pointer to a MIB_IPNETROWstructure that specifies information for the new entry. The caller must specify values for all members of this structure. (See GetIpNetTabletable, above). |
The following table describes each DeleteIpNetEntryvariable.
Value | Description |
---|---|
pArpEntry |
Pointer to a MIB_IPNETROWstructure. The information in this structure identifies the entry to delete. The caller must specify values for at least the dwIndexand dwAddrmembers of this structure. (See GetIpNetTabletable, above). |
The following table describes each FlushIpNetTablevariable.
Value | Description |
---|---|
dwIfIndex |
Specifies the index of the interface for which to delete all ARP entries. |
The following table describes each CreateProxyArpEntryvariable.
Value | Description |
---|---|
dwAddress |
Specifies the IP address for which this computer acts as a proxy. |
dwMask |
Specifies the subnet mask for the IP address specified by the dwAddressparameter. |
dwIfIndex |
Specifies the index of the interface on which to proxy ARP for the IP address specified by the dwAddressparameter. In other words, when an ARP request for dwAddressis received on this interface, the local computer responds with the physical address of this interface. If this interface is of a type that does not support ARP, such as PPP, then the call fails. |
The following table describes each DeleteProxyArpEntryvariable.
Value | Description |
---|---|
dwAddress |
Specifies the IP address for which this computer is acting as a proxy. |
dwMask |
Specifies the subnet mask for the IP address specified by the dwAddressparameter. |
dwInIndex |
Specifies the index of the interface on which this computer is supporting proxy ARP for the IP address specified by dwAddress. |
The following table describes each SendARPvariable.
Value | Description |
---|---|
DestIp |
Specifies the destination IP address. The ARP request attempts to obtain the physical address that corresponds to this IP address. |
SrcIP |
Specifies the IP address of the sender. This parameter is optional. The caller may specify zero for the parameter. |
pMacAddr |
Pointer to a ULONGvariable. On successful return, this variable contains the physical address that corresponds to the IP address specified by the DestIPparameter. |
PhyAddrLen |
Pointer to a ULONGvariable. On successful return, this variable contains the length of the physical address pointed to by the pMacAddrparameter. |