Locates an interface based on a complete address.
#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;
addr | Specifies a complete address. |
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.
The ifa_ifwithaddr kernel service can be called from either the process or interrupt environment.
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.
To locate an interface based on a complete address, invoke the ifa_ifwithaddr kernel service as follows:
ifa_ifwithaddr((struct sockaddr *)&ipaddr);
The ifa_ifwithaddr kernel service is part of Base Operating System (BOS) Runtime.
The ifa_ifwithdstaddr kernel service, ifa_ifwithnet kernel service.
Network Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.