[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, 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);

Related Information

The ifa_ifwithaddr kernel service, ifa_ifwithdstaddr kernel service.

Network Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]