FreeBSD/contrib/ntp/ntpd/ntp_io.c
/*
 * sau_from_netaddr() - convert network address on-wire formats.
 * Convert from libisc's isc_netaddr_t to NTP's sockaddr_u
 */
convert network address on-wire formats.
Convert from libisc's isc_netaddr_t to NTP's sockaddr_u
convert network address on - wire formats . Convert from libisc ' s isc_netaddr_t to NTP ' s sockaddr_u
void
sau_from_netaddr(
	sockaddr_u *psau,
	const isc_netaddr_t *pna
	)
{
	ZERO_SOCK(psau);
	AF(psau) = (u_short)pna->family;
	switch (pna->family) {
	case AF_INET:
		memcpy(&psau->sa4.sin_addr, &pna->type.in,
		       sizeof(psau->sa4.sin_addr));
		break;
	case AF_INET6:
		memcpy(&psau->sa6.sin6_addr, &pna->type.in6,
		       sizeof(psau->sa6.sin6_addr));
		break;
	}
}
void sau_from_netaddr ( sockaddr_u * psau , const isc_netaddr_t * pna ) { ZERO_SOCK ( psau ) ; AF ( psau ) = ( u_short ) pna -> family ; switch ( pna -> family ) { case AF_INET : memcpy ( & psau -> sa4 . sin_addr , & pna -> type . in , sizeof ( psau -> sa4 . sin_addr ) ) ; break ; case AF_INET6 : memcpy ( & psau -> sa6 . sin6_addr , & pna -> type . in6 , sizeof ( psau -> sa6 . sin6_addr ) ) ; break ; } }
sau_from_netaddr() - convert network address on-wire formats.
sau_from_netaddr () - convert network address on - wire formats .