mirror of https://github.com/dirtbags/fluffy.git
standardize ICMP output
This commit is contained in:
parent
306f0c6264
commit
7e6e7f5b40
4
pcap.h
4
pcap.h
|
@ -8,7 +8,9 @@
|
||||||
#define MAGIC 0xa1b2c3d4
|
#define MAGIC 0xa1b2c3d4
|
||||||
#define MAXFRAME 9000
|
#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_ETHERNET 1
|
||||||
#define LINKTYPE_RAW 101
|
#define LINKTYPE_RAW 101
|
||||||
|
|
||||||
|
|
4
pcat.c
4
pcat.c
|
@ -67,7 +67,7 @@ process_icmp(struct stream *s, char *saddr_s, char *daddr_s)
|
||||||
uint8_t code = read_uint8(s);
|
uint8_t code = read_uint8(s);
|
||||||
uint16_t checksum = read_uint16be(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
|
void
|
||||||
|
@ -147,7 +147,7 @@ print_frame(struct pcap_file *p, struct pcap_pkthdr *hdr, char const *frame)
|
||||||
struct stream *s = &streambuf;
|
struct stream *s = &streambuf;
|
||||||
|
|
||||||
sinit(s, frame, hdr->caplen);
|
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) {
|
switch (p->linktype) {
|
||||||
case LINKTYPE_ETHERNET:
|
case LINKTYPE_ETHERNET:
|
||||||
print_ethernet(s);
|
print_ethernet(s);
|
||||||
|
|
Loading…
Reference in New Issue