Freigeben über


IP_ADAPTER_ADDRESSES (Compact 2013)

3/26/2014

This structure is the header node for a linked list of addresses for a particular adapter. This structure can concurrently be used as part of a linked list of IP_ADAPTER_ADDRESSES structures.

Syntax

typedef struct _IP_ADAPTER_ADDRESSES {
  union {
    ULONGLONG Alignment;
    struct {
      ULONG Length;
      DWORD IfIndex;
    };
  };
  struct _IP_ADAPTER_ADDRESSES* Next;
  PCHAR AdapterName;
  PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
  PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress;
  PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress;
  PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress;
  PWCHAR DnsSuffix;
  PWCHAR Description;
  PWCHAR FriendlyName;
  BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
  DWORD PhysicalAddressLength;
  DWORD Flags;
  DWORD Mtu;
  DWORD IfType;
  IF_OPER_STATUS OperStatus;
  DWORD Ipv6IfIndex;
  DWORD ZoneIndices[16];
  PIP_ADAPTER_PREFIX FirstPrefix;
  ULONG64 TransmitLinkSpeed;
  ULONG64 ReceiveLinkSpeed;
  PIP_ADAPTER_WINS_SERVER_ADDRESS_LH FirstWinsServerAddress;
  PIP_ADAPTER_GATEWAY_ADDRESS_LH FirstGatewayAddress;
  ULONG Ipv4Metric;
  ULONG Ipv6Metric;
  IF_LUID Luid;
  SOCKET_ADDRESS Dhcpv4Server;
  NET_IF_COMPARTMENT_ID CompartmentId;
  NET_IF_NETWORK_GUID NetworkGuid;
  NET_IF_CONNECTION_TYPE ConnectionType;
  TUNNEL_TYPE TunnelType;
  SOCKET_ADDRESS Dhcpv6Server;
  BYTE Dhcpv6ClientDuid[MAX_DHCPV6_DUID_LENGTH];
  ULONG Dhcpv6ClientDuidLength;
  ULONG Dhcpv6Iaid;
  #if (NTDDI_VERSION >= NTDDI_VISTASP1)
  PIP_ADAPTER_DNS_SUFFIX FirstDnsSuffix;
  #endif
} IP_ADAPTER_ADDRESSES,
  *PIP_ADAPTER_ADDRESSES;

Members

  • Alignment
    Reserved. Used by the compiler to align the structure.
  • Length
    The length of this structure.
  • IfIndex
    The index of the IPv4 interface with which these addresses are associated. This member is zero if IPv4 is not available on the interface.
  • Next
    Pointer to the next list of adapter addresses.
  • AdapterName
    An array of characters that contains the name of the adapter with which these addresses are associated. Unlike an adapter's friendly name, the adapter name that is specified in AdapterName is permanent and cannot be modified by the user.
  • FirstUnicastAddress
    A pointer to the first IP_ADAPTER_UNICAST_ADDRESS structure in a linked list of IP unicast addresses for the adapter
  • FirstAnycastAddress
    A pointer to the first IP_ADAPTER_ANYCAST_ADDRESS structure in a linked list of IP anycast addresses for the adapter.
  • DnsSuffix
    A description for the adapter. This member is read-only.
  • Description
    A description for the adapter. This member is read-only.
  • FriendlyName
    A user-friendly name for the adapter. For example: "Local Area Connection 1." This name appears in contexts such as the ipconfig command line program and the Connection folder. This member is read-only and cannot be modified by using any IP Helper functions. This member is the ifAlias field that is used by NDIS as described in RFC 2863. The ifAlias field can be set by an NDIS interface provider when the NDIS driver is installed. For NDIS miniport drivers, this field is set by NDIS.
  • PhysicalAddress
    The Media Access Control (MAC) address for the adapter. For example, on an Ethernet network this member would specify the Ethernet hardware address.
  • PhysicalAddressLength
    The length, in bytes, of the address specified in the PhysicalAddress member. For interfaces that do not have a data-link layer, this value is zero.
  • Flags
    A set of flags specifying various settings for the adapter. These values are defined in the Iptypes.h header file. Combinations of these flag bits are possible.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th><p>Flag</p></th>
