![Texas TMS320C6000 Programmer'S Reference Manual Download Page 159](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844159.webp)
Interface (IF) Object
A-25
Internal Stack Functions
A.7.4 API Function Description
Initialize Handle to Index Mapping Tables
IFInit
Syntax
void IFInit();
Return Value
nothing
Description
This function is called from ExecOpen(), before any physical devices are ini-
tialized. It will prepare the IF system to correctly process IFIndexNew() com-
mands which are called when Ether and PPP devices are created.
Allocate a New Physical Index for a Device Handle
IFIndexNew
Syntax
uint IFIndexNew( HANDLE hIF, uint Index );
Return Value
Allocated device index, or NULL on error.
Description
This function is called from PPP and Ether when new physical device handles
are created. IF allocates and returns a physical index for the supplied device
handle. If a specific index is required, it is passed in the Index parameter, else
Index is set to NULL.
Free a Previously Allocated Physical Index
IFIndexFree
Syntax
void IFIndexFree( uint Index );
Return Value
nothing
Description
This function is called from PPP and Ether when physical device handles are
destroyed. IF frees the supplied physical index, and can reallocate it in future
calls to IFIndexNew(). The index should not be used once freed.
Get the Highest Device Index Currently in Use
IFMaxIndex
Syntax
uint IFMaxIndex();
Return Value
Max logic device index currently in use.
Description
This function returns the highest device index that is currently in use in the sys-
tem. When there are no “holes” in the index map, this value is also the number
of devices currently active.