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

Technical Reference: Kernel and Subsystems, Volume 1

ifa_ifwithaddr Kernel Service

Purpose

Locates an interface based on a complete address.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/socket.h>
#include  <net/if.h>
#include  <net/af.h>


struct ifaddr * ifa_ifwithaddr ( addr)
struct sockaddr *addr;

Parameter

addr Specifies a complete address.

Description

The ifa_ifwithaddr kernel service is passed a complete address and locates the corresponding interface. If successful, the ifa_ifwithaddr service returns the ifaddr structure associated with that address.

Execution Environment

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

Return Values

If successful, the ifa_ifwithaddr service returns the corresponding ifaddr structure associated with the address it is passed. If no interface is found, the ifa_ifwithaddr service returns a null pointer.

Example

To locate an interface based on a complete address, invoke the ifa_ifwithaddr kernel service as follows:

ifa_ifwithaddr((struct sockaddr *)&ipaddr);

Related Information

The ifa_ifwithdstaddr kernel service, ifa_ifwithnet 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 ]