Searches the network database that is referenced by the TCPIP$NETWORK logical name for a network record with the specified address. If the network record is not found, this function may invoke the BIND resolver to search TCPIP$SYSTEM:NETWORKS.DAT. The $QIO equivalent is the IO$_ACPCONTROL function with the INETACP_FUNC$C_GETNETBYADDR subfunction code. Format #include <netdb.h> struct netent *getnetbyaddr ( long net, int type) ;
1 – Arguments
net The network number, in host byte order, of the networks database entry required. type The type of network being sought (AF_INET or AF_INET6).
2 – Description
This function finds the first network record in the networks database with the given address. The getnetbyaddr() and getnetbyname() functions use a common static area for their return values. Subsequent calls to any of these functions overwrite any previously returned network entry. You must make a copy of the network entry if you want to save it.
3 – Return Values
x A pointer to an object having the netent structure. NULL Indicates end of file or an error.
4 – Errors
EINVAL The net argument is invalid. ESRCH The search failed.