<th><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>IP_ADAPTER_DDNS_ENABLED</p></td>
<td><p>Dynamic DNS is enabled for the adapter.</p></td>
</tr>
<tr class="even">
<td><p>IP_ADAPTER_REGISTER_ADAPTER_SUFFIX</p></td>
<td><p>Register the DNS suffix for the adapter.</p></td>
</tr>
<tr class="odd">
<td><p>IP_ADAPTER_DHCP_ENABLED</p></td>
<td><p>Dynamic Host Configuration Protocol (DHCP) is enabled on the adapter.</p></td>
</tr>
<tr class="even">
<td><p>IP_ADAPTER_RECEIVE_ONLY</p>
<p>0x0008</p></td>
<td><p>The adapter is a receive-only adapter.</p></td>
</tr>
<tr class="odd">
<td><p>IP_ADAPTER_NO_MULTICAST</p>
<p>0x0010</p></td>
<td><p>The adapter is not a multicast recipient.</p></td>
</tr>
<tr class="even">
<td><p>IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG</p>
<p>0x0020</p></td>
<td><p>The adapter contains other IPv6-specific stateful configuration information.</p></td>
</tr>
<tr class="odd">
<td><p>IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED</p>
<p>0x0040</p></td>
<td><p>The adapter is enabled for NetBIOS over TCP/IP.</p></td>
</tr>
<tr class="even">
<td><p>IP_ADAPTER_IPV4_ENABLED</p>
<p>0x0080</p></td>
<td><p>The adapter is enabled for IPv4.</p></td>
</tr>
<tr class="odd">
<td><p>IP_ADAPTER_IPV6_ENABLED</p>
<p>0x0100</p></td>
<td><p>The adapter is enabled for IPv6.</p></td>
</tr>
<tr class="even">
<td><p>Ipv6ManagedAddressConfigurationSupported</p>
<p>0x0200</p></td>
<td><p>The adapter is enabled for IPv6 managed address configuration.</p></td>
</tr>
</tbody>
</table>
  • Mtu
    The maximum transmission unit (MTU), in bytes.
  • IfType
    The type of interface that uses the values that are defined by the Internet Assigned Numbers Authority (IANA). These values are listed in the header file Ipifcons.h.
The following table lists common values for the interface type although many other values are possible.


<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th><p><strong>Value</strong></p></th>
<th><p><strong>Meaning</strong></p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>IF_TYPE_OTHER</p>
<p>1</p></td>
<td><p>Some other type of network interface.</p></td>
</tr>
<tr class="even">
<td><p>IF_TYPE_ETHERNET_CSMACD</p>
<p>6</p></td>
<td><p>An Ethernet network interface.</p></td>
</tr>
<tr class="odd">
<td><p>IF_TYPE_ISO88025_TOKENRING</p>
<p>9</p></td>
<td><p>A token ring network interface.</p></td>
</tr>
<tr class="even">
<td><p>IF_TYPE_PPP</p>
<p>23</p></td>
<td><p>A PPP network interface.</p></td>
</tr>
<tr class="odd">
<td><p>IF_TYPE_SOFTWARE_LOOPBACK</p>
<p>24</p></td>
<td><p>A software loopback network interface.</p></td>
</tr>
<tr class="even">
<td><p>IF_TYPE_ATM</p>
<p>37</p></td>
<td><p>An ATM network interface.</p></td>
</tr>
<tr class="odd">
<td><p>IF_TYPE_IEEE80211</p>
<p>71</p></td>
<td><p>An IEEE 802.11 wireless network interface.</p></td>
</tr>
<tr class="even">
<td><p>IF_TYPE_TUNNEL</p>
<p>131</p></td>
<td><p>A tunnel type encapsulation network interface.</p></td>
</tr>
<tr class="odd">
<td><p>IF_TYPE_IEEE1394</p>
<p>144</p></td>
<td><p>An IEEE 1394 (Firewire) high performance serial bus network interface.</p></td>
</tr>
</tbody>
</table>
  • OperStatus
    The operational status for the interface as defined in RFC 2863. This member can be one of the values from the IF_OPER_STATUS enumeration type that is defined in the Iftypes.h header file.
