Locates an interface on a specific network.
#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;
Item | Description |
---|---|
addr | Specifies the address. |
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.
The ifa_ifwithnet kernel service can be called from either the process or interrupt environment.
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.
To locate an interface on a specific network, invoke the ifa_ifwithnet kernel service as follows:
ifa_ifwithnet((struct sockaddr *)&ipaddr);