summaryrefslogtreecommitdiffstats
path: root/app/ntp.c
blob: 44002ccfcb48638cec6ad1fdd81502000ccea8f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "project.h"


typedef struct {
  union {
    struct {
      uint32_t li: 2;
      uint32_t vn: 3;
      uint32_t mode: 3;
      uint32_t stratum: 8;
      uint32_t poll: 8;
      uint32_t precision: 8;
    };
    uint32_t word_0;
  };

  uint32_t root_delay;
  uint32_t root_dispersion;
  uint32_t reference_id;

  uint64_t reference_ts;
  uint64_t origin_ts;
  uint64_t receive_ts;
  uint64_t transmit_ts;
} ntp_packet_t;




#if 0
packet (uint8_t *_p)
{
  EPOCH reftime = pll_decompose (pll_last_update);

  ntp_packet_t rx = (uint8_t *)_p;
  ntp_packet_t tx;


  tx.li = NTP LEAP_MEH;
  tx.vn = NTP_VERSION;
  tx.mode = NTP_MODE_SERVER;
  tx.poll = ?
            tx.precision = ?
                           tx.rootdelay = ?
                                          tx.rootdisp = ?
                                              tx.refid = FCC ('M', 'S', 'F', 0);
  tx.reftime =;






























}
#endif


void ntp_init(void)
{
}