<table>
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<thead>
<tr class="header">
<th><p><strong>Value</strong></p></th>
<th><p><strong>Meaning</strong></p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>IfOperStatusUp</p>
<p>1</p></td>
<td><p>The interface is up and able to pass packets.</p></td>
</tr>
<tr class="even">
<td><p>IfOperStatusDown</p>
<p>2</p></td>
<td><p>The interface is down and not in a condition to pass packets. The IfOperStatusDown state has two meanings, depending on the value of <strong>AdminStatus</strong> member. If <strong>AdminStatus</strong> is not set to NET_IF_ADMIN_STATUS_DOWN and <strong>ifOperStatus</strong> is set to IfOperStatusDown then a fault condition is presumed to exist on the interface. If <strong>AdminStatus</strong> is set to IfOperStatusDown, <strong>ifOperStatus</strong> will usually also be set to IfOperStatusDown or IfOperStatusNotPresent and there is not necessarily a fault condition on the interface.</p></td>
</tr>
<tr class="odd">
<td><p>IfOperStatusTesting</p>
<p>3</p></td>
<td><p>The interface is in testing mode.</p></td>
</tr>
<tr class="even">
<td><p>IfOperStatusUnknown</p>
<p>4</p></td>
<td><p>The operational status of the interface is unknown.</p></td>
</tr>
<tr class="odd">
<td><p>IfOperStatusDormant</p>
<p>5</p></td>
<td><p>The interface is not actually in a condition to pass packets (it is not up), but is in a pending state, waiting for some external event. For on-demand interfaces, this new state identifies the situation where the interface is waiting for events to put it in the IfOperStatusUp state.</p></td>
</tr>
<tr class="even">
<td><p>IfOperStatusNotPresent</p>
<p>6</p></td>
<td><p>A refinement on the IfOperStatusDown state which indicates that the relevant interface is down specifically because some component (typically, a hardware component) is not present in the managed system.</p></td>
</tr>
<tr class="odd">
<td><p>IfOperStatusLowerLayerDown</p>
<p>7</p></td>
<td><p>A refinement on the IfOperStatusDown state. This new state indicates that this interface runs on top of one or more other interfaces and that this interface is down specifically because one or more of these lower-layer interfaces are down.</p></td>
</tr>
</tbody>
</table>
  • Ipv6IfIndex
    The interface index for the IPv6 IP address. Contains zero if IPv6 is not available on the interface.
  • ZoneIndices[16]
    The array of Scope IDs for each scope level. Used for composing sockaddr structures. The SCOPE_LEVEL enumeration is used to index the array. On IPv6, a single interface may be assigned multiple IPv6 multicast addresses based on a scope ID.
  • FirstPrefix
    A pointer to the first IP_ADAPTER_PREFIX structure in a linked list of IP adapter prefixes for the adapter.
  • TransmitLinkSpeed
    The current speed in bits per second of the transmit link for the adapter.
  • ReceiveLinkSpeed
    The current speed in bits per second of the receive link for the adapter.
  • FirstWinsServerAddress
    A pointer to the first IP_ADAPTER_WINS_SERVER_ADDRESS_LH structure in a linked list of WINS server addresses for the adapter.
  • FirstGatewayAddress
    A pointer to the first IP_ADAPTER_GATEWAY_ADDRESS_LH structure in a linked list of gateways for the adapter.
  • Ipv4Metric
    The IPv4 interface metric for the adapter address. This member is only applicable to an IPv4 adapter address.

    The actual route metric used to compute the route preferences for IPv4 is the summation of the route metric offset specified in the Metric member of the MIB_IPFORWARD_ROW2 structure and the interface metric specified in this member for IPv4.

  • Ipv6Metric
    The IPv6 interface metric for the adapter address. This member is only applicable to an IPv6 adapter address.

    The actual route metric used to compute the route preferences for IPv6 is the summation of the route metric offset specified in the Metric member of the MIB_IPFORWARD_ROW2 structure and the interface metric specified in this member for IPv4.

  • Luid
    The interface LUID for the adapter address.
  • Dhcpv4Server
    The IPv4 address of the DHCP server for the adapter address. This member is only applicable to an IPv4 adapter address configured by using DHCP.
  • CompartmentId
    The routing compartment ID for the adapter address.
  • NetworkGuid
    The GUID that is associated with the network that the interface belongs to. If the interface provider cannot be provided, the member can be a zero GUID.
  • ConnectionType
    The interface connection type for the adapter address.

    This member can be one of the values from the NET_IF_CONNECTION_TYPE enumeration type that is defined in the Ifdef.h header file.

    Value

    Meaning

    NET_IF_CONNECTION_DEDICATED

    1

    The connection type is dedicated. The connection comes up automatically when media sense is TRUE. For example, an Ethernet connection is dedicated.

    NET_IF_CONNECTION_PASSIVE

    2

    The connection type is passive. The remote end must bring the connection up to the local station. For example, a RAS interface is passive.

    NET_IF_CONNECTION_DEMAND

    3

    The connection type is demand-dial. A connection of this type comes up in response to a local action (sending a packet, for example).

    NET_IF_CONNECTION_MAXIMUM

    4

    The maximum possible value for the NET_IF_CONNECTION_TYPE enumeration type. This is not a legal value for ConnectionType member.

  • TunnelType
    The encapsulation method that is used by a tunnel if the adapter address is a tunnel.

    The tunnel type is defined by the Internet Assigned Names Authority (IANA). This member can be one of the values from the TUNNEL_TYPE enumeration type that is defined in the Ifdef.h header file.

    Value

    Meaning

    TUNNEL_TYPE_NONE

    0

    Not a tunnel.

    TUNNEL_TYPE_OTHER

    1

    None of the following tunnel types.

    TUNNEL_TYPE_DIRECT

    2

    A packet is encapsulated directly in a regular IP header, without a intermediate header, and unicast to the remote tunnel endpoint.

    TUNNEL_TYPE_6TO4

    11

    An IPv6 packet is encapsulated directly in an IPv4 header, without a intermediate header, and unicast to the destination determined by the 6to4 protocol.

    TUNNEL_TYPE_ISATAP

    13

    An IPv6 packet is encapsulated directly in an IPv4 header, without a intermediate header, and unicast to the destination determined by the ISATAP protocol.

  • Dhcpv6Server
    The IPv6 address of the DHCPv6 server for the adapter address. This member is only applicable to an IPv6 adapter address configured by using DHCPv6.
  • Dhcpv6ClientDuid
    The DHCP unique identifier (DUID) for the DHCPv6 client. This member is only applicable to an IPv6 adapter address configured by by using DHCPv6.
  • Dhcpv6ClientDuidLength
    The length, in bytes, of the DHCP unique identifier (DUID) for the DHCPv6 client. This member is only applicable to an IPv6 adapter address configured by using DHCPv6.
  • Dhcpv6Iaid
    The identifier for an identity association selected by the DHCPv6 client. This member is only applicable to an IPv6 adapter address configured by using DHCPv6.
  • FirstDnsSuffix
    A pointer to the first IP_ADAPTER_DNS_SUFFIX structure in a linked list of DNS suffixes for the adapter.

