Skip to content

Commit

Permalink
dissector: explicitly init array
Browse files Browse the repository at this point in the history
Use explicit form to initialize array.

Signed-off-by: Daniel Borkmann <[email protected]>
  • Loading branch information
borkmann committed Jun 17, 2013
1 parent c3c2cb8 commit 2652683
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions dissector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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",
Expand Down

0 comments on commit 2652683

Please sign in to comment.