Lines Matching defs:ntp

123 	register struct netinfo *ntp;
272 ntp = NULL;
280 if (!ntp)
281 ntp = (struct netinfo*)malloc(sizeof(struct netinfo));
282 bzero(ntp,sizeof(*ntp));
283 ntp->my_addr=((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr;
284 ntp->status = NOMASTER;
304 ntp->mask = ((struct sockaddr_in *)
312 ntp->dest_addr = *(struct sockaddr_in *)&ifreq.ifr_broadaddr;
314 * So we cannot just mask ntp->dest_addr. */
315 ntp->net = ntp->my_addr;
316 ntp->net.s_addr &= ntp->mask;
323 ntp->dest_addr = *(struct sockaddr_in *)&ifreq.ifr_dstaddr;
324 ntp->net = ntp->dest_addr.sin_addr;
327 ntp->dest_addr.sin_port = port;
330 if (ntp->net.s_addr == htonl(nt->net))
336 ntp->next = NULL;
338 nettab = ntp;
340 ntip->next = ntp;
342 ntip = ntp;
343 ntp = NULL;
345 if (ntp)
346 (void) free((char *)ntp);
418 for (ntp = nettab; ntp != NULL; ntp = ntp->next) {
419 if (ntp->status == MASTER) {
420 rmnetmachs(ntp);
421 ntp->status = NOMASTER;
476 lookformaster(struct netinfo *ntp)
484 ntp->status = SLAVE;
489 answer = acksend(&resp, &ntp->dest_addr, ANYADDR,
490 TSP_MASTERACK, ntp, 0);
492 suppress(&from, answer->tsp_name, ntp);
493 ntp->status = NOMASTER;
506 answer = readmsg(TSP_MASTERREQ, ANYADDR, &ntime, ntp);
509 suppress(&from, answer->tsp_name, ntp);
510 ntp->status = NOMASTER;
516 answer = readmsg(TSP_MASTERUP, ANYADDR, &ntime, ntp);
519 suppress(&from, answer->tsp_name, ntp);
520 ntp->status = NOMASTER;
526 answer = readmsg(TSP_ELECTION, ANYADDR, &ntime, ntp);
529 suppress(&from, answer->tsp_name, ntp);
530 ntp->status = NOMASTER;
536 ntp->status = MASTER;
538 ntp->status = NOMASTER;
542 ntp->status = SLAVE;
553 answer = readmsg(TSP_MASTERACK, ANYADDR, &ntime, ntp);
577 struct netinfo *ntp;
583 for (ntp = nettab; ntp != NULL; ntp = ntp->next) {
584 switch ((int)ntp->status) {
597 fprintf(fd, "\t%-16s", inet_ntoa(ntp->net));
598 switch ((int)ntp->status) {
613 (int)ntp->status);
618 status |= ntp->status;
630 register struct netinfo *ntp;
632 for (ntp = nettab; ntp != NULL; ntp = ntp->next) {
633 if (ntp->status == SLAVE && ntp != net)
634 ntp->status = IGNORE;
645 register struct netinfo *ntp;
647 for (ntp = nettab; ntp != NULL; ntp = ntp->next) {
648 if (!Mflag && ntp->status == SLAVE)
651 if (ntp->status == IGNORE || ntp->status == NOMASTER) {
652 lookformaster(ntp);
653 if (!Mflag && ntp->status == SLAVE)
665 pickslavenet(struct netinfo *ntp)
672 if (ntp == 0 || ntp->status != SLAVE) {
673 for (ntp = nettab; ntp != 0; ntp = ntp->next) {
674 if (ntp->status == SLAVE)
678 makeslave(ntp);