@@ -79,30 +79,31 @@ inline uint16_t parse_eth_hdr(const u_char* data_ptr, uint16_t data_len, Packet*
7979 DEBUG_MSG (" \t Dest mac:\t %s\n " , ether_ntoa ((struct ether_addr *) eth->h_dest ));
8080 DEBUG_MSG (" \t Src mac:\t %s\n " , ether_ntoa ((struct ether_addr *) eth->h_source ));
8181#else
82- DEBUG_CODE (char src_mac[18 ]; // ether_ntoa missing on some platforms
83- char dst_mac[18 ];
84- uint8_t * p = (uint8_t *) eth->h_source ;
85- snprintf (
86- src_mac,
87- sizeof (src_mac),
88- " %02x:%02x:%02x:%02x:%02x:%02x" ,
89- p[0 ],
90- p[1 ],
91- p[2 ],
92- p[3 ],
93- p[4 ],
94- p[5 ]);
95- p = (uint8_t *) eth->h_dest ;
96- snprintf (
97- dst_mac,
98- sizeof (dst_mac),
99- " %02x:%02x:%02x:%02x:%02x:%02x" ,
100- p[0 ],
101- p[1 ],
102- p[2 ],
103- p[3 ],
104- p[4 ],
105- p[5 ]););
82+ DEBUG_CODE (
83+ char src_mac[18 ]; // ether_ntoa missing on some platforms
84+ char dst_mac[18 ];
85+ uint8_t * p = (uint8_t *) eth->h_source ;
86+ snprintf (
87+ src_mac,
88+ sizeof (src_mac),
89+ " %02x:%02x:%02x:%02x:%02x:%02x" ,
90+ p[0 ],
91+ p[1 ],
92+ p[2 ],
93+ p[3 ],
94+ p[4 ],
95+ p[5 ]);
96+ p = (uint8_t *) eth->h_dest ;
97+ snprintf (
98+ dst_mac,
99+ sizeof (dst_mac),
100+ " %02x:%02x:%02x:%02x:%02x:%02x" ,
101+ p[0 ],
102+ p[1 ],
103+ p[2 ],
104+ p[3 ],
105+ p[4 ],
106+ p[5 ]););
106107 DEBUG_MSG (" \t Dest mac:\t %s\n " , dst_mac);
107108 DEBUG_MSG (" \t Src mac:\t %s\n " , src_mac);
108109#endif
@@ -684,8 +685,9 @@ void parse_packet(
684685 uint16_t data_offset = 0 ;
685686
686687 DEBUG_MSG (" ---------- packet parser #%u -------------\n " , ++s_total_pkts);
687- DEBUG_CODE (char timestamp[32 ]; time_t time = ts.tv_sec ;
688- strftime (timestamp, sizeof (timestamp), " %FT%T" , localtime (&time)););
688+ DEBUG_CODE (
689+ char timestamp[32 ]; time_t time = ts.tv_sec ;
690+ strftime (timestamp, sizeof (timestamp), " %FT%T" , localtime (&time)););
689691 DEBUG_MSG (" Time:\t\t\t %s.%06lu\n " , timestamp, ts.tv_usec );
690692 DEBUG_MSG (" Packet length:\t\t caplen=%uB len=%uB\n\n " , caplen, len);
691693
0 commit comments