diff --git a/Makefile b/Makefile index 294db57..ad30d2c 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ TARGETS += pyesc TARGETS += printfesc TARGETS += xor TARGETS += unhex +TARGETS += pcat all: $(TARGETS) diff --git a/pcat.c b/pcat.c index a35a0be..050406e 100644 --- a/pcat.c +++ b/pcat.c @@ -178,7 +178,7 @@ print_frame(struct pcap_file *p, struct pcap_pkthdr *hdr, char const *frame) struct stream streambuf; struct stream *s = &streambuf; - sinit(s, frame, hdr->caplen); + sinit(s, frame, hdr->caplen, ENDIAN_NETWORK); printf("%u.%u ", hdr->ts.tv_sec, hdr->ts.tv_usec); switch (p->linktype) { case LINKTYPE_ETHERNET: diff --git a/stream.h b/stream.h index 03de2a5..3c870df 100644 --- a/stream.h +++ b/stream.h @@ -9,6 +9,7 @@ enum endianness { ENDIAN_BIG, ENDIAN_LITTLE }; +#define ENDIAN_NETWORK ENDIAN_BIG struct stream { char const *buf;