summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--built_in.h12
-rw-r--r--dissector.h18
2 files changed, 28 insertions, 2 deletions
diff --git a/built_in.h b/built_in.h
index ee97c74..72618a0 100644
--- a/built_in.h
+++ b/built_in.h
@@ -341,4 +341,16 @@ static inline u64 cpu_to_le64(u64 val)
# define CO_IN_CACHE_SHIFT 5
#endif
+#ifndef TP_STATUS_TS_SOFTWARE
+# define TP_STATUS_TS_SOFTWARE (1 << 29)
+#endif
+
+#ifndef TP_STATUS_TS_SYS_HARDWARE
+# define TP_STATUS_TS_SYS_HARDWARE (1 << 30)
+#endif
+
+#ifndef TP_STATUS_TS_RAW_HARDWARE
+# define TP_STATUS_TS_RAW_HARDWARE (1 << 31)
+#endif
+
#endif /* BUILT_IN_H */
diff --git a/dissector.h b/dissector.h
index fc2cd5a..d211e06 100644
--- a/dissector.h
+++ b/dissector.h
@@ -13,6 +13,7 @@
#include "ring.h"
#include "tprintf.h"
#include "pcap_io.h"
+#include "built_in.h"
#define PRINT_NORM 0
#define PRINT_LESS 1
@@ -32,6 +33,18 @@ static const char * const packet_types[256]={
extern char *if_indextoname(unsigned ifindex, char *ifname);
+static inline const char *__show_ts_source(uint32_t status)
+{
+ if (status & TP_STATUS_TS_RAW_HARDWARE)
+ return "(raw hw ts)";
+ else if (status & TP_STATUS_TS_SYS_HARDWARE)
+ return "(sys hw ts)";
+ else if (status & TP_STATUS_TS_SOFTWARE)
+ return "(sw ts)";
+ else
+ return "";
+}
+
static inline void show_frame_hdr(struct frame_map *hdr, int mode)
{
char tmp[IFNAMSIZ];
@@ -47,11 +60,12 @@ static inline void show_frame_hdr(struct frame_map *hdr, int mode)
hdr->tp_h.tp_len);
break;
default:
- tprintf("%s %s %u %us.%uns\n",
+ tprintf("%s %s %u %us.%uns %s\n",
packet_types[hdr->s_ll.sll_pkttype] ? : "?",
if_indextoname(hdr->s_ll.sll_ifindex, tmp) ? : "?",
hdr->tp_h.tp_len, hdr->tp_h.tp_sec,
- hdr->tp_h.tp_nsec);
+ hdr->tp_h.tp_nsec,
+ __show_ts_source(hdr->tp_h.tp_status));
break;
}
}