From 2652683811a8dd4e057f92fe669a285c7e2e7c60 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 17 Jun 2013 23:12:18 +0200 Subject: [PATCH] dissector: explicitly init array Use explicit form to initialize array. Signed-off-by: Daniel Borkmann --- dissector.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/dissector.h b/dissector.h index 60bc4297..e26c235c 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", -- 2.11.4.GIT