wm: dnsparser

Download patch

ref: 03a44eb1a1da64f1269f21217abe3253cdf47b5a
parent: eea3e7f97185f0c6ac097bad8009f23eee9b7b20
author: mkf <mkf@cloud9p.org>
date: Wed Jul 31 08:24:33 EDT 2024

Makefile: import

--- /dev/null
+++ b/Makefile
@@ -1,0 +1,36 @@
+CC=cc
+CFLAGS += -O0 -g -Wall -lpcap -Wno-pointer-sign
+NROFF=mandoc
+
+Lib=\
+	common.o\
+	ether.o\
+	pkt.o\
+	udp.o\
+	tcp.o\
+	dns.o\
+	tls.o\
+
+DnsParser=	dnsparser.o
+TlsParser=	tlsparser.o
+
+all:
+	@echo 'make dnsparser, tlsparser, tests or docs'
+
+%.o: %.c %.h
+	$(CC) $(CFLAGS) -c $< -o $@
+
+tests: ${Lib} dnsparser tlsparser
+	tests/tests.sh
+
+dnsparser: ${Lib} ${DnsParser}
+	$(CC) $(CFLAGS) -o $@ ${DnsParser} ${Lib}
+
+tlsparser: ${Lib} ${TlsParser}
+	$(CC) $(CFLAGS) -o $@ ${TlsParser} ${Lib}
+
+docs:
+	$(NROFF) doc/parser.man | col -b > docs/parser.txt
+	
+clean:
+	rm -f *.o dnsparser tlsparser docs/