1 /* 2 * Copyright (c) 2017 Linaro Limited 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __SNTP_PKT_H 8 #define __SNTP_PKT_H 9 10 #include <zephyr/types.h> 11 12 struct sntp_pkt { 13 #if defined(CONFIG_LITTLE_ENDIAN) 14 uint8_t mode: 3; 15 uint8_t vn: 3; 16 uint8_t li: 2; 17 #else 18 uint8_t li: 2; 19 uint8_t vn: 3; 20 uint8_t mode: 3; 21 #endif /* CONFIG_LITTLE_ENDIAN */ 22 uint8_t stratum; 23 uint8_t poll; 24 int8_t precision; 25 uint32_t root_delay; 26 uint32_t root_dispersion; 27 uint32_t ref_id; 28 uint32_t ref_tm_s; 29 uint32_t ref_tm_f; 30 uint32_t orig_tm_s; /* Originate timestamp seconds */ 31 uint32_t orig_tm_f; /* Originate timestamp seconds fraction */ 32 uint32_t rx_tm_s; /* Receive timestamp seconds */ 33 uint32_t rx_tm_f; /* Receive timestamp seconds fraction */ 34 uint32_t tx_tm_s; /* Transmit timestamp seconds */ 35 uint32_t tx_tm_f; /* Transmit timestamp seconds fraction */ 36 } __packed; 37 38 #endif 39