Skip to content

Latest commit

 

History

History
190 lines (136 loc) · 5.96 KB

nf-iphlpapi-getipnettable.md

File metadata and controls

190 lines (136 loc) · 5.96 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:iphlpapi.GetIpNetTable
GetIpNetTable function (iphlpapi.h)
The GetIpNetTable function retrieves the IPv4 to physical address mapping table.
GetIpNetTable
GetIpNetTable function [IP Helper]
_iphlp_getipnettable
iphlp.getipnettable
iphlpapi/GetIpNetTable
iphlp\getipnettable.htm
IpHlp
01bcf86e-5fcc-4ce9-bb89-02d393e75d1d
12/05/2018
GetIpNetTable, GetIpNetTable function [IP Helper], _iphlp_getipnettable, iphlp.getipnettable, iphlpapi/GetIpNetTable
iphlpapi.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Iphlpapi.lib
Iphlpapi.dll
Windows
19H1
GetIpNetTable
iphlpapi/GetIpNetTable
c++
APIRef
kbSyntax
DllExport
Iphlpapi.dll
GetIpNetTable

GetIpNetTable function

-description

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

-parameters

-param IpNetTable [out]

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

-param SizePointer [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.

-param Order [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.

-returns

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 code Description
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.

-see-also

CreateIpNetEntry

DeleteIpNetEntry

FlushIpNetTable

GetIpNetTable2

IP Helper Function Reference

IP Helper Start Page

MIB_IPNETROW

MIB_IPNETTABLE

SetIpNetEntry