]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
quieten a few debug messages
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 20 Mar 2021 09:12:00 +0000 (09:12 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 20 Mar 2021 09:12:00 +0000 (09:12 +0000)
nqptp.c

diff --git a/nqptp.c b/nqptp.c
index 982860ee2440fee1f29abc3f4236521e396d47c0..df3b17902dcdd512fcd58801514678f6896efc6a 100644 (file)
--- a/nqptp.c
+++ b/nqptp.c
 
 #include <grp.h>
 
+#ifndef SO_TIMESTAMPING
+# define SO_TIMESTAMPING         37
+# define SCM_TIMESTAMPING        SO_TIMESTAMPING
+#endif
+#ifndef SO_TIMESTAMPNS
+# define SO_TIMESTAMPNS 35
+#endif
+#ifndef SIOCGSTAMPNS
+# define SIOCGSTAMPNS 0x8907
+#endif
+#ifndef SIOCSHWTSTAMP
+# define SIOCSHWTSTAMP 0x89b0
+#endif
+
+
 // References from the IEEE Document ISBN 978-0-7381-5400-8 STD95773.
 // "IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and
 // Control Systems" The IEEE Std 1588-2008 (Revision of IEEE Std 1588-2002)
@@ -830,7 +845,7 @@ int main(void) {
                               transmission_time = transmission_time * 1000000000;
                               transmission_time = transmission_time + ts->tv_nsec;
                             } else {
-                               fprintf(stderr, "Can't establish a transmission time! Falling back on get_time_now().\n");
+                               // fprintf(stderr, "Can't establish a transmission time! Falling back on get_time_now().\n");
                             }
                           }
                         }
@@ -872,14 +887,14 @@ int main(void) {
                       the_clock->current_stage = follow_up_seen;
                     } else {
                       if (the_clock->current_stage != waiting_for_sync) {
-
+/*
                         fprintf(
                             stderr,
                             "Follow_Up %u expecting to be in state sync_seen (%u). Stage error -- "
                             "current state is %u, sequence %u. Ignoring it. %s\n",
                             ntohs(msg->header.sequenceId), sync_seen, the_clock->current_stage,
                             the_clock->sequence_number, the_clock->ip);
-
+*/
                       }
                     }
                   } break;
@@ -905,9 +920,9 @@ int main(void) {
                       assuming symmetrical delays
                       */
 
-                      int64_t distant_time_difference = the_clock->t4 - the_clock->t1;
-                      int64_t local_time_difference = the_clock->t3 - the_clock->t2;
-                      int64_t double_propagation_time = distant_time_difference - distant_time_difference; // better be positive
+                      // int64_t distant_time_difference = the_clock->t4 - the_clock->t1;
+                      // int64_t local_time_difference = the_clock->t3 - the_clock->t2;
+                      // int64_t double_propagation_time = distant_time_difference - distant_time_difference; // better be positive
                       // fprintf(stderr, "distant_time_difference: %" PRId64 ", local_time_difference: %" PRId64 " , double_propagation_time %" PRId64 ".\n", distant_time_difference, local_time_difference, double_propagation_time);
 
                       the_clock->t5 =
@@ -1120,4 +1135,4 @@ int main(void) {
   // here, close all the sockets...
 
   return 0;
-}
\ No newline at end of file
+}