+static const char *
+print_time(unsigned long long timestamp)
+{
+ static char timebuf[128];
+ struct tm *tm;
+ time_t sec;
+ unsigned long nsec;
+
+ sec = abs_start_time.tv_sec + SECONDS(timestamp);
+ nsec = abs_start_time.tv_nsec + NANO_SECONDS(timestamp);
+ if (nsec >= 1000000000) {
+ nsec -= 1000000000;
+ sec += 1;
+ }
+
+ tm = localtime(&sec);
+ snprintf(timebuf, sizeof(timebuf),
+ "%02u:%02u:%02u.%06lu",
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec,
+ nsec / 1000);
+ return timebuf;
+}
+
+static inline int pdu_rest_is_zero(unsigned char *pdu, int len)
+{
+ static char zero[4096];
+
+ return !memcmp(pdu, zero, len);
+}
+