FreeBSD/contrib/ntp/ntpdc/ntpdc_ops.c
/*
 * do_trustkey - do grunge work of adding/deleting keys
 */
do grunge work of adding/deleting keys
do grunge work of adding / deleting keys
static void
do_trustkey(
	struct parse *pcmd,
	FILE *fp,
	int req
	)
{
	u_long keyids[MAXARGS];
	size_t i;
	size_t items;
	size_t itemsize;
	const char *dummy;
	int ritems;
	int res;
	ritems = 0;
	for (i = 0; i < pcmd->nargs; i++) {
		keyids[ritems++] = pcmd->argval[i].uval;
	}
again:
	res = doquery(impl_ver, req, 1, ritems, sizeof(u_long),
		      (char *)keyids, &items, &itemsize, &dummy, 0, 
		      sizeof(dummy));
	if (res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD) {
		impl_ver = IMPL_XNTPD_OLD;
		goto again;
	}
	if (res == 0)
	    (void) fprintf(fp, "done!\n");
	return;
}
static void do_trustkey ( struct parse * pcmd , FILE * fp , int req ) { u_long keyids [ MAXARGS ] ; size_t i ; size_t items ; size_t itemsize ; const char * dummy ; int ritems ; int res ; ritems = 0 ; for ( i = 0 ; i < pcmd -> nargs ; i ++ ) { keyids [ ritems ++ ] = pcmd -> argval [ i ] . uval ; } again : res = doquery ( impl_ver , req , 1 , ritems , sizeof ( u_long ) , ( char * ) keyids , & items , & itemsize , & dummy , 0 , sizeof ( dummy ) ) ; if ( res == INFO_ERR_IMPL && impl_ver == IMPL_XNTPD ) { impl_ver = IMPL_XNTPD_OLD ; goto again ; } if ( res == 0 ) ( void ) fprintf ( fp , " \n " ) ; return ; }
do_trustkey - do grunge work of adding/deleting keys
do_trustkey - do grunge work of adding / deleting keys