<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Eric S. Raymond pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/a8ccf7fb00ed7aedf90fc152caf551d78b8fd63c">a8ccf7fb</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-10T12:04:22Z</i>
</div>
<pre class='commit-message'>In capture, dump time parts with unsigned seconds (since NTP epoch).</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
devel/tour.txt
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_intercept.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/a8ccf7fb00ed7aedf90fc152caf551d78b8fd63c#diff-0'>
<strong>
devel/tour.txt
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/devel/tour.txt
</span><span style="color: #000000;background-color: #ddffdd">+++ b/devel/tour.txt
</span><span style="color: #aaaaaa">@@ -10,7 +10,8 @@ to this document.  Having tricks and traps that impeded understanding
</span> explained here is especially valuable.
 
 However, try not to replicate comments here; it's better to point
<span style="color: #000000;background-color: #ffdddd">-at where they live in the code.  This document is 
</span><span style="color: #000000;background-color: #ddffdd">+at where they live in the code.  This document is intended to convey
+a higher-level view than individual comments.
</span> 
 == Key Types ==
 
<span style="color: #aaaaaa">@@ -22,6 +23,17 @@ home-brews three fixed-point types of its own.  Of these l_fp is the
</span> most common, with 32 bits of precision in both integer and fractional
 parts. Gory details are in include/ntp_fp.h.
 
<span style="color: #000000;background-color: #ddffdd">+One point not covered there is that when used to represent dates
+internally an l_fp is normally interpreted as a pair consisting of
+an *unsigned* number of seconds since 1900-01-01T00:00:00Z (the
+NTP epoch) and unsigned decimal fractional seconds.  Just to complicate
+matters, however, some uses of l_fp are time offsets with a signed
+seconds part - how it's interpreted depends on which member of a union
+is used.
+
+The comments in libntp/ntp_calendar.c are pretty illuminating about
+calendar representations.
+
</span> === vint64 ===
 
 The vint64 type is a historical relic.  NTP was written well before
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/a8ccf7fb00ed7aedf90fc152caf551d78b8fd63c#diff-1'>
<strong>
ntpd/ntp_intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_intercept.c
</span><span style="color: #aaaaaa">@@ -192,6 +192,12 @@ void intercept_log(const char *fmt, ...)
</span>     }
 }
 
<span style="color: #000000;background-color: #ddffdd">+/*
+ * An lfp used as a full date has an an unsigned seconds part.
+ * Invert this with atolfp().
+ */
+#define lfpdump(n)     ulfptoa(n, 10)
+
</span> void intercept_get_systime(const char *legend, l_fp *now)
 {
     struct timespec ts;        /* seconds and nanoseconds */
<span style="color: #aaaaaa">@@ -204,7 +210,7 @@ void intercept_get_systime(const char *legend, l_fp *now)
</span>     }
 
     if (mode != none)
<span style="color: #000000;background-color: #ffdddd">-        printf("event systime %s %s\n", legend, lfptoa(now, 10));
</span><span style="color: #000000;background-color: #ddffdd">+   printf("event systime %s %s\n", legend, lfpdump(now));
</span> 
 }
 
<span style="color: #aaaaaa">@@ -376,8 +382,8 @@ static void packet_dump(sockaddr_u *dest, struct pkt *pkt, int len)
</span>      /* FIXME: might be better to dump these in fixed-point */
           pkt->rootdelay, pkt->rootdisp,
           pkt->refid,
<span style="color: #000000;background-color: #ffdddd">-           lfptoa(&pkt->reftime, 10), lfptoa(&pkt->org, 10),
-          lfptoa(&pkt->rec, 10), lfptoa(&pkt->xmt, 10));
</span><span style="color: #000000;background-color: #ddffdd">+      lfpdump(&pkt->reftime), lfpdump(&pkt->org),
+          lfpdump(&pkt->rec), lfpdump(&pkt->xmt));
</span>     /* dump MAC as len - LEN_PKT_NOMAC chars in hex */
     for (i = 0; i < len - LEN_PKT_NOMAC; i++)
        printf("%02x", pkt->exten[i]);
<span style="color: #aaaaaa">@@ -411,7 +417,7 @@ void intercept_receive(struct recvbuf *rbufp)
</span>    */
        printf("event receive %0x %s %s ",
               rbufp->cast_flags,
<span style="color: #000000;background-color: #ffdddd">-               lfptoa(&rbufp->recv_time, 10),
</span><span style="color: #000000;background-color: #ddffdd">+          lfpdump(&rbufp->recv_time),
</span>          rbufp->dstadr->name);
        packet_dump(&rbufp->recv_srcadr, &rbufp->recv_pkt, rbufp->recv_length);
        fputs("\n", stdout);
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/a8ccf7fb00ed7aedf90fc152caf551d78b8fd63c">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/a8ccf7fb00ed7aedf90fc152caf551d78b8fd63c"}}</script>
</p>
</div>
</body>
</html>