From 57c1f02825611f3ebd6913860dcb2cc0c3145e90 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 16 Jun 2017 11:48:05 -0600 Subject: [PATCH] Make pcat work again --- Makefile | 1 + pcat.c | 2 +- stream.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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;