Lines Matching defs:peer
241 typedef struct peer peerT;
266 static void enter_opmode(peerT *peer, int mode);
267 static void leave_opmode(peerT *peer, int mode);
366 static void gpsd_init_socket(peerT * const peer);
367 static void gpsd_test_socket(peerT * const peer);
368 static void gpsd_stop_socket(peerT * const peer);
370 static void gpsd_parse(peerT * const peer,
375 static void log_data(peerT *peer, int level, const char *what,
503 peerT * peer)
505 clockprocT * const pp = peer->procptr;
527 up->logname = estrdup(refnumtoa(&peer->srcadr));
539 tmpName = clockdev_lookup(&peer->srcadr, 0);
575 pp->io.srcclock = peer;
584 peer->precision = PPS_PRECISION;
586 peer->precision = PRECISION;
597 refnumtoa(&peer->srcadr), up->device));
598 up->mode = MODE_OP_MODE(peer->ttl);
602 up->pps_peer = peer;
604 enter_opmode(peer, up->mode);
626 peerT * peer)
628 clockprocT * const pp = peer->procptr;
639 if (peer != up->pps_peer) {
663 (LOG_NOTICE, "%s: shutdown", refnumtoa(&peer->srcadr)));
673 peerT * const peer = rbufp->recv_peer;
674 clockprocT * const pp = peer->procptr;
681 log_data(peer, 3, "recv", (const char*)rbufp->recv_buffer,
707 gpsd_parse(peer, &rbufp->recv_time);
723 peerT * const peer ,
730 refclock_report(peer, CEVNT_NOMINAL);
731 refclock_receive(peer);
738 peer->precision = PRECISION;
740 refclock_report(peer, CEVNT_FAULT);
742 refclock_report(peer, CEVNT_BADREPLY);
744 refclock_report(peer, CEVNT_TIMEOUT);
749 &peer->srcadr,"%u %u %u %u %u %u %u",
767 peerT * const peer ,
774 refclock_report(peer, CEVNT_NOMINAL);
775 refclock_receive(peer);
777 peer->precision = PPS_PRECISION;
778 peer->flags &= ~FLAG_PPS;
779 refclock_report(peer, CEVNT_TIMEOUT);
786 peerT * peer)
788 clockprocT * const pp = peer->procptr;
792 if (peer == up->pps_peer)
793 poll_secondary(peer, pp, up);
795 poll_primary(peer, pp, up);
805 peerT * peer )
807 clockprocT * const pp = peer->procptr;
810 if (peer == up->pps_peer) {
813 peer->flags &= ~FLAG_PPS;
819 if (MODE_OP_MODE(up->mode ^ peer->ttl)) {
820 leave_opmode(peer, up->mode);
821 up->mode = MODE_OP_MODE(peer->ttl);
822 enter_opmode(peer, up->mode);
831 peerT * const peer ,
859 log_data(peer, 2, "send", s_req_version, rlen);
863 gpsd_test_socket(peer);
869 gpsd_stop_socket(peer);
871 gpsd_test_socket(peer);
873 gpsd_init_socket(peer);
878 gpsd_test_socket(peer);
884 peerT * const peer ,
894 refclock_report(peer, CEVNT_TIMEOUT);
897 peer->flags &= ~FLAG_PPS;
904 peerT * peer)
906 clockprocT * const pp = peer->procptr;
909 if (peer == up->pps_peer)
910 timer_secondary(peer, pp, up);
912 timer_primary(peer, pp, up);
921 peerT *peer,
924 clockprocT * const pp = peer->procptr;
942 peerT *peer,
945 clockprocT * const pp = peer->procptr;
965 peerT * const peer ,
972 refclock_report(peer, CEVNT_NOMINAL);
980 peerT * const peer ,
986 add_clock_sample(peer, pp, up->sti_stamp, up->pps_recvt);
987 peer->precision = up->pps_prec;
1003 peerT * const peer ,
1009 add_clock_sample(peer, pp, up->pps_stamp2, up->pps_recvt2);
1010 peer->precision = up->pps_prec;
1011 /* PPS peer flag logic */
1015 peer->flags |= FLAG_PPS;
1026 peerT * const peer ,
1031 add_clock_sample(peer, pp, up->sti_stamp, up->sti_recvt);
1032 peer->precision = up->sti_prec;
1042 peerT * const peer ,
1078 eval_serial(peer, pp, up);
1080 eval_strict(peer, pp, up);
1440 peerT * const peer ,
1444 clockprocT * const pp = peer->procptr;
1466 peerT * const peer ,
1470 clockprocT * const pp = peer->procptr;
1539 log_data(peer, 2, "send", buf, len);
1554 peerT * const peer ,
1558 clockprocT * const pp = peer->procptr;
1635 peerT * const peer ,
1639 clockprocT * const pp = peer->procptr;
1716 peerT * const peer ,
1720 clockprocT * const pp = peer->procptr;
1760 peerT * const peer ,
1763 clockprocT * const pp = peer->procptr;
1788 process_tpv(peer, &up->json_parse, rtime);
1790 process_pps(peer, &up->json_parse, rtime);
1792 process_toff(peer, &up->json_parse, rtime);
1794 process_version(peer, &up->json_parse, rtime);
1796 process_watch(peer, &up->json_parse, rtime);
1825 eval_serial(peer, pp, up);
1829 eval_strict(peer, pp, up);
1833 eval_auto(peer, pp, up);
1842 peerT * const peer)
1844 clockprocT * const pp = peer->procptr;
1870 peerT * const peer)
1872 clockprocT * const pp = peer->procptr;
1976 peerT * const peer)
1978 clockprocT * const pp = peer->procptr;
2195 peerT *peer,
2204 clockprocT * const pp = peer->procptr;