Managing Interfaces (Windows CE 5.0)
IP Helper extends your abilities to manage network interfaces. Use the functions described following to manage interfaces on the local computer.
Interfaces are related to adapters in that there is a one-to-one correspondence between the interfaces and adapters on a given computer. An interface is an IP-level abstraction, whereas an adapter is a datalink-level abstraction.
The GetNumberOfInterfaces function returns the number of interfaces on the local computer.
The GetInterfaceInfo function returns a table that contains the names and corresponding indexes for the interfaces on the local computer.
The GetFriendlyIfIndex function takes an interface index and returns a backward-compatible interface index, that is, one that uses only the lower 24 bits. This type of index is sometimes referred to as a friendly interface index.
The GetIfEntry function returns a MIB_IFROW structure that contains information about a particular interface on the local computer. This function requires the caller to supply the index of the interface.
The GetIfTable function returns a table of MIB_IFROW entries, one for each interface on the computer.
Use the SetIfEntry function to modify the configuration of a particular interface.
The following table describes each GetNumberOfInterfaces variable.
Value | Description |
---|---|
pdwNumIf | Pointer to a DWORD variable that, on successful return, contains the number of interfaces on the local computer. |
The following table describes each GetInterfaceInfo variable and IP_INTERFACE_INFO member.
Value | Description |
---|---|
pIfTable | (Read-only) Pointer to a buffer that receives an IP_INTERFACE_INFO structure that contains the list of adapters. This buffer should be allocated by the caller. |
dwOutBufLen | (Read-only) Pointer to a DWORD variable. If the buffer pointed to by the pIfTable parameter is NULL, or is not large enough to contain the list of adapters, GetInterfaceInfo returns the required size in this DWORD variable. |
IP_INTERFACE_INFO | NumAdapters
Adapter[1]
|
IP_ADAPTER_INDEX_MAP | Index
Name[MAX_ADAPTER_NAME]
|
The following table describes each GetFriendlyIfIndex variable.
Value | Description |
---|---|
IfIndex | Specifies an interface index from which the backward-compatible or friendly interface index is derived. |
The following table describes each GetIfEntry variable and MIB_IFROW member.
Value | Description |
---|---|
pIfRow | Pointer to a MIB_IFROW structure that, on successful return, contains information for an interface on the local computer. Set the dwIndex member of MIB_IFROW to the index of the interface for which to retrieve information. |
MIB_IFROW
(All fields are read-write, and can be changed by the API user with the SetIfEntry function) |
wszName[MAX_INTERFACE_NAME_LEN]
dwIndex
dwType
dwMtu
dwSpeed
dwPhysAddrLen
bPhysAddr[MAXLEN_PHYSADDR]
dwAdminStatus
dwOperStatus
dwLastChange
dwInOctets
dwInUcastPkts
dwInNUcastPkts
dwInDiscards
dwInErrors
DwInUnknownProtos
dwOutOctets
dwOutUcastPkts
dwOutNUcastPkts
dwOutDiscards
dwOutErrors
dwOutQLen
dwDescrLen
bDescr[MAXLEN_IFDESCR]
|
The following table describes each GetIfTable variable and MIB_IFTABLE member.
Value | Description |
---|---|
pIfTable | Pointer to a buffer that, on successful return, contains the interface table as a MIB_IFTABLE structure. |
pdwSize | Specifies the size of the buffer pointed to by the pIfTable parameter. If the buffer is not large enough to hold the returned interface table, the function sets this parameter equal to the required buffer size. |
bOrder | Specifies whether the returned interface table should be sorted in ascending order by interface index. If this parameter is TRUE, the table is sorted. |
MIB_IFTABLE | dwNumEntries
table[ANY_SIZE]
|
The following table describes each SetIfEntry variable:
Value | Description |
---|---|
pIfRow | Pointer to a MIB_IFROW structure. (See GetIfEntry table, above). The dwIndex member of this structure should specify the interface on which to set administrative status. The dwAdminStatus member specifies the new administrative status. The following list shows the possible values for the dwAdminStatus member:
|
See Also
Send Feedback on this topic to the authors