Make pcat work again

This commit is contained in:
Neale Pickett 2017-06-16 11:48:05 -06:00
parent e98e734481
commit 57c1f02825
3 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ TARGETS += pyesc
TARGETS += printfesc TARGETS += printfesc
TARGETS += xor TARGETS += xor
TARGETS += unhex TARGETS += unhex
TARGETS += pcat
all: $(TARGETS) all: $(TARGETS)

2
pcat.c
View File

@ -178,7 +178,7 @@ print_frame(struct pcap_file *p, struct pcap_pkthdr *hdr, char const *frame)
struct stream streambuf; struct stream streambuf;
struct stream *s = &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); printf("%u.%u ", hdr->ts.tv_sec, hdr->ts.tv_usec);
switch (p->linktype) { switch (p->linktype) {
case LINKTYPE_ETHERNET: case LINKTYPE_ETHERNET:

View File

@ -9,6 +9,7 @@ enum endianness {
ENDIAN_BIG, ENDIAN_BIG,
ENDIAN_LITTLE ENDIAN_LITTLE
}; };
#define ENDIAN_NETWORK ENDIAN_BIG
struct stream { struct stream {
char const *buf; char const *buf;