diff --git a/pcap.h b/pcap.h index 2db5e38..27b01ee 100644 --- a/pcap.h +++ b/pcap.h @@ -8,7 +8,9 @@ #define MAGIC 0xa1b2c3d4 #define MAXFRAME 9000 -/* Described at http://www.tcpdump.org/linktypes.html */ +/* + * Described at http://www.tcpdump.org/linktypes.html + */ #define LINKTYPE_ETHERNET 1 #define LINKTYPE_RAW 101 diff --git a/pcat.c b/pcat.c index 28ea284..c0afc54 100644 --- a/pcat.c +++ b/pcat.c @@ -67,7 +67,7 @@ process_icmp(struct stream *s, char *saddr_s, char *daddr_s) uint8_t code = read_uint8(s); uint16_t checksum = read_uint16be(s); - printf("ICMP %s %s %d ", saddr_s, daddr_s, code); + printf("ICMP %d,%d %s %s ", type, code, saddr_s, daddr_s); } void @@ -147,7 +147,7 @@ print_frame(struct pcap_file *p, struct pcap_pkthdr *hdr, char const *frame) struct stream *s = &streambuf; sinit(s, frame, hdr->caplen); - printf("%u.%u ", hdr->ts.tv_sec, hdr->ts.tv_usec); + printf("%u.%06u ", hdr->ts.tv_sec, hdr->ts.tv_usec); switch (p->linktype) { case LINKTYPE_ETHERNET: print_ethernet(s);