[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

ifunit Kernel Service

Purpose

Returns a pointer to the ifnet structure of the requested interface.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <net/if.h>
struct ifnet *
ifunit (name)
char *name;

Parameter

name Specifies the name of an interface (for example, en0 ).

Description

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.

Execution Environment

The ifunit kernel service can be called from either the process or interrupt environment.

Return Values

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.

Example

To return a pointer to the ifnet structure of the requested interface, invoke the ifunit kernel service as follows:

ifp = ifunit("en0");

Implementation Specifics

The ifunit kernel service is part of Base Operating System (BOS) Runtime.

Related Information

Network Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]