/* Plants a NUL-terminated string in @buf and returns the length of the string, excluding the NUL. Otherwise zero is returned.  */
size_t rpc_ntop(const struct sockaddr *sap, char *buf, const size_t buflen)
/* Plants a NUL-terminated string in @buf and returns the length of the string, excluding the NUL. Otherwise zero is returned.  */
size_t rpc_ntop(const struct sockaddr *sap, char *buf, const size_t buflen)
{
	switch (sap->sa_family) {
	case AF_INET:
		return rpc_ntop4(sap, buf, buflen);
	case AF_INET6:
		return rpc_ntop6(sap, buf, buflen);
	}
	return 0;
}