summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dissector.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/dissector.h b/dissector.h
index 60bc429..e26c235 100644
--- a/dissector.h
+++ b/dissector.h
@@ -25,17 +25,17 @@
#define PRINT_HEX_ASCII 4
#define PRINT_NONE 5
-static const char * const packet_types[256]={
- "<", /* Incoming */
- "B", /* Broadcast */
- "M", /* Multicast */
- "P", /* Promisc */
- ">", /* Outgoing */
- "?", /* Unknown */
-};
-
extern char *if_indextoname(unsigned ifindex, char *ifname);
+static const char * const packet_types[256] = {
+ [PACKET_HOST] = "<", /* Incoming */
+ [PACKET_BROADCAST] = "B", /* Broadcast */
+ [PACKET_MULTICAST] = "M", /* Multicast */
+ [PACKET_OTHERHOST] = "P", /* Promisc */
+ [PACKET_OUTGOING] = ">", /* Outgoing */
+ "?", /* Unknown */
+};
+
static inline const char *__show_ts_source(uint32_t status)
{
if (status & TP_STATUS_TS_RAW_HARDWARE)
@@ -58,7 +58,6 @@ static inline void __show_frame_hdr(struct sockaddr_ll *s_ll,
return;
hdr.raw = raw;
-
switch (mode) {
case PRINT_LESS:
tprintf("%s %s %u",