IP ADAPTER INFO

From aldeid
Jump to navigation Jump to search

Description

The IP_ADAPTER_INFO structure contains information about a particular network adapter on the local computer.

Syntax

typedef struct _IP_ADAPTER_INFO {
  struct _IP_ADAPTER_INFO  *Next;
  DWORD                   ComboIndex;
  char                    AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
  char                    Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
  UINT                    AddressLength;
  BYTE                    Address[MAX_ADAPTER_ADDRESS_LENGTH];
  DWORD                   Index;
  UINT                    Type;
  UINT                    DhcpEnabled;
  PIP_ADDR_STRING         CurrentIpAddress;
  IP_ADDR_STRING          IpAddressList;
  IP_ADDR_STRING          GatewayList;
  IP_ADDR_STRING          DhcpServer;
  BOOL                    HaveWins;
  IP_ADDR_STRING          PrimaryWinsServer;
  IP_ADDR_STRING          SecondaryWinsServer;
  time_t                  LeaseObtained;
  time_t                  LeaseExpires;
} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;

Members

Next
Type: struct _IP_ADAPTER_INFO*
A pointer to the next adapter in the list of adapters.
ComboIndex
Type: DWORD
Reserved.
AdapterName
Type: char[MAX_ADAPTER_NAME_LENGTH + 4]
An ANSI character string of the name of the adapter.
Description
Type: char[MAX_ADAPTER_DESCRIPTION_LENGTH + 4]
An ANSI character string that contains the description of the adapter.
AddressLength
Type: UINT
The length, in bytes, of the hardware address for the adapter.
Address
Type: BYTE[MAX_ADAPTER_ADDRESS_LENGTH]
The hardware address for the adapter represented as a BYTE array.
Index
Type: DWORD
The adapter index.
The adapter index may change when an adapter is disabled and then enabled, or under other circumstances, and should not be considered persistent.
Type
Type: UINT
The adapter type. Possible values for the adapter type are listed in the Ipifcons.h header file.
The table below lists common values for the adapter type although other values are possible on Windows Vista and later.
Value Meaning
MIB_IF_TYPE_OTHER
1
Some other type of network interface.
MIB_IF_TYPE_ETHERNET
6
An Ethernet network interface.
IF_TYPE_ISO88025_TOKENRING
9
MIB_IF_TYPE_TOKENRING
MIB_IF_TYPE_PPP
23
A PPP network interface.
MIB_IF_TYPE_LOOPBACK
24
A software loopback network interface.
MIB_IF_TYPE_SLIP
28
An ATM network interface.
IF_TYPE_IEEE80211
71

An IEEE 802.11 wireless network interface. Note This adapter type is returned on Windows Vista and later. On Windows Server 2003 and Windows XP , an IEEE 802.11 wireless network interface returns an adapter type of MIB_IF_TYPE_ETHERNET.

DhcpEnabled
Type: UINT
An option value that specifies whether the dynamic host configuration protocol (DHCP) is enabled for this adapter.
CurrentIpAddress
Type: PIP_ADDR_STRING
Reserved.
IpAddressList
Type: IP_ADDR_STRING
The list of IPv4 addresses associated with this adapter represented as a linked list of IP_ADDR_STRING structures. An adapter can have multiple IPv4 addresses assigned to it.
GatewayList
Type: IP_ADDR_STRING
The IPv4 address of the gateway for this adapter represented as a linked list of IP_ADDR_STRING structures. An adapter can have multiple IPv4 gateway addresses assigned to it. This list usually contains a single entry for IPv4 address of the default gateway for this adapter.
DhcpServer
Type: IP_ADDR_STRING
The IPv4 address of the DHCP server for this adapter represented as a linked list of IP_ADDR_STRING structures. This list contains a single entry for the IPv4 address of the DHCP server for this adapter. A value of 255.255.255.255 indicates the DHCP server could not be reached, or is in the process of being reached.
This member is only valid when the DhcpEnabled member is nonzero.
HaveWins
Type: BOOL
An option value that specifies whether this adapter uses the Windows Internet Name Service (WINS).
PrimaryWinsServer
Type: IP_ADDR_STRING
The IPv4 address of the primary WINS server represented as a linked list of IP_ADDR_STRING structures. This list contains a single entry for the IPv4 address of the primary WINS server for this adapter.
This member is only valid when the HaveWins member is TRUE.
SecondaryWinsServer
Type: IP_ADDR_STRING
The IPv4 address of the secondary WINS server represented as a linked list of IP_ADDR_STRING structures. An adapter can have multiple secondary WINS server addresses assigned to it.
This member is only valid when the HaveWins member is TRUE.
LeaseObtained
Type: time_t
The time when the current DHCP lease was obtained.
This member is only valid when the DhcpEnabled member is nonzero.
LeaseExpires
Type: time_t
The time when the current DHCP lease expires.
This member is only valid when the DhcpEnabled member is nonzero.