FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 * dogetpeers - given an association ID, read and print the spreadsheet
 *		peer variables.
 */
given an association ID, read and print the spreadsheet
peer variables.
given an association ID read and print the spreadsheet peer variables .
static int
dogetpeers(
	struct varlist *pvl,
	associd_t associd,
	FILE *fp,
	int af
	)
{
	const char *datap;
	int res;
	size_t dsize;
	u_short rstatus;
#ifdef notdef
	res = doquerylist(pvl, CTL_OP_READVAR, associd, 0, &rstatus,
			  &dsize, &datap);
#else
	res = doquery(CTL_OP_READVAR, associd, 0, 0, NULL, &rstatus,
			  &dsize, &datap);
#endif
	if (res != 0)
		return 0;
	if (dsize == 0) {
		if (numhosts > 1)
			fprintf(stderr, "server=%s ", currenthost);
		fprintf(stderr,
			"***No information returned for association %u\n",
			associd);
		return 0;
	}
	return doprintpeers(pvl, associd, (int)rstatus, dsize, datap,
			    fp, af);
}
static int dogetpeers ( struct varlist * pvl , associd_t associd , FILE * fp , int af ) { const char * datap ; int res ; size_t dsize ; u_short rstatus ; #ifdef notdef res = doquerylist ( pvl , CTL_OP_READVAR , associd , 0 , & rstatus , & dsize , & datap ) ; #else res = doquery ( CTL_OP_READVAR , associd , 0 , 0 , NULL , & rstatus , & dsize , & datap ) ; #endif if ( res != 0 ) return 0 ; if ( dsize == 0 ) { if ( numhosts > 1 ) fprintf ( stderr , " " , currenthost ) ; fprintf ( stderr , " \n " , associd ) ; return 0 ; } return doprintpeers ( pvl , associd , ( int ) rstatus , dsize , datap , fp , af ) ; }
dogetpeers - given an association ID, read and print the spreadsheet
              peer variables.
dogetpeers - given an association ID read and print the spreadsheet peer variables .
/*
	 * Damn fuzzballs
	 */