Remarks

The GetAdaptersAddresses function retrieves information for IPv4 and IPv6 addresses and returns this information as a linked list of IP**_ADAPTER_ADDRESSES** structures

The adapter index values specified in the IfIndex and Ipv6IfIndex members may change when an adapter is disabled and then enabled, or under other circumstances, and should not be considered persistent.

The values for the IfType member are defined in the Ipifcons.h header file. Only the possible values listed in the description of the IfType member are currently supported.

The Ipv4Metric and Ipv6Metric members are used to prioritize route metrics for routes connected to multiple interfaces on the local device.

The order of linked IP_ADAPTER_UNICAST_ADDRESS structures pointed to by the FirstUnicastAddress member that are returned by the GetAdaptersAddresses function does not reflect the order that IP addresses were added to an adapter and may vary between versions of Windows. Similarly, the order of linked IP_ADAPTER_ANYCAST_ADDRESS structures pointed to by the FirstAnycastAddress member and the order of linked IP_ADAPTER_MULTICAST_ADDRESS structures pointed to by the FirstMulticastAddress member do not reflect the order that IP addresses were added to an adapter and may vary between versions of Windows.

In addition, the linked IP_ADAPTER_UNICAST_ADDRESS structures pointed to by the FirstUnicastAddress member and the linked IP_ADAPTER_PREFIX structures pointed to by the FirstPrefix member are maintained as separate internal linked lists by the operating system. Therefore, the order of linked IP_ADAPTER_UNICAST_ADDRESS structures pointed to by the FirstUnicastAddress member has no relationship with the order of linked IP_ADAPTER_PREFIX structures pointed to by the FirstPrefix member.

The SOCKET_ADDRESS structure is used in the IP_ADAPTER_ADDRESSES structure. On the Windows SDK, the organization of header files has changed and the SOCKET_ADDRESS structure is defined in the Ws2def.h header file which is automatically included by the Winsock2.h header file.

Requirements

Header

iptypes.h

See Also

Reference

IP Helper Structures