Partager via


NotifyStableUnicastIpAddressTable (NETIOAPI) (Compact 2013)

3/26/2014

This function retrieves the stable unicast IP address table on a local device.

Syntax

NETIOAPI_API
  NotifyStableUnicastIpAddressTable(
    IN ADDRESS_FAMILY  Family,
    IN OUT PMIB_UNICASTIPADDRESS_TABLE*  Table,
    IN PSTABLE_UNICAST_IPADDRESS_TABLE_CALLBACK  CallerCallback,
    IN PVOID  CallerContext,
    IN OUT HANDLE*  NotificationHandle
    );

Parameters

  • Family
    The address family to retrieve.

    Possible values for the address family are listed in the Winsock2.h header file. Note that the values for the AF_ address family and PF_ protocol family constants are identical (for example, AF_INET and PF_INET). Therefore, you can use either constant.

    Possible values for the Family parameter are defined in the Ws2def.h header file. Note that the Ws2def.h header file is automatically included in Netioapi.h and you should never use Ws2def.h directly.

    The following values are currently supported for the address family:

    • AF_UNSPEC
      The address family is unspecified. When this value is specified, the function retrieves the stable unicast IP address table that contains both IPv4 and IPv6 entries.
    • AF_INET
      The IPv4 address family. When this value is specified, the function retrieves the stable unicast IP address table that contains only IPv4 entries.
    • AF_INET6
      The IPv6 address family. When this value is specified, the function retrieves the stable unicast IP address table that contains only IPv6 entries.
  • Table
    A pointer to a MIB_UNICASTIPADDRESS_TABLE structure. When NotifyStableUnicastIpAddressTable is successful, this parameter returns the stable unicast IP address table on the local device.

    When NotifyStableUnicastIpAddressTable returns ERROR_IO_PENDING, that indicates that the I/O request is pending, the stable unicast IP address table is returned to the function in the CallerCallback parameter.

  • CallerCallback
    A pointer to the function to call with the stable unicast IP address table. This function is called if NotifyStableUnicastIpAddressTable returns ERROR_IO_PENDING, that indicates that the I/O request is pending.
  • CallerContext
    A user context that is passed to the callback function that is specified in the CallerCallback parameter when the stable unicast IP address table is available.
  • NotificationHandle
    A pointer that is used to return a handle that your driver can use to cancel the request to retrieve the stable unicast IP address table. This parameter is returned if the return value from NotifyStableUnicastIpAddressTable is ERROR_IO_PENDING, that indicates that the I/O request is pending.

Return Value

NotifyStableUnicastIpAddressTable returns STATUS_SUCCESS and the stable unicast IP table is returned in the Table parameter if the function succeeds immediately.

If the I/O request is pending, the function returns ERROR_IO_PENDING and the function that the CallerCallback parameter points to is called when the I/O request has completed with the stable unicast IP address table.

If the function fails, NotifyStableUnicastIpAddressTable returns one of the following error codes:

Error Code

Meaning

ERROR_INVALID_HANDLE

An internal error occurred where an invalid handle was encountered.

STATUS_INVALID_PARAMETER

An invalid parameter was passed to the function. This error is returned if the Table parameter was a NULL pointer, the NotificationHandle parameter was a NULL pointer, or the Family parameter was not either AF_INET, AF_INET6, or AF_UNSPEC.

STATUS_NOT_ENOUGH_MEMORY

There was insufficient memory.

Other

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

Remarks

All unicast IP addresses, except dial-on-demand addresses, are considered stable only if they are in the preferred state. For a normal unicast IP address entry, this state would correspond to a DadState member of the MIB_UNICASTIPADDRESS_ROW for the IP address that is set to IpDadStatePreferred. Every dial-on-demand address defines its own stability metric.

Your driver must set the Family parameter to either AF_INET, AF_INET6, or AF_UNSPEC.

When NotifyStableUnicastIpAddressTable is successful and returns STATUS_SUCCESS, the Table parameter returns the stable unicast IP address table on the local device.

When NotifyStableUnicastIpAddressTable returns ERROR_IO_PENDING, that indicates that the I/O request is pending, the stable unicast IP address table is returned to the function in the CallerCallback parameter.

The callback function that is specified in the CallerCallback parameter should be defined as a function of type VOID. The parameters that are passed to the callback function include the following.

Parameter

Description

IN PVOID CallerContext

The CallerContext parameter that is passed to the NotifyStableUnicastIpAddressTable function when it is registering the driver for notifications.

IN PMIB_UNICASTIPADDRESS_TABLE AddressTable

A pointer to a MIB_UNICASTIPADDRESS_TABLE structure that contains the stable unicast IP address table on the local device.

To cancel the notification after the callback is complete, call the CancelMibChangeNotify2 (NETIOAPI) function, passing the NotificationHandle parameter that NotifyStableUnicastIpAddressTable returns.

See Also

Reference

IP Helper Kernel-Mode Functions
CancelMibChangeNotify2 (NETIOAPI)
CreateUnicastIpAddressEntry (NETIOAPI)
DeleteUnicastIpAddressEntry (NETIOAPI)
GetUnicastIpAddressEntry (NETIOAPI)
GetUnicastIpAddressTable (NETIOAPI)
InitializeUnicastIpAddressEntry (NETIOAPI)
MIB_NOTIFICATION_TYPE
MIB_UNICASTIPADDRESS_ROW
MIB_UNICASTIPADDRESS_TABLE
NotifyUnicastIpAddressChange (NETIOAPI)
SetUnicastIpAddressEntry (NETIOAPI)