
Interface (IF) Object
A-26
Get the Device Handle Corresponding to a Physical Index
IFIndexGetHandle
Syntax
HANDLE IFIndexGetHandle( uint Index );
Return Value
Handle to device corresponding to supplied index, or NULL on error.
Description
This function is called to convert a physical device index to a device handle.
Get the Physical Index Corresponding to a Device Handle
IFGetIndex
Syntax
uint IFGetIndex( HANDLE hIF );
Return Value
Physical device index corresponding to supplied device handle, or NULL on
error.
Description
This function is called to convert a device handle to a physical device index.
Get the Interface Handle Type
IFGetType
Syntax
uint IFGetType( HANDLE hIF );
Return Value
Handle type of supplied handle.
Description
This function is called to get the handle type of the supplied device handle.
When called correctly, the return value should be one of the following:
HTYPE_ETH
Ether Device
HTYPE_PPP
PPP Device
Get the MTU of a Device
IFGetMTU
Syntax
uint IFGetMTU( HANDLE hIF );
Return Value
MTU of the device indicated by the supplied handle.
Description
This function is called to get the MTU (maximum transmit unit) size of the indi-
cated device. The MTU value does not include the device’s layer 2 header.
Thus for Ethernet and serial PPP, the MTU will normally be 1500, however for
protocols like PPPoE, the MTU will be smaller.
Set Device Header and Padding Requirements
IFSetPad
Syntax
void IFSetPad( uint Header, uint Padding );
Return Value
nothing
Description
This function is called by a physical device object to set the layer 2 header and
padding requirements for a packet. For example, with Ethernet the header is
normally 14. Plus, if the Ethernet checksum appears in the packet body, the
value of padding is 4.