2017-09-05 18:40:39 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Linaro Limited
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SNTP_PKT_H
|
|
|
|
#define __SNTP_PKT_H
|
|
|
|
|
|
|
|
#include <zephyr/types.h>
|
|
|
|
|
|
|
|
struct sntp_pkt {
|
2023-12-06 21:03:12 +08:00
|
|
|
#if defined(CONFIG_LITTLE_ENDIAN)
|
|
|
|
uint8_t mode: 3;
|
|
|
|
uint8_t vn: 3;
|
|
|
|
uint8_t li: 2;
|
|
|
|
#else
|
|
|
|
uint8_t li: 2;
|
|
|
|
uint8_t vn: 3;
|
|
|
|
uint8_t mode: 3;
|
|
|
|
#endif /* CONFIG_LITTLE_ENDIAN */
|
2020-05-28 00:26:57 +08:00
|
|
|
uint8_t stratum;
|
|
|
|
uint8_t poll;
|
2023-12-06 21:03:12 +08:00
|
|
|
int8_t precision;
|
2020-05-28 00:26:57 +08:00
|
|
|
uint32_t root_delay;
|
|
|
|
uint32_t root_dispersion;
|
|
|
|
uint32_t ref_id;
|
|
|
|
uint32_t ref_tm_s;
|
|
|
|
uint32_t ref_tm_f;
|
|
|
|
uint32_t orig_tm_s; /* Originate timestamp seconds */
|
2022-03-17 05:07:43 +08:00
|
|
|
uint32_t orig_tm_f; /* Originate timestamp seconds fraction */
|
2020-05-28 00:26:57 +08:00
|
|
|
uint32_t rx_tm_s; /* Receive timestamp seconds */
|
|
|
|
uint32_t rx_tm_f; /* Receive timestamp seconds fraction */
|
2022-03-17 05:07:43 +08:00
|
|
|
uint32_t tx_tm_s; /* Transmit timestamp seconds */
|
|
|
|
uint32_t tx_tm_f; /* Transmit timestamp seconds fraction */
|
2017-09-05 18:40:39 +08:00
|
|
|
} __packed;
|
|
|
|
|
|
|
|
#endif
|