FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 * another_reslist_field - helper for reslist()
 *
 * If all fields for the row have been received, print it.
 */
helper for reslist()
If all fields for the row have been received, print it.
helper for reslist () If all fields for the row have been received print it .
static void
another_reslist_field(
	int *		pfields,
	reslist_row *	prow,
	FILE *		fp
	)
{
	char	addrmaskstr[128];
	int	prefix;	
	u_int	idx;
	(*pfields)++;
	if (RESLIST_FIELDS > *pfields)
		return;
	prefix = sockaddr_masktoprefixlen(&prow->mask);
	if (prefix >= 0)
		snprintf(addrmaskstr, sizeof(addrmaskstr), "%s/%d",
			 stoa(&prow->addr), prefix);
	else
		snprintf(addrmaskstr, sizeof(addrmaskstr), "%s %s",
			 stoa(&prow->addr), stoa(&prow->mask));
	fprintf(fp,
		"%10lu %s\n"
		"           %s\n",
		prow->hits, addrmaskstr, prow->flagstr);
	idx = prow->idx;
	ZERO(*prow);
	prow->idx = idx;
}
static void another_reslist_field ( int * pfields , reslist_row * prow , FILE * fp ) { char addrmaskstr [ 128 ] ; int prefix ; u_int idx ; ( * pfields ) ++ ; if ( RESLIST_FIELDS > * pfields ) return ; prefix = sockaddr_masktoprefixlen ( & prow -> mask ) ; if ( prefix >= 0 ) snprintf ( addrmaskstr , sizeof ( addrmaskstr ) , " " , stoa ( & prow -> addr ) , prefix ) ; else snprintf ( addrmaskstr , sizeof ( addrmaskstr ) , " " , stoa ( & prow -> addr ) , stoa ( & prow -> mask ) ) ; fprintf ( fp , " \n " " \n " , prow -> hits , addrmaskstr , prow -> flagstr ) ; idx = prow -> idx ; ZERO ( * prow ) ; prow -> idx = idx ; }
another_reslist_field - helper for reslist()
 If all fields for the row have been received, print it.
another_reslist_field - helper for reslist () If all fields for the row have been received print it .
/* subnet mask as prefix bits count */ /* we understand 4 tags */ /*
	"   hits    addr/prefix or addr mask\n"
	"           restrictions\n"
	"==============================================================================\n");
	 */