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

ifa_ifwithnet Kernel Service

Purpose

Locates an interface on a specific network.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/socket.h>
#include <net/if.h>
struct ifaddr * ifa_ifwithnet (addr)
register struct sockaddr *addr;

Parameter

addr Specifies the address.

Description

The ifa_ifwithnet kernel service locates an interface that matches the network specified by the address it is passed. If more than one interface matches, the ifa_ifwithnet service returns the first interface found.

Execution Environment

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

Return Values

If successful, the ifa_ifwithnet service returns the ifaddr structure of the correct interface. If no interface is found, the ifa_ifwithnet service returns a null pointer.

Example

To locate an interface on a specific network, invoke the ifa_ifwithnet kernel service as follows:

ifa_ifwithnet((struct sockaddr *)&ipaddr);

Implementation Specifics

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

Related Information

The ifa_ifwithaddr kernel service, ifa_ifwithdstaddr kernel service.

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


[ Previous | Next | Contents | Home | Search ]