Lines Matching refs:msg

816 		msg_t *msg, ssize_t len)  in do_sendto()  argument
822 ret = sendto(fd, msg, len, MSG_DONTWAIT, to, addrlen); in do_sendto()
824 ret = send_to_from(fd, msg, len, MSG_DONTWAIT, to, from, addrlen); in do_sendto()
835 hash(key_entry_t *key_entry, const msg_t *msg, uint8_t *output) in hash() argument
841 unsigned hash_size = sizeof(*msg) - sizeof(msg->m_keyid) - sizeof(msg->m_digest); in hash()
847 md5_hash(&ctx.m, msg, hash_size); in hash()
853 sha1_hash(&ctx.s, msg, hash_size); in hash()
867 hashes_differ(peer_t *p, const msg_t *msg) in hashes_differ() argument
870 hash(p->key_entry, msg, digest); in hashes_differ()
871 return memcmp(digest, msg->m_digest, p->key_entry->msg_size - NTP_MSGSIZE_NOAUTH - KEYID_SIZE); in hashes_differ()
1811 msg_t msg; in recv_and_process_peer_pkt() local
1835 size = recv(p->p_fd, &msg, sizeof(msg), MSG_DONTWAIT); in recv_and_process_peer_pkt()
1858 if (p->key_entry && hashes_differ(p, &msg)) { in recv_and_process_peer_pkt()
1869 if (msg.m_orgtime.int_partl != p->p_xmt_msg.m_xmttime.int_partl in recv_and_process_peer_pkt()
1870 || msg.m_orgtime.fractionl != p->p_xmt_msg.m_xmttime.fractionl in recv_and_process_peer_pkt()
1883 if ((msg.m_status & LI_ALARM) == LI_ALARM in recv_and_process_peer_pkt()
1884 || msg.m_stratum == 0 in recv_and_process_peer_pkt()
1885 || msg.m_stratum > NTP_MAXSTRATUM in recv_and_process_peer_pkt()
1918 T2 = lfp_to_d(msg.m_rectime); in recv_and_process_peer_pkt()
1919 T3 = lfp_to_d(msg.m_xmttime); in recv_and_process_peer_pkt()
1948 p->lastpkt_status = msg.m_status; in recv_and_process_peer_pkt()
1949 p->lastpkt_stratum = msg.m_stratum; in recv_and_process_peer_pkt()
1950 p->lastpkt_rootdelay = sfp_to_d(msg.m_rootdelay); in recv_and_process_peer_pkt()
1951 p->lastpkt_rootdisp = sfp_to_d(msg.m_rootdisp); in recv_and_process_peer_pkt()
1952 p->lastpkt_refid = msg.m_refid; in recv_and_process_peer_pkt()
1958 datapoint->d_dispersion = LOG2D(msg.m_precision_exp) + G_precision_sec; in recv_and_process_peer_pkt()
2067 msg_t msg; in recv_and_process_client_pkt() local
2074 size = recv_from_to(G_listen_fd, &msg, sizeof(msg), MSG_DONTWAIT, from, &to->u.sa, to->len); in recv_and_process_client_pkt()
2101 if ((msg.m_status & MODE_MASK) != MODE_CLIENT in recv_and_process_client_pkt()
2102 && (msg.m_status & MODE_MASK) != MODE_SYM_ACT in recv_and_process_client_pkt()
2107 query_status = msg.m_status; in recv_and_process_client_pkt()
2108 query_xmttime = msg.m_xmttime; in recv_and_process_client_pkt()
2111 memset(&msg, 0, sizeof(msg)); in recv_and_process_client_pkt()
2112 msg.m_status = G.stratum < MAXSTRAT ? (G.ntp_status & LI_MASK) : LI_ALARM; in recv_and_process_client_pkt()
2113 msg.m_status |= (query_status & VERSION_MASK); in recv_and_process_client_pkt()
2114 msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ? in recv_and_process_client_pkt()
2116 msg.m_stratum = G.stratum; in recv_and_process_client_pkt()
2117 msg.m_ppoll = G.poll_exp; in recv_and_process_client_pkt()
2118 msg.m_precision_exp = G_precision_exp; in recv_and_process_client_pkt()
2120 d_to_lfp(&msg.m_rectime, G.cur_time); in recv_and_process_client_pkt()
2121 d_to_lfp(&msg.m_xmttime, gettime1900d()); /* this instant */ in recv_and_process_client_pkt()
2126 d_to_lfp(&msg.m_reftime, G.reftime); in recv_and_process_client_pkt()
2127 msg.m_orgtime = query_xmttime; in recv_and_process_client_pkt()
2128 d_to_sfp(&msg.m_rootdelay, G.rootdelay); in recv_and_process_client_pkt()
2130 d_to_sfp(&msg.m_rootdisp, G.rootdisp); in recv_and_process_client_pkt()
2132 msg.m_refid = G.refid; // (version > (3 << VERSION_SHIFT)) ? G.refid : G.refid3; in recv_and_process_client_pkt()
2138 &msg, size); in recv_and_process_client_pkt()