summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-17 23:12:18 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-17 23:12:18 +0200
commit2652683811a8dd4e057f92fe669a285c7e2e7c60 (patch)
tree0cc3fabf1b124d79d6871631b379a9a13809f39a
parentc3c2cb8d011f1c3e28b22584ea11fa544402c89b (diff)
dissector: explicitly init array
Use explicit form to initialize array. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-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",