Export (0) Print
Expand All
Expand Minimize

GetIpNetTable function

The GetIpNetTable function retrieves the IPv4 to physical address mapping table.

Syntax


DWORD GetIpNetTable(
  _Out_    PMIB_IPNETTABLE pIpNetTable,
  _Inout_  PULONG pdwSize,
  _In_     BOOL bOrder
);

Parameters

pIpNetTable [out]

A pointer to a buffer that receives the IPv4 to physical address mapping table as a MIB_IPNETTABLE structure.

pdwSize [in, out]

On input, specifies the size in bytes of the buffer pointed to by the pIpNetTable parameter.

On output, if the buffer is not large enough to hold the returned mapping table, the function sets this parameter equal to the required buffer size in bytes.

bOrder [in]

A Boolean value that specifies whether the returned mapping table should be sorted in ascending order by IP address. If this parameter is TRUE, the table is sorted.

Return value

If the function succeeds, the return value is NO_ERROR or ERROR_NO_DATA.

If the function fails or does not return any data, the return value is one of the following error codes.

Return codeDescription
ERROR_INSUFFICIENT_BUFFER

The buffer pointed to by the pIpNetTable parameter is not large enough. The required size is returned in the DWORD variable pointed to by the pdwSize parameter.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function. This error is returned if the pdwSize parameter is NULL, or GetIpNetTable is unable to write to the memory pointed to by the pdwSize parameter.

ERROR_NO_DATA

There is no data to return. The IPv4 to physical address mapping table is empty. This return value indicates that the call to the GetIpNetTable function succeeded, but there was no data to return.

ERROR_NOT_SUPPORTED

The IPv4 transport is not configured on the local computer.

Other

Use FormatMessage to obtain the message string for the returned error.

 

Remarks

The GetIpNetTable function enumerates the Address Resolution Protocol (ARP) entries for IPv4 on a local system from the IPv4 to physical address mapping table and returns this information in a MIB_IPNETTABLE structure.

The IPv4 address entries are returned in a MIB_IPNETTABLE structure in the buffer pointed to by the pIpNetTable parameter. The MIB_IPNETTABLE structure contains a count of ARP entries and an array of MIB_IPNETROW structures for each IPv4 address entry.

Note that the returned MIB_IPNETTABLE structure pointed to by the pIpNetTable parameter may contain padding for alignment between the dwNumEntries member and the first MIB_IPNETROW array entry in the table member of the MIB_IPNETTABLE structure. Padding for alignment may also be present between the MIB_IPNETROW array entries. Any access to a MIB_IPNETROW array entry should assume padding may exist.

on Windows Vista and later, the GetIpNetTable2 function can be used to retrieve the neighbor IP addresses for both IPv6 and IPv4.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Iphlpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

IP Helper Start Page
IP Helper Function Reference
CreateIpNetEntry
DeleteIpNetEntry
FlushIpNetTable
GetIpNetTable2
MIB_IPNETROW
MIB_IPNETTABLE
SetIpNetEntry

 

 

Community Additions

ADD
Show:
© 2014 Microsoft