Returns a pointer to the ifnet structure of the requested interface.
#include <sys/types.h> #include <sys/errno.h> #include <net/if.h>
struct ifnet * ifunit (name) char *name;
|Specifies the name of an interface (for example, en0 ).
The ifunit kernel service searches the list of configured interfaces for an interface specified by the name parameter. If a match is found, the ifunit service returns the address of the ifnet structure for that interface.
The ifunit kernel service can be called from either the process or interrupt environment.
The ifunit kernel service returns the address of the ifnet structure associated with the named interface. If the interface is not found, the service returns a null value.
To return a pointer to the ifnet structure of the requested interface, invoke the ifunit kernel service as follows:
ifp = ifunit("en0");
The ifunit kernel service is part of Base Operating System (BOS) Runtime.
Network Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.