FreeBSD/contrib/ntp/ntpq/ntpq.c
/*
 * doqueryex - send a request and process the response, optionally
 *	       displaying error messages for any error responses.
 */
send a request and process the response, optionally
displaying error messages for any error responses.
send a request and process the response optionally displaying error messages for any error responses .
int
doqueryex(
	int opcode,
	associd_t associd,
	int auth,
	size_t qsize,
	const char *qdata,
	u_short *rstatus,
	size_t *rsize,
	const char **rdata,
	int quiet
	)
{
	int res;
	int done;
	if (!havehost) {
		fprintf(stderr, "***No host open, use `host' command\n");
		return -1;
	}
	done = 0;
	sequence++;
    again:
	res = sendrequest(opcode, associd, auth, qsize, qdata);
	if (res != 0)
		return res;
	res = getresponse(opcode, associd, rstatus, rsize, rdata, done);
	if (res > 0) {
		if (!done && (res == ERR_TIMEOUT || res == ERR_INCOMPLETE)) {
			if (res == ERR_INCOMPLETE) {
				sequence++;
			}
			done = 1;
			goto again;
		}
		if (!quiet)
			show_error_msg(res, associd);
	}
	return res;
}
int doqueryex ( int opcode , associd_t associd , int auth , size_t qsize , const char * qdata , u_short * rstatus , size_t * rsize , const char * * rdata , int quiet ) { int res ; int done ; if ( ! havehost ) { fprintf ( stderr , " \n " ) ; return -1 ; } done = 0 ; sequence ++ ; again : res = sendrequest ( opcode , associd , auth , qsize , qdata ) ; if ( res != 0 ) return res ; res = getresponse ( opcode , associd , rstatus , rsize , rdata , done ) ; if ( res > 0 ) { if ( ! done && ( res == ERR_TIMEOUT || res == ERR_INCOMPLETE ) ) { if ( res == ERR_INCOMPLETE ) { sequence ++ ; } done = 1 ; goto again ; } if ( ! quiet ) show_error_msg ( res , associd ) ; } return res ; }
doqueryex - send a request and process the response, optionally
             displaying error messages for any error responses.
doqueryex - send a request and process the response optionally displaying error messages for any error responses .
/*
	 * Check to make sure host is open
	 */ /*
	 * send a request
	 */ /*
	 * Get the response.  If we got a standard error, print a message
	 */ /*
				 * better bump the sequence so we don't
				 * get confused about differing fragments.
				 */