FreeBSD/usr.sbin/timed/timed/readmsg.c
/*
 * `masterack' sends the necessary acknowledgments
 * to the messages received by a master
 */
`masterack' sends the necessary acknowledgments
to the messages received by a master
` masterack ' sends the necessary acknowledgments to the messages received by a master
void
masterack(void)
{
	struct tsp resp;
	resp = msgin;
	resp.tsp_vers = TSPVERSION;
	(void)strcpy(resp.tsp_name, hostname);
	switch(msgin.tsp_type) {
	case TSP_QUIT:
	case TSP_TRACEON:
	case TSP_TRACEOFF:
	case TSP_MSITEREQ:
		if (trace) {
			fprintf(fd, "Masterack: ");
			print(&msgin, &from);
		}
		xmit(TSP_ACK,msgin.tsp_seq, &from);
		break;
	case TSP_RESOLVE:
	case TSP_MASTERREQ:
		if (trace) {
			fprintf(fd, "Masterack: ");
			print(&msgin, &from);
		}
		xmit(TSP_MASTERACK,msgin.tsp_seq, &from);
		break;
	default:
		if (trace) {
			fprintf(fd,"Masterack: no ack: ");
			print(&msgin, &from);
		}
		break;
	}
}
void masterack ( void ) { struct tsp resp ; resp = msgin ; resp . tsp_vers = TSPVERSION ; ( void ) strcpy ( resp . tsp_name , hostname ) ; switch ( msgin . tsp_type ) { case TSP_QUIT : case TSP_TRACEON : case TSP_TRACEOFF : case TSP_MSITEREQ : if ( trace ) { fprintf ( fd , " " ) ; print ( & msgin , & from ) ; } xmit ( TSP_ACK , msgin . tsp_seq , & from ) ; break ; case TSP_RESOLVE : case TSP_MASTERREQ : if ( trace ) { fprintf ( fd , " " ) ; print ( & msgin , & from ) ; } xmit ( TSP_MASTERACK , msgin . tsp_seq , & from ) ; break ; default : if ( trace ) { fprintf ( fd , " " ) ; print ( & msgin , & from ) ; } break ; } }
`masterack' sends the necessary acknowledgments
 to the messages received by a master
` masterack ' sends the necessary acknowledgments to the messages received by a master