Returns the local host's Internet address according to a destination address. Format #include <rpc/rpc.h> void get_myaddr_dest(struct sockaddr_in *addr, struct sockaddr_in *dest);
1 – Arguments
addr A pointer to a sockaddr_in structure that the routine will load with the local Internet address that would provide a connection to the remote address specified in dest. dest A pointer to a sockaddr_in structure containing an Internet address of a remote host.
2 – Description
Since the local host may have multiple network addresses (each on its own interface), this routine is used to select the local address that would provide a connection to the remote address specified in dest. This is an alternative to gethostbyname, which invokes yellow pages. It takes a destination (where we are trying to get to) and finds an exact network match to go to.
3 – Return Values
None