FreeBSD/contrib/ntp/ntpd/ntp_io.c
/*
 * sockaddr_dump - hex dump the start of a sockaddr_u
 */
hex dump the start of a sockaddr_u
hex dump the start of a sockaddr_u
static void
sockaddr_dump(const sockaddr_u *psau)
{
	const int maxsize = min(32, sizeof(psau->sa6));
	const u_char *	cp;
	int		i;
	cp = (const void *)&psau->sa6;
	for(i = 0; i < maxsize; i++) {
		printf("%02x", *cp++);
		if (!((i + 1) % 4))
			printf(" ");
	}
	printf("\n");
}
static void sockaddr_dump ( const sockaddr_u * psau ) { const int maxsize = min ( 32 , sizeof ( psau -> sa6 ) ) ; const u_char * cp ; int i ; cp = ( const void * ) & psau -> sa6 ; for ( i = 0 ; i < maxsize ; i ++ ) { printf ( " " , * cp ++ ) ; if ( ! ( ( i + 1 ) % 4 ) ) printf ( " " ) ; } printf ( " \n " ) ; }
sockaddr_dump - hex dump the start of a sockaddr_u
sockaddr_dump - hex dump the start of a sockaddr_u
/* Limit the size of the sockaddr_in6 hex dump */ /* XXX: Should we limit maxsize based on psau->saX.sin_family? */