Lines Matching refs:ntpmsg

103         struct ntp_msg ntpmsg = {  in manager_send_request()  local
136 ntpmsg.trans_time.sec = htobe32(graceful_add_offset_1900_1970(m->trans_time.tv_sec)); in manager_send_request()
137 ntpmsg.trans_time.frac = htobe32(m->trans_time.tv_nsec); in manager_send_request()
141 …len = sendto(m->server_socket, &ntpmsg, sizeof(ntpmsg), MSG_DONTWAIT, &m->current_server_address->… in manager_send_request()
142 if (len == sizeof(ntpmsg)) { in manager_send_request()
399 struct ntp_msg ntpmsg; in manager_receive_response() local
402 .iov_base = &ntpmsg, in manager_receive_response()
403 .iov_len = sizeof(ntpmsg), in manager_receive_response()
464 … if (be32toh(ntpmsg.origin_time.sec) != graceful_add_offset_1900_1970(m->trans_time.tv_sec) || in manager_receive_response()
465 be32toh(ntpmsg.origin_time.frac) != (unsigned long) m->trans_time.tv_nsec) { in manager_receive_response()
472 if (be32toh(ntpmsg.recv_time.sec) < TIME_EPOCH + OFFSET_1900_1970 || in manager_receive_response()
473 be32toh(ntpmsg.trans_time.sec) < TIME_EPOCH + OFFSET_1900_1970) { in manager_receive_response()
478 if (NTP_FIELD_LEAP(ntpmsg.field) == NTP_LEAP_NOTINSYNC || in manager_receive_response()
479 ntpmsg.stratum == 0 || ntpmsg.stratum >= 16) { in manager_receive_response()
484 if (!IN_SET(NTP_FIELD_VERSION(ntpmsg.field), 3, 4)) { in manager_receive_response()
485 log_debug("Response NTPv%d. Disconnecting.", NTP_FIELD_VERSION(ntpmsg.field)); in manager_receive_response()
489 if (NTP_FIELD_MODE(ntpmsg.field) != NTP_MODE_SERVER) { in manager_receive_response()
490 log_debug("Unsupported mode %d. Disconnecting.", NTP_FIELD_MODE(ntpmsg.field)); in manager_receive_response()
494 …root_distance = ntp_ts_short_to_d(&ntpmsg.root_delay) / 2 + ntp_ts_short_to_d(&ntpmsg.root_dispers… in manager_receive_response()
508 if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_PLUSSEC) in manager_receive_response()
510 else if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_MINUSSEC) in manager_receive_response()
527 receive = ntp_ts_to_d(&ntpmsg.recv_time); in manager_receive_response()
528 trans = ntp_ts_to_d(&ntpmsg.trans_time); in manager_receive_response()
555 NTP_FIELD_LEAP(ntpmsg.field), in manager_receive_response()
556 NTP_FIELD_VERSION(ntpmsg.field), in manager_receive_response()
557 NTP_FIELD_MODE(ntpmsg.field), in manager_receive_response()
558 ntpmsg.stratum, in manager_receive_response()
559 exp2(ntpmsg.precision), ntpmsg.precision, in manager_receive_response()
561 ntpmsg.stratum == 1 ? ntpmsg.refid : "n/a", in manager_receive_response()
591 m->ntpmsg = ntpmsg; in manager_receive_response()