summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-03 07:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-03 07:49:50 +0000
commit216afbe7cc62a59d1866a6524a214646361d3dc7 (patch)
tree1f334ba713f90066fa6f790ca757b0046cd9a181
parentAdding upstream version 1.3.0. (diff)
downloaddnsjit-216afbe7cc62a59d1866a6524a214646361d3dc7.tar.xz
dnsjit-216afbe7cc62a59d1866a6524a214646361d3dc7.zip
Adding upstream version 1.4.0.upstream/1.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r--CHANGES32
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in4
-rw-r--r--README.md4
-rwxr-xr-xconfigure150
-rw-r--r--configure.ac8
-rw-r--r--examples/Makefile.am2
-rw-r--r--examples/Makefile.in4
-rwxr-xr-xexamples/dumpdns.lua41
-rw-r--r--include/dnsjit/Makefile.am26
-rw-r--r--include/dnsjit/Makefile.in119
-rw-r--r--include/dnsjit/config.h.in6
-rw-r--r--include/dnsjit/core.lua2
-rw-r--r--include/dnsjit/core/assert.h2
-rw-r--r--include/dnsjit/core/channel.c2
-rw-r--r--include/dnsjit/core/channel.h2
-rw-r--r--include/dnsjit/core/channel.hh8
-rw-r--r--include/dnsjit/core/channel.lua2
-rw-r--r--include/dnsjit/core/compat.c2
-rw-r--r--include/dnsjit/core/compat.h2
-rw-r--r--include/dnsjit/core/compat.lua2
-rw-r--r--include/dnsjit/core/file.c2
-rw-r--r--include/dnsjit/core/file.h2
-rw-r--r--include/dnsjit/core/file.hh2
-rw-r--r--include/dnsjit/core/file.lua2
-rw-r--r--include/dnsjit/core/loader.lua2
-rw-r--r--include/dnsjit/core/log.c2
-rw-r--r--include/dnsjit/core/log.h2
-rw-r--r--include/dnsjit/core/log.hh2
-rw-r--r--include/dnsjit/core/log.lua2
-rw-r--r--include/dnsjit/core/object.c2
-rw-r--r--include/dnsjit/core/object.h2
-rw-r--r--include/dnsjit/core/object.hh2
-rw-r--r--include/dnsjit/core/object.lua2
-rw-r--r--include/dnsjit/core/object/dns.c2
-rw-r--r--include/dnsjit/core/object/dns.h2
-rw-r--r--include/dnsjit/core/object/dns.hh6
-rw-r--r--include/dnsjit/core/object/dns.lua2
-rw-r--r--include/dnsjit/core/object/dns/label.lua2
-rw-r--r--include/dnsjit/core/object/dns/q.lua2
-rw-r--r--include/dnsjit/core/object/dns/rr.lua2
-rw-r--r--include/dnsjit/core/object/ether.c2
-rw-r--r--include/dnsjit/core/object/ether.h2
-rw-r--r--include/dnsjit/core/object/ether.hh4
-rw-r--r--include/dnsjit/core/object/ether.lua2
-rw-r--r--include/dnsjit/core/object/gre.c2
-rw-r--r--include/dnsjit/core/object/gre.h2
-rw-r--r--include/dnsjit/core/object/gre.hh4
-rw-r--r--include/dnsjit/core/object/gre.lua2
-rw-r--r--include/dnsjit/core/object/icmp.c2
-rw-r--r--include/dnsjit/core/object/icmp.h2
-rw-r--r--include/dnsjit/core/object/icmp.hh4
-rw-r--r--include/dnsjit/core/object/icmp.lua2
-rw-r--r--include/dnsjit/core/object/icmp6.c2
-rw-r--r--include/dnsjit/core/object/icmp6.h2
-rw-r--r--include/dnsjit/core/object/icmp6.hh4
-rw-r--r--include/dnsjit/core/object/icmp6.lua2
-rw-r--r--include/dnsjit/core/object/ieee802.c2
-rw-r--r--include/dnsjit/core/object/ieee802.h2
-rw-r--r--include/dnsjit/core/object/ieee802.hh4
-rw-r--r--include/dnsjit/core/object/ieee802.lua2
-rw-r--r--include/dnsjit/core/object/ip.c2
-rw-r--r--include/dnsjit/core/object/ip.h2
-rw-r--r--include/dnsjit/core/object/ip.hh4
-rw-r--r--include/dnsjit/core/object/ip.lua2
-rw-r--r--include/dnsjit/core/object/ip6.c2
-rw-r--r--include/dnsjit/core/object/ip6.h2
-rw-r--r--include/dnsjit/core/object/ip6.hh4
-rw-r--r--include/dnsjit/core/object/ip6.lua2
-rw-r--r--include/dnsjit/core/object/linuxsll.c2
-rw-r--r--include/dnsjit/core/object/linuxsll.h2
-rw-r--r--include/dnsjit/core/object/linuxsll.hh4
-rw-r--r--include/dnsjit/core/object/linuxsll.lua2
-rw-r--r--include/dnsjit/core/object/loop.c2
-rw-r--r--include/dnsjit/core/object/loop.h2
-rw-r--r--include/dnsjit/core/object/loop.hh4
-rw-r--r--include/dnsjit/core/object/loop.lua2
-rw-r--r--include/dnsjit/core/object/null.c2
-rw-r--r--include/dnsjit/core/object/null.h2
-rw-r--r--include/dnsjit/core/object/null.hh4
-rw-r--r--include/dnsjit/core/object/null.lua2
-rw-r--r--include/dnsjit/core/object/payload.c2
-rw-r--r--include/dnsjit/core/object/payload.h2
-rw-r--r--include/dnsjit/core/object/payload.hh4
-rw-r--r--include/dnsjit/core/object/payload.lua2
-rw-r--r--include/dnsjit/core/object/pcap.c2
-rw-r--r--include/dnsjit/core/object/pcap.h2
-rw-r--r--include/dnsjit/core/object/pcap.hh6
-rw-r--r--include/dnsjit/core/object/pcap.lua2
-rw-r--r--include/dnsjit/core/object/tcp.c2
-rw-r--r--include/dnsjit/core/object/tcp.h2
-rw-r--r--include/dnsjit/core/object/tcp.hh4
-rw-r--r--include/dnsjit/core/object/tcp.lua2
-rw-r--r--include/dnsjit/core/object/udp.c2
-rw-r--r--include/dnsjit/core/object/udp.h2
-rw-r--r--include/dnsjit/core/object/udp.hh4
-rw-r--r--include/dnsjit/core/object/udp.lua2
-rw-r--r--include/dnsjit/core/objects.lua2
-rw-r--r--include/dnsjit/core/producer.c2
-rw-r--r--include/dnsjit/core/producer.h2
-rw-r--r--include/dnsjit/core/producer.hh4
-rw-r--r--include/dnsjit/core/producer.lua2
-rw-r--r--include/dnsjit/core/receiver.c2
-rw-r--r--include/dnsjit/core/receiver.h2
-rw-r--r--include/dnsjit/core/receiver.hh4
-rw-r--r--include/dnsjit/core/receiver.lua2
-rw-r--r--include/dnsjit/core/thread.c6
-rw-r--r--include/dnsjit/core/thread.h2
-rw-r--r--include/dnsjit/core/thread.hh12
-rw-r--r--include/dnsjit/core/thread.lua8
-rw-r--r--include/dnsjit/core/timespec.h2
-rw-r--r--include/dnsjit/core/timespec.hh2
-rw-r--r--include/dnsjit/core/timespec.lua2
-rw-r--r--include/dnsjit/dnsjit.1in2
-rw-r--r--include/dnsjit/dnsjit.c36
-rw-r--r--include/dnsjit/filter.lua2
-rw-r--r--include/dnsjit/filter/copy.hh4
-rw-r--r--include/dnsjit/filter/ipsplit.hh4
-rw-r--r--include/dnsjit/filter/layer.c4
-rw-r--r--include/dnsjit/filter/layer.h2
-rw-r--r--include/dnsjit/filter/layer.hh36
-rw-r--r--include/dnsjit/filter/layer.lua2
-rw-r--r--include/dnsjit/filter/split.c2
-rw-r--r--include/dnsjit/filter/split.h2
-rw-r--r--include/dnsjit/filter/split.hh6
-rw-r--r--include/dnsjit/filter/split.lua2
-rw-r--r--include/dnsjit/filter/timing.c2
-rw-r--r--include/dnsjit/filter/timing.h2
-rw-r--r--include/dnsjit/filter/timing.hh10
-rw-r--r--include/dnsjit/filter/timing.lua2
-rw-r--r--include/dnsjit/gen-manpage.lua2
-rw-r--r--include/dnsjit/globals.c2
-rw-r--r--include/dnsjit/globals.h2
-rw-r--r--include/dnsjit/input.lua2
-rw-r--r--include/dnsjit/input/fpcap.c2
-rw-r--r--include/dnsjit/input/fpcap.h2
-rw-r--r--include/dnsjit/input/fpcap.hh10
-rw-r--r--include/dnsjit/input/fpcap.lua2
-rw-r--r--include/dnsjit/input/mmpcap.c2
-rw-r--r--include/dnsjit/input/mmpcap.h2
-rw-r--r--include/dnsjit/input/mmpcap.hh10
-rw-r--r--include/dnsjit/input/mmpcap.lua2
-rw-r--r--include/dnsjit/input/pcap.c2
-rw-r--r--include/dnsjit/input/pcap.h2
-rw-r--r--include/dnsjit/input/pcap.hh10
-rw-r--r--include/dnsjit/input/pcap.lua2
-rw-r--r--include/dnsjit/input/zero.lua2
-rw-r--r--include/dnsjit/input/zmmpcap.c677
-rw-r--r--include/dnsjit/input/zmmpcap.h31
-rw-r--r--include/dnsjit/input/zmmpcap.hh77
-rw-r--r--include/dnsjit/input/zmmpcap.lua149
-rw-r--r--include/dnsjit/input/zpcap.c159
-rw-r--r--include/dnsjit/input/zpcap.h2
-rw-r--r--include/dnsjit/input/zpcap.hh14
-rw-r--r--include/dnsjit/input/zpcap.lua12
-rw-r--r--include/dnsjit/lib.lua2
-rw-r--r--include/dnsjit/lib/clock.c2
-rw-r--r--include/dnsjit/lib/clock.h2
-rw-r--r--include/dnsjit/lib/clock.hh4
-rw-r--r--include/dnsjit/lib/clock.lua2
-rw-r--r--include/dnsjit/lib/getopt.lua2
-rw-r--r--include/dnsjit/lib/ip.lua2
-rw-r--r--include/dnsjit/lib/parseconf.lua2
-rw-r--r--include/dnsjit/lib/trie.c30
-rw-r--r--include/dnsjit/output.lua2
-rw-r--r--include/dnsjit/output/dnscli.c4
-rw-r--r--include/dnsjit/output/dnscli.h2
-rw-r--r--include/dnsjit/output/dnscli.hh14
-rw-r--r--include/dnsjit/output/dnscli.lua2
-rw-r--r--include/dnsjit/output/null.lua2
-rw-r--r--include/dnsjit/output/pcap.c2
-rw-r--r--include/dnsjit/output/pcap.h2
-rw-r--r--include/dnsjit/output/pcap.hh8
-rw-r--r--include/dnsjit/output/pcap.lua2
-rw-r--r--include/dnsjit/output/respdiff.c2
-rw-r--r--include/dnsjit/output/respdiff.h2
-rw-r--r--include/dnsjit/output/respdiff.hh6
-rw-r--r--include/dnsjit/output/respdiff.lua2
-rw-r--r--include/dnsjit/output/tcpcli.c4
-rw-r--r--include/dnsjit/output/tcpcli.h2
-rw-r--r--include/dnsjit/output/tcpcli.hh12
-rw-r--r--include/dnsjit/output/tcpcli.lua2
-rw-r--r--include/dnsjit/output/tlscli.c2
-rw-r--r--include/dnsjit/output/tlscli.h2
-rw-r--r--include/dnsjit/output/tlscli.hh14
-rw-r--r--include/dnsjit/output/tlscli.lua2
-rw-r--r--include/dnsjit/output/udpcli.c4
-rw-r--r--include/dnsjit/output/udpcli.h2
-rw-r--r--include/dnsjit/output/udpcli.hh14
-rw-r--r--include/dnsjit/output/udpcli.lua2
-rw-r--r--include/dnsjit/test/Makefile.am13
-rw-r--r--include/dnsjit/test/Makefile.in17
-rw-r--r--include/dnsjit/test/dns.pcap.gzbin0 -> 4529 bytes
-rw-r--r--include/dnsjit/test/dns.pcap.xzbin0 -> 3216 bytes
-rwxr-xr-xinclude/dnsjit/test/test1.sh29
-rwxr-xr-xinclude/dnsjit/test/test2.sh2
-rwxr-xr-xinclude/dnsjit/test/test3.sh2
-rwxr-xr-xinclude/dnsjit/test/test4.sh2
-rwxr-xr-xinclude/dnsjit/test/test6.sh2
-rw-r--r--include/dnsjit/test/test_compressupport.lua8
-rw-r--r--include/dnsjit/version.h4
-rwxr-xr-xm4/dl.sh2
-rw-r--r--src/Makefile.am26
-rw-r--r--src/Makefile.in119
-rw-r--r--src/config.h.in6
-rw-r--r--src/core.lua2
-rw-r--r--src/core/assert.h2
-rw-r--r--src/core/channel.c2
-rw-r--r--src/core/channel.h2
-rw-r--r--src/core/channel.hh8
-rw-r--r--src/core/channel.lua2
-rw-r--r--src/core/compat.c2
-rw-r--r--src/core/compat.h2
-rw-r--r--src/core/compat.lua2
-rw-r--r--src/core/file.c2
-rw-r--r--src/core/file.h2
-rw-r--r--src/core/file.hh2
-rw-r--r--src/core/file.lua2
-rw-r--r--src/core/loader.lua2
-rw-r--r--src/core/log.c2
-rw-r--r--src/core/log.h2
-rw-r--r--src/core/log.hh2
-rw-r--r--src/core/log.lua2
-rw-r--r--src/core/object.c2
-rw-r--r--src/core/object.h2
-rw-r--r--src/core/object.hh2
-rw-r--r--src/core/object.lua2
-rw-r--r--src/core/object/dns.c2
-rw-r--r--src/core/object/dns.h2
-rw-r--r--src/core/object/dns.hh6
-rw-r--r--src/core/object/dns.lua2
-rw-r--r--src/core/object/dns/label.lua2
-rw-r--r--src/core/object/dns/q.lua2
-rw-r--r--src/core/object/dns/rr.lua2
-rw-r--r--src/core/object/ether.c2
-rw-r--r--src/core/object/ether.h2
-rw-r--r--src/core/object/ether.hh4
-rw-r--r--src/core/object/ether.lua2
-rw-r--r--src/core/object/gre.c2
-rw-r--r--src/core/object/gre.h2
-rw-r--r--src/core/object/gre.hh4
-rw-r--r--src/core/object/gre.lua2
-rw-r--r--src/core/object/icmp.c2
-rw-r--r--src/core/object/icmp.h2
-rw-r--r--src/core/object/icmp.hh4
-rw-r--r--src/core/object/icmp.lua2
-rw-r--r--src/core/object/icmp6.c2
-rw-r--r--src/core/object/icmp6.h2
-rw-r--r--src/core/object/icmp6.hh4
-rw-r--r--src/core/object/icmp6.lua2
-rw-r--r--src/core/object/ieee802.c2
-rw-r--r--src/core/object/ieee802.h2
-rw-r--r--src/core/object/ieee802.hh4
-rw-r--r--src/core/object/ieee802.lua2
-rw-r--r--src/core/object/ip.c2
-rw-r--r--src/core/object/ip.h2
-rw-r--r--src/core/object/ip.hh4
-rw-r--r--src/core/object/ip.lua2
-rw-r--r--src/core/object/ip6.c2
-rw-r--r--src/core/object/ip6.h2
-rw-r--r--src/core/object/ip6.hh4
-rw-r--r--src/core/object/ip6.lua2
-rw-r--r--src/core/object/linuxsll.c2
-rw-r--r--src/core/object/linuxsll.h2
-rw-r--r--src/core/object/linuxsll.hh4
-rw-r--r--src/core/object/linuxsll.lua2
-rw-r--r--src/core/object/loop.c2
-rw-r--r--src/core/object/loop.h2
-rw-r--r--src/core/object/loop.hh4
-rw-r--r--src/core/object/loop.lua2
-rw-r--r--src/core/object/null.c2
-rw-r--r--src/core/object/null.h2
-rw-r--r--src/core/object/null.hh4
-rw-r--r--src/core/object/null.lua2
-rw-r--r--src/core/object/payload.c2
-rw-r--r--src/core/object/payload.h2
-rw-r--r--src/core/object/payload.hh4
-rw-r--r--src/core/object/payload.lua2
-rw-r--r--src/core/object/pcap.c2
-rw-r--r--src/core/object/pcap.h2
-rw-r--r--src/core/object/pcap.hh6
-rw-r--r--src/core/object/pcap.lua2
-rw-r--r--src/core/object/tcp.c2
-rw-r--r--src/core/object/tcp.h2
-rw-r--r--src/core/object/tcp.hh4
-rw-r--r--src/core/object/tcp.lua2
-rw-r--r--src/core/object/udp.c2
-rw-r--r--src/core/object/udp.h2
-rw-r--r--src/core/object/udp.hh4
-rw-r--r--src/core/object/udp.lua2
-rw-r--r--src/core/objects.lua2
-rw-r--r--src/core/producer.c2
-rw-r--r--src/core/producer.h2
-rw-r--r--src/core/producer.hh4
-rw-r--r--src/core/producer.lua2
-rw-r--r--src/core/receiver.c2
-rw-r--r--src/core/receiver.h2
-rw-r--r--src/core/receiver.hh4
-rw-r--r--src/core/receiver.lua2
-rw-r--r--src/core/thread.c6
-rw-r--r--src/core/thread.h2
-rw-r--r--src/core/thread.hh12
-rw-r--r--src/core/thread.lua8
-rw-r--r--src/core/timespec.h2
-rw-r--r--src/core/timespec.hh2
-rw-r--r--src/core/timespec.lua2
-rw-r--r--src/dnsjit.1in2
-rw-r--r--src/dnsjit.c36
-rw-r--r--src/filter.lua2
-rw-r--r--src/filter/copy.hh4
-rw-r--r--src/filter/ipsplit.hh4
-rw-r--r--src/filter/layer.c4
-rw-r--r--src/filter/layer.h2
-rw-r--r--src/filter/layer.hh36
-rw-r--r--src/filter/layer.lua2
-rw-r--r--src/filter/split.c2
-rw-r--r--src/filter/split.h2
-rw-r--r--src/filter/split.hh6
-rw-r--r--src/filter/split.lua2
-rw-r--r--src/filter/timing.c2
-rw-r--r--src/filter/timing.h2
-rw-r--r--src/filter/timing.hh10
-rw-r--r--src/filter/timing.lua2
-rw-r--r--src/gen-manpage.lua2
-rw-r--r--src/globals.c2
-rw-r--r--src/globals.h2
-rw-r--r--src/input.lua2
-rw-r--r--src/input/fpcap.c2
-rw-r--r--src/input/fpcap.h2
-rw-r--r--src/input/fpcap.hh10
-rw-r--r--src/input/fpcap.lua2
-rw-r--r--src/input/mmpcap.c2
-rw-r--r--src/input/mmpcap.h2
-rw-r--r--src/input/mmpcap.hh10
-rw-r--r--src/input/mmpcap.lua2
-rw-r--r--src/input/pcap.c2
-rw-r--r--src/input/pcap.h2
-rw-r--r--src/input/pcap.hh10
-rw-r--r--src/input/pcap.lua2
-rw-r--r--src/input/zero.lua2
-rw-r--r--src/input/zmmpcap.c677
-rw-r--r--src/input/zmmpcap.h31
-rw-r--r--src/input/zmmpcap.hh77
-rw-r--r--src/input/zmmpcap.lua149
-rw-r--r--src/input/zpcap.c159
-rw-r--r--src/input/zpcap.h2
-rw-r--r--src/input/zpcap.hh14
-rw-r--r--src/input/zpcap.lua12
-rw-r--r--src/lib.lua2
-rw-r--r--src/lib/clock.c2
-rw-r--r--src/lib/clock.h2
-rw-r--r--src/lib/clock.hh4
-rw-r--r--src/lib/clock.lua2
-rw-r--r--src/lib/getopt.lua2
-rw-r--r--src/lib/ip.lua2
-rw-r--r--src/lib/parseconf.lua2
-rw-r--r--src/lib/trie.c30
-rw-r--r--src/output.lua2
-rw-r--r--src/output/dnscli.c4
-rw-r--r--src/output/dnscli.h2
-rw-r--r--src/output/dnscli.hh14
-rw-r--r--src/output/dnscli.lua2
-rw-r--r--src/output/null.lua2
-rw-r--r--src/output/pcap.c2
-rw-r--r--src/output/pcap.h2
-rw-r--r--src/output/pcap.hh8
-rw-r--r--src/output/pcap.lua2
-rw-r--r--src/output/respdiff.c2
-rw-r--r--src/output/respdiff.h2
-rw-r--r--src/output/respdiff.hh6
-rw-r--r--src/output/respdiff.lua2
-rw-r--r--src/output/tcpcli.c4
-rw-r--r--src/output/tcpcli.h2
-rw-r--r--src/output/tcpcli.hh12
-rw-r--r--src/output/tcpcli.lua2
-rw-r--r--src/output/tlscli.c2
-rw-r--r--src/output/tlscli.h2
-rw-r--r--src/output/tlscli.hh14
-rw-r--r--src/output/tlscli.lua2
-rw-r--r--src/output/udpcli.c4
-rw-r--r--src/output/udpcli.h2
-rw-r--r--src/output/udpcli.hh14
-rw-r--r--src/output/udpcli.lua2
-rw-r--r--src/test/Makefile.am13
-rw-r--r--src/test/Makefile.in17
-rw-r--r--src/test/dns.pcap.gzbin0 -> 4529 bytes
-rw-r--r--src/test/dns.pcap.xzbin0 -> 3216 bytes
-rwxr-xr-xsrc/test/test1.sh29
-rwxr-xr-xsrc/test/test2.sh2
-rwxr-xr-xsrc/test/test3.sh2
-rwxr-xr-xsrc/test/test4.sh2
-rwxr-xr-xsrc/test/test6.sh2
-rw-r--r--src/test/test_compressupport.lua8
-rw-r--r--src/version.h4
394 files changed, 3285 insertions, 878 deletions
diff --git a/CHANGES b/CHANGES
index ac74e1b..8a39b24 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,35 @@
+2024-08-28 Jerry Lundström
+
+ Release 1.4.0
+
+ This release adds a new module `input.zmmpcap` to read compressed PCAPs
+ using `mmap()`, changes how `core.thread` push/pop, removes signal
+ blocking and squashes a few bugs.
+
+ For `core.thread`, the `push()`/`pop()` now uses `double` instead of
+ `int64_t` to match the conversion table of LuaJIT and to support
+ floating point numbers.
+
+ Updates:
+ - `examples/dumpdns`:
+ - Add support for reading PCAPs using `mmpcap` or `zmmpcap`
+ - Add support for reading PCAPs from stdin
+ - `zpcap`: Add support for reading zlib/lzma compressed PCAPs
+
+ Fixes:
+ - Fix #234: Remove signal blocking
+ - Fix #233: floating point numbers not supported by `dnsjit.core.thread` push/pop
+ - Fix a potential memory leak in trie
+ - `zpcap`: Fix incorrect check if having enough to read
+
+ b376ac9 Fix a potential memory leak in trie
+ dfeb20e Badges
+ e4fa047 Fix zzmpcap
+ 88b5ccf Compressed PCAPs, Copyright
+ 36b8266 thread push number
+ 0056736 thread push number
+ 0247ec6 Signals, code format
+
2023-12-07 Jerry Lundström
Release 1.3.0
diff --git a/Makefile.am b/Makefile.am
index 5c84f41..168e36c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/Makefile.in b/Makefile.in
index da97ab8..5d4ae9f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -376,6 +376,8 @@ libdir = @libdir@
libexecdir = @libexecdir@
liblz4_CFLAGS = @liblz4_CFLAGS@
liblz4_LIBS = @liblz4_LIBS@
+liblzma_CFLAGS = @liblzma_CFLAGS@
+liblzma_LIBS = @liblzma_LIBS@
libpcap_CFLAGS = @libpcap_CFLAGS@
libpcap_LIBS = @libpcap_LIBS@
libzstd_CFLAGS = @libzstd_CFLAGS@
diff --git a/README.md b/README.md
index 7fe8043..2c26e2a 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Engine for capturing, parsing and replaying DNS
-[![Total alerts](https://img.shields.io/lgtm/alerts/g/DNS-OARC/dnsjit.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/DNS-OARC/dnsjit/alerts/) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsjit&metric=bugs)](https://sonarcloud.io/dashboard?id=dns-oarc%3Adnsjit) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsjit&metric=security_rating)](https://sonarcloud.io/dashboard?id=dns-oarc%3Adnsjit)
+[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsjit&metric=bugs)](https://sonarcloud.io/summary/new_code?id=dns-oarc%3Adnsjit) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=dns-oarc%3Adnsjit&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=dns-oarc%3Adnsjit)
**dnsjit** is a combination of parts taken from **dsc**, **dnscap**, **drool**,
and put together around Lua to create a script-based engine for easy
@@ -137,7 +137,7 @@ See more examples in the [examples](https://github.com/DNS-OARC/dnsjit/tree/deve
## Copyright
-Copyright (c) 2018-2023, OARC, Inc.
+Copyright (c) 2018-2024 OARC, Inc.
All rights reserved.
diff --git a/configure b/configure
index ccf86c6..460a3e3 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for dnsjit 1.3.0.
+# Generated by GNU Autoconf 2.71 for dnsjit 1.4.0.
#
# Report bugs to <admin@dns-oarc.net>.
#
@@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dnsjit'
PACKAGE_TARNAME='dnsjit'
-PACKAGE_VERSION='1.3.0'
-PACKAGE_STRING='dnsjit 1.3.0'
+PACKAGE_VERSION='1.4.0'
+PACKAGE_STRING='dnsjit 1.4.0'
PACKAGE_BUGREPORT='admin@dns-oarc.net'
PACKAGE_URL='https://github.com/DNS-OARC/dnsjit/issues'
@@ -663,6 +663,8 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+liblzma_LIBS
+liblzma_CFLAGS
libzstd_LIBS
libzstd_CFLAGS
liblz4_LIBS
@@ -847,7 +849,9 @@ gnutls_LIBS
liblz4_CFLAGS
liblz4_LIBS
libzstd_CFLAGS
-libzstd_LIBS'
+libzstd_LIBS
+liblzma_CFLAGS
+liblzma_LIBS'
# Initialize some variables set by options.
@@ -1396,7 +1400,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dnsjit 1.3.0 to adapt to many kinds of systems.
+\`configure' configures dnsjit 1.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1467,7 +1471,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dnsjit 1.3.0:";;
+ short | recursive ) echo "Configuration of dnsjit 1.4.0:";;
esac
cat <<\_ACEOF
@@ -1541,6 +1545,10 @@ Some influential environment variables:
C compiler flags for libzstd, overriding pkg-config
libzstd_LIBS
linker flags for libzstd, overriding pkg-config
+ liblzma_CFLAGS
+ C compiler flags for liblzma, overriding pkg-config
+ liblzma_LIBS
+ linker flags for liblzma, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1610,7 +1618,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dnsjit configure 1.3.0
+dnsjit configure 1.4.0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2098,7 +2106,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dnsjit $as_me 1.3.0, which was
+It was created by dnsjit $as_me 1.4.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -2858,7 +2866,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
printf "%s\n" "#define PACKAGE_MAJOR_VERSION 1" >>confdefs.h
-printf "%s\n" "#define PACKAGE_MINOR_VERSION 3" >>confdefs.h
+printf "%s\n" "#define PACKAGE_MINOR_VERSION 4" >>confdefs.h
printf "%s\n" "#define PACKAGE_PATCH_VERSION 0" >>confdefs.h
@@ -3377,7 +3385,7 @@ fi
# Define the identity of the package.
PACKAGE='dnsjit'
- VERSION='1.3.0'
+ VERSION='1.4.0'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -16158,6 +16166,124 @@ printf "%s\n" "yes" >&6; }
printf "%s\n" "#define HAVE_ZSTD /**/" >>confdefs.h
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
+printf %s "checking for gzopen in -lz... " >&6; }
+if test ${ac_cv_lib_z_gzopen+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+char gzopen ();
+int
+main (void)
+{
+return gzopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_lib_z_gzopen=yes
+else $as_nop
+ ac_cv_lib_z_gzopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5
+printf "%s\n" "$ac_cv_lib_z_gzopen" >&6; }
+if test "x$ac_cv_lib_z_gzopen" = xyes
+then :
+ printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h
+
+ LIBS="-lz $LIBS"
+
+else $as_nop
+ as_fn_error $? "zlib not found" "$LINENO" 5
+fi
+
+
+pkg_failed=no
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for liblzma >= 5.2.0" >&5
+printf %s "checking for liblzma >= 5.2.0... " >&6; }
+
+if test -n "$liblzma_CFLAGS"; then
+ pkg_cv_liblzma_CFLAGS="$liblzma_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma >= 5.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "liblzma >= 5.2.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_liblzma_CFLAGS=`$PKG_CONFIG --cflags "liblzma >= 5.2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$liblzma_LIBS"; then
+ pkg_cv_liblzma_LIBS="$liblzma_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma >= 5.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "liblzma >= 5.2.0") 2>&5
+ ac_status=$?
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_liblzma_LIBS=`$PKG_CONFIG --libs "liblzma >= 5.2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ liblzma_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblzma >= 5.2.0" 2>&1`
+ else
+ liblzma_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblzma >= 5.2.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$liblzma_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+ :
+else
+ liblzma_CFLAGS=$pkg_cv_liblzma_CFLAGS
+ liblzma_LIBS=$pkg_cv_liblzma_LIBS
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define HAVE_LZMA /**/" >>confdefs.h
+
+fi
# Checks for sizes
# The cast to long int works around a bug in the HP C Compiler
@@ -17045,7 +17171,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dnsjit $as_me 1.3.0, which was
+This file was extended by dnsjit $as_me 1.4.0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17114,7 +17240,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-dnsjit config.status 1.3.0
+dnsjit config.status 1.4.0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 7627712..8a5344c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -17,9 +17,9 @@
# along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.64)
-AC_INIT([dnsjit], [1.3.0], [admin@dns-oarc.net], [dnsjit], [https://github.com/DNS-OARC/dnsjit/issues])
+AC_INIT([dnsjit], [1.4.0], [admin@dns-oarc.net], [dnsjit], [https://github.com/DNS-OARC/dnsjit/issues])
AC_DEFINE([PACKAGE_MAJOR_VERSION], [1], [Define to the major version of this package.])
-AC_DEFINE([PACKAGE_MINOR_VERSION], [3], [Define to the minor version of this package.])
+AC_DEFINE([PACKAGE_MINOR_VERSION], [4], [Define to the minor version of this package.])
AC_DEFINE([PACKAGE_PATCH_VERSION], [0], [Define to the patch version of this package.])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_CONFIG_SRCDIR([src/dnsjit.c])
@@ -92,6 +92,8 @@ PKG_CHECK_MODULES([gnutls], [gnutls],, [
])
PKG_CHECK_MODULES([liblz4], [liblz4 >= 1.8.0 liblz4 != 131], [AC_DEFINE([HAVE_LZ4], [], [Use liblz4])],:)
PKG_CHECK_MODULES([libzstd], [libzstd >= 1.3.0], [AC_DEFINE([HAVE_ZSTD], [], [Use libzstd])],:)
+AC_CHECK_LIB([z], [gzopen],, [AC_MSG_ERROR([zlib not found])])
+PKG_CHECK_MODULES([liblzma], [liblzma >= 5.2.0], [AC_DEFINE([HAVE_LZMA], [], [Use liblzma])],:)
# Checks for sizes
AC_CHECK_SIZEOF([void*])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 45329c6..a184589 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/examples/Makefile.in b/examples/Makefile.in
index ba58780..ac0905a 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -297,6 +297,8 @@ libdir = @libdir@
libexecdir = @libexecdir@
liblz4_CFLAGS = @liblz4_CFLAGS@
liblz4_LIBS = @liblz4_LIBS@
+liblzma_CFLAGS = @liblzma_CFLAGS@
+liblzma_LIBS = @liblzma_LIBS@
libpcap_CFLAGS = @libpcap_CFLAGS@
libpcap_LIBS = @libpcap_LIBS@
libzstd_CFLAGS = @libzstd_CFLAGS@
diff --git a/examples/dumpdns.lua b/examples/dumpdns.lua
index 3eab4f4..b243b40 100755
--- a/examples/dumpdns.lua
+++ b/examples/dumpdns.lua
@@ -1,28 +1,61 @@
#!/usr/bin/env dnsjit
local pcap = arg[2]
local compression = arg[3]
+local mmap = arg[4]
if pcap == nil then
- print("usage: "..arg[1].." <pcap> [compression]")
+ print("usage: "..arg[1].." <pcap | '-' for stdin> [compression] [mmap]")
return
end
local object = require("dnsjit.core.objects")
local input = require("dnsjit.input.pcap").new()
local zinput = require("dnsjit.input.zpcap").new()
+if mmap then
+ zinput = require("dnsjit.input.zmmpcap").new()
+end
local layer = require("dnsjit.filter.layer").new()
local dns = require("dnsjit.core.object.dns").new()
if string.lower(string.sub(pcap, -4)) == ".zst" or compression == "zstd" then
zinput:zstd()
- zinput:open(pcap)
+ if pcap == "-" then
+ zinput:openfp(io.stdin)
+ else
+ zinput:open(pcap)
+ end
layer:producer(zinput)
elseif string.lower(string.sub(pcap, -4)) == ".lz4" or compression == "lz4" then
zinput:lz4()
- zinput:open(pcap)
+ if pcap == "-" then
+ zinput:openfp(io.stdin)
+ else
+ zinput:open(pcap)
+ end
+ layer:producer(zinput)
+elseif string.lower(string.sub(pcap, -3)) == ".xz" or compression == "xz" then
+ zinput:lzma()
+ if pcap == "-" then
+ zinput:openfp(io.stdin)
+ else
+ zinput:open(pcap)
+ end
+ layer:producer(zinput)
+elseif string.lower(string.sub(pcap, -3)) == ".gz" or compression == "gz" then
+ zinput:gzip()
+ if pcap == "-" then
+ zinput:openfp(io.stdin)
+ else
+ zinput:open(pcap)
+ end
layer:producer(zinput)
else
- input:open_offline(pcap)
+ if mmap then
+ input = require("dnsjit.input.mmpcap").new()
+ input:open(pcap)
+ else
+ input:open_offline(pcap)
+ end
layer:producer(input)
end
local producer, ctx = layer:produce()
diff --git a/include/dnsjit/Makefile.am b/include/dnsjit/Makefile.am
index 0f088af..90fd511 100644
--- a/include/dnsjit/Makefile.am
+++ b/include/dnsjit/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -29,7 +29,8 @@ AM_CFLAGS = -Werror=attributes \
$(PTHREAD_CFLAGS) \
$(luajit_CFLAGS) \
$(liblz4_CFLAGS) $(libzstd_CFLAGS) \
- $(libpcap_CFLAGS) $(gnutls_CFLAGS)
+ $(libpcap_CFLAGS) $(gnutls_CFLAGS) \
+ $(liblzma_CFLAGS)
EXTRA_DIST = gen-manpage.lua gen-compat.lua gen-errno.sh dnsjit.1in
@@ -44,19 +45,19 @@ nobase_dnsjitinclude_HEADERS = globals.h version.h
lua_hobjects = core/compat.luaho
lua_objects = core.luao lib.luao input.luao filter.luao output.luao
dnsjit_LDADD = $(PTHREAD_LIBS) $(luajit_LIBS) $(liblz4_LIBS) $(libzstd_LIBS) \
- $(libpcap_LIBS) $(gnutls_LIBS)
+ $(libpcap_LIBS) $(gnutls_LIBS) $(liblzma_LIBS)
# C source and headers
-dnsjit_SOURCES += core/channel.c core/compat.c core/file.c core/log.c core/object.c core/object/dns.c core/object/ether.c core/object/gre.c core/object/icmp6.c core/object/icmp.c core/object/ieee802.c core/object/ip6.c core/object/ip.c core/object/linuxsll.c core/object/loop.c core/object/null.c core/object/payload.c core/object/pcap.c core/object/tcp.c core/object/udp.c core/producer.c core/receiver.c core/thread.c filter/copy.c filter/ipsplit.c filter/layer.c filter/split.c filter/timing.c input/fpcap.c input/mmpcap.c input/pcap.c input/zpcap.c lib/base64url.c lib/clock.c lib/trie.c output/dnscli.c output/pcap.c output/respdiff.c output/tcpcli.c output/tlscli.c output/udpcli.c
-nobase_dnsjitinclude_HEADERS += core/assert.h core/channel.h core/compat.h core/file.h core/log.h core/object/dns.h core/object/ether.h core/object/gre.h core/object.h core/object/icmp6.h core/object/icmp.h core/object/ieee802.h core/object/ip6.h core/object/ip.h core/object/linuxsll.h core/object/loop.h core/object/null.h core/object/payload.h core/object/pcap.h core/object/tcp.h core/object/udp.h core/producer.h core/receiver.h core/thread.h core/timespec.h filter/copy.h filter/ipsplit.h filter/layer.h filter/split.h filter/timing.h input/fpcap.h input/mmpcap.h input/pcap.h input/zpcap.h lib/base64url.h lib/clock.h lib/trie.h output/dnscli.h output/pcap.h output/respdiff.h output/tcpcli.h output/tlscli.h output/udpcli.h
+dnsjit_SOURCES += core/channel.c core/compat.c core/file.c core/log.c core/object.c core/object/dns.c core/object/ether.c core/object/gre.c core/object/icmp6.c core/object/icmp.c core/object/ieee802.c core/object/ip6.c core/object/ip.c core/object/linuxsll.c core/object/loop.c core/object/null.c core/object/payload.c core/object/pcap.c core/object/tcp.c core/object/udp.c core/producer.c core/receiver.c core/thread.c filter/copy.c filter/ipsplit.c filter/layer.c filter/split.c filter/timing.c input/fpcap.c input/mmpcap.c input/pcap.c input/zmmpcap.c input/zpcap.c lib/base64url.c lib/clock.c lib/trie.c output/dnscli.c output/pcap.c output/respdiff.c output/tcpcli.c output/tlscli.c output/udpcli.c
+nobase_dnsjitinclude_HEADERS += core/assert.h core/channel.h core/compat.h core/file.h core/log.h core/object/dns.h core/object/ether.h core/object/gre.h core/object.h core/object/icmp6.h core/object/icmp.h core/object/ieee802.h core/object/ip6.h core/object/ip.h core/object/linuxsll.h core/object/loop.h core/object/null.h core/object/payload.h core/object/pcap.h core/object/tcp.h core/object/udp.h core/producer.h core/receiver.h core/thread.h core/timespec.h filter/copy.h filter/ipsplit.h filter/layer.h filter/split.h filter/timing.h input/fpcap.h input/mmpcap.h input/pcap.h input/zmmpcap.h input/zpcap.h lib/base64url.h lib/clock.h lib/trie.h output/dnscli.h output/pcap.h output/respdiff.h output/tcpcli.h output/tlscli.h output/udpcli.h
# Lua headers
-nobase_dnsjitinclude_HEADERS += core/channel.hh core/file.hh core/log.hh core/object/dns.hh core/object/ether.hh core/object/gre.hh core/object.hh core/object/icmp6.hh core/object/icmp.hh core/object/ieee802.hh core/object/ip6.hh core/object/ip.hh core/object/linuxsll.hh core/object/loop.hh core/object/null.hh core/object/payload.hh core/object/pcap.hh core/object/tcp.hh core/object/udp.hh core/producer.hh core/receiver.hh core/thread.hh core/timespec.hh filter/copy.hh filter/ipsplit.hh filter/layer.hh filter/split.hh filter/timing.hh input/fpcap.hh input/mmpcap.hh input/pcap.hh input/zpcap.hh lib/base64url.hh lib/clock.hh lib/trie.hh output/dnscli.hh output/pcap.hh output/respdiff.hh output/tcpcli.hh output/tlscli.hh output/udpcli.hh
-lua_hobjects += core/channel.luaho core/file.luaho core/log.luaho core/object/dns.luaho core/object/ether.luaho core/object/gre.luaho core/object/icmp6.luaho core/object/icmp.luaho core/object/ieee802.luaho core/object/ip6.luaho core/object/ip.luaho core/object/linuxsll.luaho core/object/loop.luaho core/object.luaho core/object/null.luaho core/object/payload.luaho core/object/pcap.luaho core/object/tcp.luaho core/object/udp.luaho core/producer.luaho core/receiver.luaho core/thread.luaho core/timespec.luaho filter/copy.luaho filter/ipsplit.luaho filter/layer.luaho filter/split.luaho filter/timing.luaho input/fpcap.luaho input/mmpcap.luaho input/pcap.luaho input/zpcap.luaho lib/base64url.luaho lib/clock.luaho lib/trie.luaho output/dnscli.luaho output/pcap.luaho output/respdiff.luaho output/tcpcli.luaho output/tlscli.luaho output/udpcli.luaho
+nobase_dnsjitinclude_HEADERS += core/channel.hh core/file.hh core/log.hh core/object/dns.hh core/object/ether.hh core/object/gre.hh core/object.hh core/object/icmp6.hh core/object/icmp.hh core/object/ieee802.hh core/object/ip6.hh core/object/ip.hh core/object/linuxsll.hh core/object/loop.hh core/object/null.hh core/object/payload.hh core/object/pcap.hh core/object/tcp.hh core/object/udp.hh core/producer.hh core/receiver.hh core/thread.hh core/timespec.hh filter/copy.hh filter/ipsplit.hh filter/layer.hh filter/split.hh filter/timing.hh input/fpcap.hh input/mmpcap.hh input/pcap.hh input/zmmpcap.hh input/zpcap.hh lib/base64url.hh lib/clock.hh lib/trie.hh output/dnscli.hh output/pcap.hh output/respdiff.hh output/tcpcli.hh output/tlscli.hh output/udpcli.hh
+lua_hobjects += core/channel.luaho core/file.luaho core/log.luaho core/object/dns.luaho core/object/ether.luaho core/object/gre.luaho core/object/icmp6.luaho core/object/icmp.luaho core/object/ieee802.luaho core/object/ip6.luaho core/object/ip.luaho core/object/linuxsll.luaho core/object/loop.luaho core/object.luaho core/object/null.luaho core/object/payload.luaho core/object/pcap.luaho core/object/tcp.luaho core/object/udp.luaho core/producer.luaho core/receiver.luaho core/thread.luaho core/timespec.luaho filter/copy.luaho filter/ipsplit.luaho filter/layer.luaho filter/split.luaho filter/timing.luaho input/fpcap.luaho input/mmpcap.luaho input/pcap.luaho input/zmmpcap.luaho input/zpcap.luaho lib/base64url.luaho lib/clock.luaho lib/trie.luaho output/dnscli.luaho output/pcap.luaho output/respdiff.luaho output/tcpcli.luaho output/tlscli.luaho output/udpcli.luaho
# Lua sources
-dist_dnsjit_SOURCES += core/channel.lua core/compat.lua core/file.lua core/loader.lua core/log.lua core/object/dns/label.lua core/object/dns.lua core/object/dns/q.lua core/object/dns/rr.lua core/object/ether.lua core/object/gre.lua core/object/icmp6.lua core/object/icmp.lua core/object/ieee802.lua core/object/ip6.lua core/object/ip.lua core/object/linuxsll.lua core/object/loop.lua core/object.lua core/object/null.lua core/object/payload.lua core/object/pcap.lua core/objects.lua core/object/tcp.lua core/object/udp.lua core/producer.lua core/receiver.lua core/thread.lua core/timespec.lua filter/copy.lua filter/ipsplit.lua filter/layer.lua filter/split.lua filter/timing.lua input/fpcap.lua input/mmpcap.lua input/pcap.lua input/zero.lua input/zpcap.lua lib/base64url.lua lib/clock.lua lib/getopt.lua lib/ip.lua lib/parseconf.lua lib/trie/iter.lua lib/trie.lua lib/trie/node.lua output/dnscli.lua output/null.lua output/pcap.lua output/respdiff.lua output/tcpcli.lua output/tlscli.lua output/udpcli.lua
-lua_objects += core/channel.luao core/compat.luao core/file.luao core/loader.luao core/log.luao core/object/dns/label.luao core/object/dns.luao core/object/dns/q.luao core/object/dns/rr.luao core/object/ether.luao core/object/gre.luao core/object/icmp6.luao core/object/icmp.luao core/object/ieee802.luao core/object/ip6.luao core/object/ip.luao core/object/linuxsll.luao core/object/loop.luao core/object.luao core/object/null.luao core/object/payload.luao core/object/pcap.luao core/objects.luao core/object/tcp.luao core/object/udp.luao core/producer.luao core/receiver.luao core/thread.luao core/timespec.luao filter/copy.luao filter/ipsplit.luao filter/layer.luao filter/split.luao filter/timing.luao input/fpcap.luao input/mmpcap.luao input/pcap.luao input/zero.luao input/zpcap.luao lib/base64url.luao lib/clock.luao lib/getopt.luao lib/ip.luao lib/parseconf.luao lib/trie/iter.luao lib/trie.luao lib/trie/node.luao output/dnscli.luao output/null.luao output/pcap.luao output/respdiff.luao output/tcpcli.luao output/tlscli.luao output/udpcli.luao
+dist_dnsjit_SOURCES += core/channel.lua core/compat.lua core/file.lua core/loader.lua core/log.lua core/object/dns/label.lua core/object/dns.lua core/object/dns/q.lua core/object/dns/rr.lua core/object/ether.lua core/object/gre.lua core/object/icmp6.lua core/object/icmp.lua core/object/ieee802.lua core/object/ip6.lua core/object/ip.lua core/object/linuxsll.lua core/object/loop.lua core/object.lua core/object/null.lua core/object/payload.lua core/object/pcap.lua core/objects.lua core/object/tcp.lua core/object/udp.lua core/producer.lua core/receiver.lua core/thread.lua core/timespec.lua filter/copy.lua filter/ipsplit.lua filter/layer.lua filter/split.lua filter/timing.lua input/fpcap.lua input/mmpcap.lua input/pcap.lua input/zero.lua input/zmmpcap.lua input/zpcap.lua lib/base64url.lua lib/clock.lua lib/getopt.lua lib/ip.lua lib/parseconf.lua lib/trie/iter.lua lib/trie.lua lib/trie/node.lua output/dnscli.lua output/null.lua output/pcap.lua output/respdiff.lua output/tcpcli.lua output/tlscli.lua output/udpcli.lua
+lua_objects += core/channel.luao core/compat.luao core/file.luao core/loader.luao core/log.luao core/object/dns/label.luao core/object/dns.luao core/object/dns/q.luao core/object/dns/rr.luao core/object/ether.luao core/object/gre.luao core/object/icmp6.luao core/object/icmp.luao core/object/ieee802.luao core/object/ip6.luao core/object/ip.luao core/object/linuxsll.luao core/object/loop.luao core/object.luao core/object/null.luao core/object/payload.luao core/object/pcap.luao core/objects.luao core/object/tcp.luao core/object/udp.luao core/producer.luao core/receiver.luao core/thread.luao core/timespec.luao filter/copy.luao filter/ipsplit.luao filter/layer.luao filter/split.luao filter/timing.luao input/fpcap.luao input/mmpcap.luao input/pcap.luao input/zero.luao input/zmmpcap.luao input/zpcap.luao lib/base64url.luao lib/clock.luao lib/getopt.luao lib/ip.luao lib/parseconf.luao lib/trie/iter.luao lib/trie.luao lib/trie/node.luao output/dnscli.luao output/null.luao output/pcap.luao output/respdiff.luao output/tcpcli.luao output/tlscli.luao output/udpcli.luao
dnsjit_LDFLAGS = -Wl,-E
dnsjit_LDADD += $(lua_hobjects) $(lua_objects)
@@ -66,7 +67,7 @@ man1_MANS = dnsjit.1
CLEANFILES += $(man1_MANS)
man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.3 dnsjit.output.3
-man3_MANS += dnsjit.core.channel.3 dnsjit.core.compat.3 dnsjit.core.file.3 dnsjit.core.loader.3 dnsjit.core.log.3 dnsjit.core.object.3 dnsjit.core.object.dns.3 dnsjit.core.object.dns.label.3 dnsjit.core.object.dns.q.3 dnsjit.core.object.dns.rr.3 dnsjit.core.object.ether.3 dnsjit.core.object.gre.3 dnsjit.core.object.icmp.3 dnsjit.core.object.icmp6.3 dnsjit.core.object.ieee802.3 dnsjit.core.object.ip.3 dnsjit.core.object.ip6.3 dnsjit.core.object.linuxsll.3 dnsjit.core.object.loop.3 dnsjit.core.object.null.3 dnsjit.core.object.payload.3 dnsjit.core.object.pcap.3 dnsjit.core.objects.3 dnsjit.core.object.tcp.3 dnsjit.core.object.udp.3 dnsjit.core.producer.3 dnsjit.core.receiver.3 dnsjit.core.thread.3 dnsjit.core.timespec.3 dnsjit.filter.copy.3 dnsjit.filter.ipsplit.3 dnsjit.filter.layer.3 dnsjit.filter.split.3 dnsjit.filter.timing.3 dnsjit.input.fpcap.3 dnsjit.input.mmpcap.3 dnsjit.input.pcap.3 dnsjit.input.zero.3 dnsjit.input.zpcap.3 dnsjit.lib.base64url.3 dnsjit.lib.clock.3 dnsjit.lib.getopt.3 dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 dnsjit.lib.trie.3 dnsjit.lib.trie.iter.3 dnsjit.lib.trie.node.3 dnsjit.output.dnscli.3 dnsjit.output.null.3 dnsjit.output.pcap.3 dnsjit.output.respdiff.3 dnsjit.output.tcpcli.3 dnsjit.output.tlscli.3 dnsjit.output.udpcli.3
+man3_MANS += dnsjit.core.channel.3 dnsjit.core.compat.3 dnsjit.core.file.3 dnsjit.core.loader.3 dnsjit.core.log.3 dnsjit.core.object.3 dnsjit.core.object.dns.3 dnsjit.core.object.dns.label.3 dnsjit.core.object.dns.q.3 dnsjit.core.object.dns.rr.3 dnsjit.core.object.ether.3 dnsjit.core.object.gre.3 dnsjit.core.object.icmp.3 dnsjit.core.object.icmp6.3 dnsjit.core.object.ieee802.3 dnsjit.core.object.ip.3 dnsjit.core.object.ip6.3 dnsjit.core.object.linuxsll.3 dnsjit.core.object.loop.3 dnsjit.core.object.null.3 dnsjit.core.object.payload.3 dnsjit.core.object.pcap.3 dnsjit.core.objects.3 dnsjit.core.object.tcp.3 dnsjit.core.object.udp.3 dnsjit.core.producer.3 dnsjit.core.receiver.3 dnsjit.core.thread.3 dnsjit.core.timespec.3 dnsjit.filter.copy.3 dnsjit.filter.ipsplit.3 dnsjit.filter.layer.3 dnsjit.filter.split.3 dnsjit.filter.timing.3 dnsjit.input.fpcap.3 dnsjit.input.mmpcap.3 dnsjit.input.pcap.3 dnsjit.input.zero.3 dnsjit.input.zmmpcap.3 dnsjit.input.zpcap.3 dnsjit.lib.base64url.3 dnsjit.lib.clock.3 dnsjit.lib.getopt.3 dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 dnsjit.lib.trie.3 dnsjit.lib.trie.iter.3 dnsjit.lib.trie.node.3 dnsjit.output.dnscli.3 dnsjit.output.null.3 dnsjit.output.pcap.3 dnsjit.output.respdiff.3 dnsjit.output.tcpcli.3 dnsjit.output.tlscli.3 dnsjit.output.udpcli.3
CLEANFILES += *.3in $(man3_MANS)
.lua.luao:
@@ -80,7 +81,7 @@ CLEANFILES += *.3in $(man3_MANS)
.hh.luah:
@mkdir -p `dirname "$@"`
@echo 'module(...,package.seeall);' > "$@"
- @cat "$<" | grep '^//lua:' | sed 's%^//lua:%%' >> "$@"
+ @cat "$<" | grep '^// *lua:' | sed 's%^// *lua:%%' >> "$@"
@echo 'require("ffi").cdef[[' >> "$@"
@cat "$<" | grep -v '^#' >> "$@"
@echo ']]' >> "$@"
@@ -240,6 +241,9 @@ dnsjit.input.pcap.3in: input/pcap.lua gen-manpage.lua
dnsjit.input.zero.3in: input/zero.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zero.lua" > "$@"
+dnsjit.input.zmmpcap.3in: input/zmmpcap.lua gen-manpage.lua
+ $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zmmpcap.lua" > "$@"
+
dnsjit.input.zpcap.3in: input/zpcap.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zpcap.lua" > "$@"
diff --git a/include/dnsjit/Makefile.in b/include/dnsjit/Makefile.in
index eb8523b..16dd15f 100644
--- a/include/dnsjit/Makefile.in
+++ b/include/dnsjit/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -150,18 +150,18 @@ am_dnsjit_OBJECTS = dnsjit.$(OBJEXT) globals.$(OBJEXT) \
filter/layer.$(OBJEXT) filter/split.$(OBJEXT) \
filter/timing.$(OBJEXT) input/fpcap.$(OBJEXT) \
input/mmpcap.$(OBJEXT) input/pcap.$(OBJEXT) \
- input/zpcap.$(OBJEXT) lib/base64url.$(OBJEXT) \
- lib/clock.$(OBJEXT) lib/trie.$(OBJEXT) output/dnscli.$(OBJEXT) \
- output/pcap.$(OBJEXT) output/respdiff.$(OBJEXT) \
- output/tcpcli.$(OBJEXT) output/tlscli.$(OBJEXT) \
- output/udpcli.$(OBJEXT)
+ input/zmmpcap.$(OBJEXT) input/zpcap.$(OBJEXT) \
+ lib/base64url.$(OBJEXT) lib/clock.$(OBJEXT) lib/trie.$(OBJEXT) \
+ output/dnscli.$(OBJEXT) output/pcap.$(OBJEXT) \
+ output/respdiff.$(OBJEXT) output/tcpcli.$(OBJEXT) \
+ output/tlscli.$(OBJEXT) output/udpcli.$(OBJEXT)
dist_dnsjit_OBJECTS =
dnsjit_OBJECTS = $(am_dnsjit_OBJECTS) $(dist_dnsjit_OBJECTS)
am__DEPENDENCIES_1 =
dnsjit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(lua_hobjects) \
- $(lua_objects)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(lua_hobjects) $(lua_objects)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -201,11 +201,12 @@ am__depfiles_remade = ./$(DEPDIR)/dnsjit.Po ./$(DEPDIR)/globals.Po \
filter/$(DEPDIR)/layer.Po filter/$(DEPDIR)/split.Po \
filter/$(DEPDIR)/timing.Po input/$(DEPDIR)/fpcap.Po \
input/$(DEPDIR)/mmpcap.Po input/$(DEPDIR)/pcap.Po \
- input/$(DEPDIR)/zpcap.Po lib/$(DEPDIR)/base64url.Po \
- lib/$(DEPDIR)/clock.Po lib/$(DEPDIR)/trie.Po \
- output/$(DEPDIR)/dnscli.Po output/$(DEPDIR)/pcap.Po \
- output/$(DEPDIR)/respdiff.Po output/$(DEPDIR)/tcpcli.Po \
- output/$(DEPDIR)/tlscli.Po output/$(DEPDIR)/udpcli.Po
+ input/$(DEPDIR)/zmmpcap.Po input/$(DEPDIR)/zpcap.Po \
+ lib/$(DEPDIR)/base64url.Po lib/$(DEPDIR)/clock.Po \
+ lib/$(DEPDIR)/trie.Po output/$(DEPDIR)/dnscli.Po \
+ output/$(DEPDIR)/pcap.Po output/$(DEPDIR)/respdiff.Po \
+ output/$(DEPDIR)/tcpcli.Po output/$(DEPDIR)/tlscli.Po \
+ output/$(DEPDIR)/udpcli.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -445,6 +446,8 @@ libdir = @libdir@
libexecdir = @libexecdir@
liblz4_CFLAGS = @liblz4_CFLAGS@
liblz4_LIBS = @liblz4_LIBS@
+liblzma_CFLAGS = @liblzma_CFLAGS@
+liblzma_LIBS = @liblzma_LIBS@
libpcap_CFLAGS = @libpcap_CFLAGS@
libpcap_LIBS = @libpcap_LIBS@
libzstd_CFLAGS = @libzstd_CFLAGS@
@@ -481,7 +484,8 @@ AM_CFLAGS = -Werror=attributes \
$(PTHREAD_CFLAGS) \
$(luajit_CFLAGS) \
$(liblz4_CFLAGS) $(libzstd_CFLAGS) \
- $(libpcap_CFLAGS) $(gnutls_CFLAGS)
+ $(libpcap_CFLAGS) $(gnutls_CFLAGS) \
+ $(liblzma_CFLAGS)
EXTRA_DIST = gen-manpage.lua gen-compat.lua gen-errno.sh dnsjit.1in
BUILT_SOURCES = core/compat.hh core/log_errstr.c
@@ -496,10 +500,10 @@ dnsjit_SOURCES = dnsjit.c globals.c core/channel.c core/compat.c \
core/object/tcp.c core/object/udp.c core/producer.c \
core/receiver.c core/thread.c filter/copy.c filter/ipsplit.c \
filter/layer.c filter/split.c filter/timing.c input/fpcap.c \
- input/mmpcap.c input/pcap.c input/zpcap.c lib/base64url.c \
- lib/clock.c lib/trie.c output/dnscli.c output/pcap.c \
- output/respdiff.c output/tcpcli.c output/tlscli.c \
- output/udpcli.c
+ input/mmpcap.c input/pcap.c input/zmmpcap.c input/zpcap.c \
+ lib/base64url.c lib/clock.c lib/trie.c output/dnscli.c \
+ output/pcap.c output/respdiff.c output/tcpcli.c \
+ output/tlscli.c output/udpcli.c
# Lua sources
dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.lua \
@@ -516,9 +520,9 @@ dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.lua \
core/thread.lua core/timespec.lua filter/copy.lua \
filter/ipsplit.lua filter/layer.lua filter/split.lua \
filter/timing.lua input/fpcap.lua input/mmpcap.lua \
- input/pcap.lua input/zero.lua input/zpcap.lua \
- lib/base64url.lua lib/clock.lua lib/getopt.lua lib/ip.lua \
- lib/parseconf.lua lib/trie/iter.lua lib/trie.lua \
+ input/pcap.lua input/zero.lua input/zmmpcap.lua \
+ input/zpcap.lua lib/base64url.lua lib/clock.lua lib/getopt.lua \
+ lib/ip.lua lib/parseconf.lua lib/trie/iter.lua lib/trie.lua \
lib/trie/node.lua output/dnscli.lua output/null.lua \
output/pcap.lua output/respdiff.lua output/tcpcli.lua \
output/tlscli.lua output/udpcli.lua
@@ -535,23 +539,23 @@ nobase_dnsjitinclude_HEADERS = globals.h version.h core/assert.h \
core/object/udp.h core/producer.h core/receiver.h \
core/thread.h core/timespec.h filter/copy.h filter/ipsplit.h \
filter/layer.h filter/split.h filter/timing.h input/fpcap.h \
- input/mmpcap.h input/pcap.h input/zpcap.h lib/base64url.h \
- lib/clock.h lib/trie.h output/dnscli.h output/pcap.h \
- output/respdiff.h output/tcpcli.h output/tlscli.h \
- output/udpcli.h core/channel.hh core/file.hh core/log.hh \
- core/object/dns.hh core/object/ether.hh core/object/gre.hh \
- core/object.hh core/object/icmp6.hh core/object/icmp.hh \
- core/object/ieee802.hh core/object/ip6.hh core/object/ip.hh \
- core/object/linuxsll.hh core/object/loop.hh \
+ input/mmpcap.h input/pcap.h input/zmmpcap.h input/zpcap.h \
+ lib/base64url.h lib/clock.h lib/trie.h output/dnscli.h \
+ output/pcap.h output/respdiff.h output/tcpcli.h \
+ output/tlscli.h output/udpcli.h core/channel.hh core/file.hh \
+ core/log.hh core/object/dns.hh core/object/ether.hh \
+ core/object/gre.hh core/object.hh core/object/icmp6.hh \
+ core/object/icmp.hh core/object/ieee802.hh core/object/ip6.hh \
+ core/object/ip.hh core/object/linuxsll.hh core/object/loop.hh \
core/object/null.hh core/object/payload.hh core/object/pcap.hh \
core/object/tcp.hh core/object/udp.hh core/producer.hh \
core/receiver.hh core/thread.hh core/timespec.hh \
filter/copy.hh filter/ipsplit.hh filter/layer.hh \
filter/split.hh filter/timing.hh input/fpcap.hh \
- input/mmpcap.hh input/pcap.hh input/zpcap.hh lib/base64url.hh \
- lib/clock.hh lib/trie.hh output/dnscli.hh output/pcap.hh \
- output/respdiff.hh output/tcpcli.hh output/tlscli.hh \
- output/udpcli.hh
+ input/mmpcap.hh input/pcap.hh input/zmmpcap.hh input/zpcap.hh \
+ lib/base64url.hh lib/clock.hh lib/trie.hh output/dnscli.hh \
+ output/pcap.hh output/respdiff.hh output/tcpcli.hh \
+ output/tlscli.hh output/udpcli.hh
lua_hobjects = core/compat.luaho core/channel.luaho core/file.luaho \
core/log.luaho core/object/dns.luaho core/object/ether.luaho \
core/object/gre.luaho core/object/icmp6.luaho \
@@ -565,10 +569,10 @@ lua_hobjects = core/compat.luaho core/channel.luaho core/file.luaho \
core/timespec.luaho filter/copy.luaho filter/ipsplit.luaho \
filter/layer.luaho filter/split.luaho filter/timing.luaho \
input/fpcap.luaho input/mmpcap.luaho input/pcap.luaho \
- input/zpcap.luaho lib/base64url.luaho lib/clock.luaho \
- lib/trie.luaho output/dnscli.luaho output/pcap.luaho \
- output/respdiff.luaho output/tcpcli.luaho output/tlscli.luaho \
- output/udpcli.luaho
+ input/zmmpcap.luaho input/zpcap.luaho lib/base64url.luaho \
+ lib/clock.luaho lib/trie.luaho output/dnscli.luaho \
+ output/pcap.luaho output/respdiff.luaho output/tcpcli.luaho \
+ output/tlscli.luaho output/udpcli.luaho
lua_objects = core.luao lib.luao input.luao filter.luao output.luao \
core/channel.luao core/compat.luao core/file.luao \
core/loader.luao core/log.luao core/object/dns/label.luao \
@@ -585,15 +589,15 @@ lua_objects = core.luao lib.luao input.luao filter.luao output.luao \
core/timespec.luao filter/copy.luao filter/ipsplit.luao \
filter/layer.luao filter/split.luao filter/timing.luao \
input/fpcap.luao input/mmpcap.luao input/pcap.luao \
- input/zero.luao input/zpcap.luao lib/base64url.luao \
- lib/clock.luao lib/getopt.luao lib/ip.luao lib/parseconf.luao \
- lib/trie/iter.luao lib/trie.luao lib/trie/node.luao \
- output/dnscli.luao output/null.luao output/pcap.luao \
- output/respdiff.luao output/tcpcli.luao output/tlscli.luao \
- output/udpcli.luao
+ input/zero.luao input/zmmpcap.luao input/zpcap.luao \
+ lib/base64url.luao lib/clock.luao lib/getopt.luao lib/ip.luao \
+ lib/parseconf.luao lib/trie/iter.luao lib/trie.luao \
+ lib/trie/node.luao output/dnscli.luao output/null.luao \
+ output/pcap.luao output/respdiff.luao output/tcpcli.luao \
+ output/tlscli.luao output/udpcli.luao
dnsjit_LDADD = $(PTHREAD_LIBS) $(luajit_LIBS) $(liblz4_LIBS) \
- $(libzstd_LIBS) $(libpcap_LIBS) $(gnutls_LIBS) $(lua_hobjects) \
- $(lua_objects)
+ $(libzstd_LIBS) $(libpcap_LIBS) $(gnutls_LIBS) $(liblzma_LIBS) \
+ $(lua_hobjects) $(lua_objects)
dnsjit_LDFLAGS = -Wl,-E
man1_MANS = dnsjit.1
man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.3 \
@@ -615,13 +619,14 @@ man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.3 \
dnsjit.filter.layer.3 dnsjit.filter.split.3 \
dnsjit.filter.timing.3 dnsjit.input.fpcap.3 \
dnsjit.input.mmpcap.3 dnsjit.input.pcap.3 dnsjit.input.zero.3 \
- dnsjit.input.zpcap.3 dnsjit.lib.base64url.3 dnsjit.lib.clock.3 \
- dnsjit.lib.getopt.3 dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 \
- dnsjit.lib.trie.3 dnsjit.lib.trie.iter.3 \
- dnsjit.lib.trie.node.3 dnsjit.output.dnscli.3 \
- dnsjit.output.null.3 dnsjit.output.pcap.3 \
- dnsjit.output.respdiff.3 dnsjit.output.tcpcli.3 \
- dnsjit.output.tlscli.3 dnsjit.output.udpcli.3
+ dnsjit.input.zmmpcap.3 dnsjit.input.zpcap.3 \
+ dnsjit.lib.base64url.3 dnsjit.lib.clock.3 dnsjit.lib.getopt.3 \
+ dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 dnsjit.lib.trie.3 \
+ dnsjit.lib.trie.iter.3 dnsjit.lib.trie.node.3 \
+ dnsjit.output.dnscli.3 dnsjit.output.null.3 \
+ dnsjit.output.pcap.3 dnsjit.output.respdiff.3 \
+ dnsjit.output.tcpcli.3 dnsjit.output.tlscli.3 \
+ dnsjit.output.udpcli.3
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -806,6 +811,8 @@ input/mmpcap.$(OBJEXT): input/$(am__dirstamp) \
input/$(DEPDIR)/$(am__dirstamp)
input/pcap.$(OBJEXT): input/$(am__dirstamp) \
input/$(DEPDIR)/$(am__dirstamp)
+input/zmmpcap.$(OBJEXT): input/$(am__dirstamp) \
+ input/$(DEPDIR)/$(am__dirstamp)
input/zpcap.$(OBJEXT): input/$(am__dirstamp) \
input/$(DEPDIR)/$(am__dirstamp)
lib/$(am__dirstamp):
@@ -886,6 +893,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/fpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/mmpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/pcap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/zmmpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/zpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/base64url.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/clock.Po@am__quote@ # am--include-marker
@@ -1291,6 +1299,7 @@ distclean: distclean-recursive
-rm -f input/$(DEPDIR)/fpcap.Po
-rm -f input/$(DEPDIR)/mmpcap.Po
-rm -f input/$(DEPDIR)/pcap.Po
+ -rm -f input/$(DEPDIR)/zmmpcap.Po
-rm -f input/$(DEPDIR)/zpcap.Po
-rm -f lib/$(DEPDIR)/base64url.Po
-rm -f lib/$(DEPDIR)/clock.Po
@@ -1383,6 +1392,7 @@ maintainer-clean: maintainer-clean-recursive
-rm -f input/$(DEPDIR)/fpcap.Po
-rm -f input/$(DEPDIR)/mmpcap.Po
-rm -f input/$(DEPDIR)/pcap.Po
+ -rm -f input/$(DEPDIR)/zmmpcap.Po
-rm -f input/$(DEPDIR)/zpcap.Po
-rm -f lib/$(DEPDIR)/base64url.Po
-rm -f lib/$(DEPDIR)/clock.Po
@@ -1450,7 +1460,7 @@ uninstall-man: uninstall-man1 uninstall-man3
.hh.luah:
@mkdir -p `dirname "$@"`
@echo 'module(...,package.seeall);' > "$@"
- @cat "$<" | grep '^//lua:' | sed 's%^//lua:%%' >> "$@"
+ @cat "$<" | grep '^// *lua:' | sed 's%^// *lua:%%' >> "$@"
@echo 'require("ffi").cdef[[' >> "$@"
@cat "$<" | grep -v '^#' >> "$@"
@echo ']]' >> "$@"
@@ -1607,6 +1617,9 @@ dnsjit.input.pcap.3in: input/pcap.lua gen-manpage.lua
dnsjit.input.zero.3in: input/zero.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zero.lua" > "$@"
+dnsjit.input.zmmpcap.3in: input/zmmpcap.lua gen-manpage.lua
+ $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zmmpcap.lua" > "$@"
+
dnsjit.input.zpcap.3in: input/zpcap.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zpcap.lua" > "$@"
diff --git a/include/dnsjit/config.h.in b/include/dnsjit/config.h.in
index 137a5b3..999ca87 100644
--- a/include/dnsjit/config.h.in
+++ b/include/dnsjit/config.h.in
@@ -91,12 +91,18 @@
/* Define to 1 if you have the `pcap' library (-lpcap). */
#undef HAVE_LIBPCAP
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
/* Define to 1 if you have the <lmdb.h> header file. */
#undef HAVE_LMDB_H
/* Use liblz4 */
#undef HAVE_LZ4
+/* Use liblzma */
+#undef HAVE_LZMA
+
/* Define to 1 if you have the <machine/endian.h> header file. */
#undef HAVE_MACHINE_ENDIAN_H
diff --git a/include/dnsjit/core.lua b/include/dnsjit/core.lua
index 1b16d8d..bff4223 100644
--- a/include/dnsjit/core.lua
+++ b/include/dnsjit/core.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/assert.h b/include/dnsjit/core/assert.h
index a7d14a4..36083be 100644
--- a/include/dnsjit/core/assert.h
+++ b/include/dnsjit/core/assert.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/channel.c b/include/dnsjit/core/channel.c
index bbabbcc..6c6d1b4 100644
--- a/include/dnsjit/core/channel.c
+++ b/include/dnsjit/core/channel.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/channel.h b/include/dnsjit/core/channel.h
index fcfb382..15b3e0a 100644
--- a/include/dnsjit/core/channel.h
+++ b/include/dnsjit/core/channel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/channel.hh b/include/dnsjit/core/channel.hh
index 9661381..0f3bc81 100644
--- a/include/dnsjit/core/channel.hh
+++ b/include/dnsjit/core/channel.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,9 +18,9 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct core_channel {
core_log_t _log;
diff --git a/include/dnsjit/core/channel.lua b/include/dnsjit/core/channel.lua
index b652b4a..10edfde 100644
--- a/include/dnsjit/core/channel.lua
+++ b/include/dnsjit/core/channel.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/compat.c b/include/dnsjit/core/compat.c
index 47d8d41..3138829 100644
--- a/include/dnsjit/core/compat.c
+++ b/include/dnsjit/core/compat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/compat.h b/include/dnsjit/core/compat.h
index a6ed26c..1f4f8b9 100644
--- a/include/dnsjit/core/compat.h
+++ b/include/dnsjit/core/compat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/compat.lua b/include/dnsjit/core/compat.lua
index 167b312..98c6611 100644
--- a/include/dnsjit/core/compat.lua
+++ b/include/dnsjit/core/compat.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/file.c b/include/dnsjit/core/file.c
index 4f40c55..8d2eddb 100644
--- a/include/dnsjit/core/file.c
+++ b/include/dnsjit/core/file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/file.h b/include/dnsjit/core/file.h
index 06d75b8..280d320 100644
--- a/include/dnsjit/core/file.h
+++ b/include/dnsjit/core/file.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/file.hh b/include/dnsjit/core/file.hh
index bbf402e..eb87f3b 100644
--- a/include/dnsjit/core/file.hh
+++ b/include/dnsjit/core/file.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/file.lua b/include/dnsjit/core/file.lua
index ce5bb58..33e180c 100644
--- a/include/dnsjit/core/file.lua
+++ b/include/dnsjit/core/file.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/loader.lua b/include/dnsjit/core/loader.lua
index 4cc689f..1c5f9e2 100644
--- a/include/dnsjit/core/loader.lua
+++ b/include/dnsjit/core/loader.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/log.c b/include/dnsjit/core/log.c
index fbf72ae..03b7b2e 100644
--- a/include/dnsjit/core/log.c
+++ b/include/dnsjit/core/log.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/log.h b/include/dnsjit/core/log.h
index be13898..7e012c6 100644
--- a/include/dnsjit/core/log.h
+++ b/include/dnsjit/core/log.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/log.hh b/include/dnsjit/core/log.hh
index 1ec35f3..9921d4c 100644
--- a/include/dnsjit/core/log.hh
+++ b/include/dnsjit/core/log.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/log.lua b/include/dnsjit/core/log.lua
index 6547531..b08cc59 100644
--- a/include/dnsjit/core/log.lua
+++ b/include/dnsjit/core/log.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object.c b/include/dnsjit/core/object.c
index b277f4b..33190dd 100644
--- a/include/dnsjit/core/object.c
+++ b/include/dnsjit/core/object.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object.h b/include/dnsjit/core/object.h
index ec78a15..3a0c0cb 100644
--- a/include/dnsjit/core/object.h
+++ b/include/dnsjit/core/object.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object.hh b/include/dnsjit/core/object.hh
index 7fb8706..5e125c4 100644
--- a/include/dnsjit/core/object.hh
+++ b/include/dnsjit/core/object.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object.lua b/include/dnsjit/core/object.lua
index f59e969..f950ce1 100644
--- a/include/dnsjit/core/object.lua
+++ b/include/dnsjit/core/object.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/dns.c b/include/dnsjit/core/object/dns.c
index a4bf309..85eb9a7 100644
--- a/include/dnsjit/core/object/dns.c
+++ b/include/dnsjit/core/object/dns.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/dns.h b/include/dnsjit/core/object/dns.h
index 143ff89..a2b3d56 100644
--- a/include/dnsjit/core/object/dns.h
+++ b/include/dnsjit/core/object/dns.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/dns.hh b/include/dnsjit/core/object/dns.hh
index b4aefdd..4efd148 100644
--- a/include/dnsjit/core/object/dns.hh
+++ b/include/dnsjit/core/object/dns.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_dns_label {
uint8_t is_end;
diff --git a/include/dnsjit/core/object/dns.lua b/include/dnsjit/core/object/dns.lua
index 632fe95..6cb3477 100644
--- a/include/dnsjit/core/object/dns.lua
+++ b/include/dnsjit/core/object/dns.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/dns/label.lua b/include/dnsjit/core/object/dns/label.lua
index 27bf918..34e77d8 100644
--- a/include/dnsjit/core/object/dns/label.lua
+++ b/include/dnsjit/core/object/dns/label.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/dns/q.lua b/include/dnsjit/core/object/dns/q.lua
index 2eaa7fa..5b90d6c 100644
--- a/include/dnsjit/core/object/dns/q.lua
+++ b/include/dnsjit/core/object/dns/q.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/dns/rr.lua b/include/dnsjit/core/object/dns/rr.lua
index 967d9f1..5689b5f 100644
--- a/include/dnsjit/core/object/dns/rr.lua
+++ b/include/dnsjit/core/object/dns/rr.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ether.c b/include/dnsjit/core/object/ether.c
index dc05391..0d8b160 100644
--- a/include/dnsjit/core/object/ether.c
+++ b/include/dnsjit/core/object/ether.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ether.h b/include/dnsjit/core/object/ether.h
index a5de6f7..7f7f948 100644
--- a/include/dnsjit/core/object/ether.h
+++ b/include/dnsjit/core/object/ether.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ether.hh b/include/dnsjit/core/object/ether.hh
index a3f638e..9e5fc4f 100644
--- a/include/dnsjit/core/object/ether.hh
+++ b/include/dnsjit/core/object/ether.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ether {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/ether.lua b/include/dnsjit/core/object/ether.lua
index 04de9c2..00400d0 100644
--- a/include/dnsjit/core/object/ether.lua
+++ b/include/dnsjit/core/object/ether.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/gre.c b/include/dnsjit/core/object/gre.c
index c359f60..9b5187e 100644
--- a/include/dnsjit/core/object/gre.c
+++ b/include/dnsjit/core/object/gre.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/gre.h b/include/dnsjit/core/object/gre.h
index 4caa6fa..6c6142c 100644
--- a/include/dnsjit/core/object/gre.h
+++ b/include/dnsjit/core/object/gre.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/gre.hh b/include/dnsjit/core/object/gre.hh
index c2008a7..18ab7c8 100644
--- a/include/dnsjit/core/object/gre.hh
+++ b/include/dnsjit/core/object/gre.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_gre {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/gre.lua b/include/dnsjit/core/object/gre.lua
index 22a73f5..e518888 100644
--- a/include/dnsjit/core/object/gre.lua
+++ b/include/dnsjit/core/object/gre.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/icmp.c b/include/dnsjit/core/object/icmp.c
index 3b9ed38..609b4e2 100644
--- a/include/dnsjit/core/object/icmp.c
+++ b/include/dnsjit/core/object/icmp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/icmp.h b/include/dnsjit/core/object/icmp.h
index 931c866..e923b16 100644
--- a/include/dnsjit/core/object/icmp.h
+++ b/include/dnsjit/core/object/icmp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/icmp.hh b/include/dnsjit/core/object/icmp.hh
index 4374a8b..faf528d 100644
--- a/include/dnsjit/core/object/icmp.hh
+++ b/include/dnsjit/core/object/icmp.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_icmp {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/icmp.lua b/include/dnsjit/core/object/icmp.lua
index d2a29c8..dd916d4 100644
--- a/include/dnsjit/core/object/icmp.lua
+++ b/include/dnsjit/core/object/icmp.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/icmp6.c b/include/dnsjit/core/object/icmp6.c
index d312712..250d5a5 100644
--- a/include/dnsjit/core/object/icmp6.c
+++ b/include/dnsjit/core/object/icmp6.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/icmp6.h b/include/dnsjit/core/object/icmp6.h
index fc79f62..62ad056 100644
--- a/include/dnsjit/core/object/icmp6.h
+++ b/include/dnsjit/core/object/icmp6.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/icmp6.hh b/include/dnsjit/core/object/icmp6.hh
index 47967ef..250af69 100644
--- a/include/dnsjit/core/object/icmp6.hh
+++ b/include/dnsjit/core/object/icmp6.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_icmp6 {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/icmp6.lua b/include/dnsjit/core/object/icmp6.lua
index 3ec938e..8ac6c8f 100644
--- a/include/dnsjit/core/object/icmp6.lua
+++ b/include/dnsjit/core/object/icmp6.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ieee802.c b/include/dnsjit/core/object/ieee802.c
index 5cd1bec..e81fbab 100644
--- a/include/dnsjit/core/object/ieee802.c
+++ b/include/dnsjit/core/object/ieee802.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ieee802.h b/include/dnsjit/core/object/ieee802.h
index 84214c8..487acb3 100644
--- a/include/dnsjit/core/object/ieee802.h
+++ b/include/dnsjit/core/object/ieee802.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ieee802.hh b/include/dnsjit/core/object/ieee802.hh
index 4303efb..3abb71d 100644
--- a/include/dnsjit/core/object/ieee802.hh
+++ b/include/dnsjit/core/object/ieee802.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ieee802 {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/ieee802.lua b/include/dnsjit/core/object/ieee802.lua
index 5d75a70..e0d5e23 100644
--- a/include/dnsjit/core/object/ieee802.lua
+++ b/include/dnsjit/core/object/ieee802.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ip.c b/include/dnsjit/core/object/ip.c
index 91a6d42..ff58810 100644
--- a/include/dnsjit/core/object/ip.c
+++ b/include/dnsjit/core/object/ip.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ip.h b/include/dnsjit/core/object/ip.h
index cc79fb0..1fdcdb8 100644
--- a/include/dnsjit/core/object/ip.h
+++ b/include/dnsjit/core/object/ip.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ip.hh b/include/dnsjit/core/object/ip.hh
index 0f92747..8bdb288 100644
--- a/include/dnsjit/core/object/ip.hh
+++ b/include/dnsjit/core/object/ip.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ip {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/ip.lua b/include/dnsjit/core/object/ip.lua
index 84e65b6..787acb8 100644
--- a/include/dnsjit/core/object/ip.lua
+++ b/include/dnsjit/core/object/ip.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ip6.c b/include/dnsjit/core/object/ip6.c
index 4d639b4..8117226 100644
--- a/include/dnsjit/core/object/ip6.c
+++ b/include/dnsjit/core/object/ip6.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ip6.h b/include/dnsjit/core/object/ip6.h
index 831513b..35f31df 100644
--- a/include/dnsjit/core/object/ip6.h
+++ b/include/dnsjit/core/object/ip6.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/ip6.hh b/include/dnsjit/core/object/ip6.hh
index 6ea20cc..5b4823e 100644
--- a/include/dnsjit/core/object/ip6.hh
+++ b/include/dnsjit/core/object/ip6.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ip6 {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/ip6.lua b/include/dnsjit/core/object/ip6.lua
index cdadd7c..459e7dd 100644
--- a/include/dnsjit/core/object/ip6.lua
+++ b/include/dnsjit/core/object/ip6.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/linuxsll.c b/include/dnsjit/core/object/linuxsll.c
index 5f8898e..f96d55a 100644
--- a/include/dnsjit/core/object/linuxsll.c
+++ b/include/dnsjit/core/object/linuxsll.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/linuxsll.h b/include/dnsjit/core/object/linuxsll.h
index e6c36a9..c9c2c3f 100644
--- a/include/dnsjit/core/object/linuxsll.h
+++ b/include/dnsjit/core/object/linuxsll.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/linuxsll.hh b/include/dnsjit/core/object/linuxsll.hh
index 093f430..d9dc99b 100644
--- a/include/dnsjit/core/object/linuxsll.hh
+++ b/include/dnsjit/core/object/linuxsll.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_linuxsll {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/linuxsll.lua b/include/dnsjit/core/object/linuxsll.lua
index 29f59db..8436ce0 100644
--- a/include/dnsjit/core/object/linuxsll.lua
+++ b/include/dnsjit/core/object/linuxsll.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/loop.c b/include/dnsjit/core/object/loop.c
index 0c9acf8..6ab171b 100644
--- a/include/dnsjit/core/object/loop.c
+++ b/include/dnsjit/core/object/loop.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/loop.h b/include/dnsjit/core/object/loop.h
index 1c91b18..911ba45 100644
--- a/include/dnsjit/core/object/loop.h
+++ b/include/dnsjit/core/object/loop.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/loop.hh b/include/dnsjit/core/object/loop.hh
index acaf1c1..b1e4991 100644
--- a/include/dnsjit/core/object/loop.hh
+++ b/include/dnsjit/core/object/loop.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_loop {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/loop.lua b/include/dnsjit/core/object/loop.lua
index 5fbec27..f38b70d 100644
--- a/include/dnsjit/core/object/loop.lua
+++ b/include/dnsjit/core/object/loop.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/null.c b/include/dnsjit/core/object/null.c
index d9fe8b9..8e0b9fd 100644
--- a/include/dnsjit/core/object/null.c
+++ b/include/dnsjit/core/object/null.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/null.h b/include/dnsjit/core/object/null.h
index e173f0b..d807541 100644
--- a/include/dnsjit/core/object/null.h
+++ b/include/dnsjit/core/object/null.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/null.hh b/include/dnsjit/core/object/null.hh
index d934185..95293a3 100644
--- a/include/dnsjit/core/object/null.hh
+++ b/include/dnsjit/core/object/null.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_null {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/null.lua b/include/dnsjit/core/object/null.lua
index 3d4f456..46939eb 100644
--- a/include/dnsjit/core/object/null.lua
+++ b/include/dnsjit/core/object/null.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/payload.c b/include/dnsjit/core/object/payload.c
index efc5726..17188d2 100644
--- a/include/dnsjit/core/object/payload.c
+++ b/include/dnsjit/core/object/payload.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/payload.h b/include/dnsjit/core/object/payload.h
index dc3ae6a..898379a 100644
--- a/include/dnsjit/core/object/payload.h
+++ b/include/dnsjit/core/object/payload.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/payload.hh b/include/dnsjit/core/object/payload.hh
index 573fd45..e9d86fb 100644
--- a/include/dnsjit/core/object/payload.hh
+++ b/include/dnsjit/core/object/payload.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_payload {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/payload.lua b/include/dnsjit/core/object/payload.lua
index cb80b13..ac4d2a7 100644
--- a/include/dnsjit/core/object/payload.lua
+++ b/include/dnsjit/core/object/payload.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/pcap.c b/include/dnsjit/core/object/pcap.c
index fe9beca..fc6c7be 100644
--- a/include/dnsjit/core/object/pcap.c
+++ b/include/dnsjit/core/object/pcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/pcap.h b/include/dnsjit/core/object/pcap.h
index e88102e..ed87c26 100644
--- a/include/dnsjit/core/object/pcap.h
+++ b/include/dnsjit/core/object/pcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/pcap.hh b/include/dnsjit/core/object/pcap.hh
index 09a50df..4d2ec48 100644
--- a/include/dnsjit/core/object/pcap.hh
+++ b/include/dnsjit/core/object/pcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct core_object_pcap {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/pcap.lua b/include/dnsjit/core/object/pcap.lua
index 0b0e1aa..66b049e 100644
--- a/include/dnsjit/core/object/pcap.lua
+++ b/include/dnsjit/core/object/pcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/tcp.c b/include/dnsjit/core/object/tcp.c
index f46bfe6..4a916c6 100644
--- a/include/dnsjit/core/object/tcp.c
+++ b/include/dnsjit/core/object/tcp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/tcp.h b/include/dnsjit/core/object/tcp.h
index 41fddcc..490b644 100644
--- a/include/dnsjit/core/object/tcp.h
+++ b/include/dnsjit/core/object/tcp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/tcp.hh b/include/dnsjit/core/object/tcp.hh
index 869ab9a..b9a659a 100644
--- a/include/dnsjit/core/object/tcp.hh
+++ b/include/dnsjit/core/object/tcp.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_tcp {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/tcp.lua b/include/dnsjit/core/object/tcp.lua
index 1856098..5e23a4b 100644
--- a/include/dnsjit/core/object/tcp.lua
+++ b/include/dnsjit/core/object/tcp.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/udp.c b/include/dnsjit/core/object/udp.c
index c58fc5d..ff6c7a2 100644
--- a/include/dnsjit/core/object/udp.c
+++ b/include/dnsjit/core/object/udp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/udp.h b/include/dnsjit/core/object/udp.h
index 00c95e0..c58b13d 100644
--- a/include/dnsjit/core/object/udp.h
+++ b/include/dnsjit/core/object/udp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/object/udp.hh b/include/dnsjit/core/object/udp.hh
index 7dbe20f..39748a4 100644
--- a/include/dnsjit/core/object/udp.hh
+++ b/include/dnsjit/core/object/udp.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_udp {
const core_object_t* obj_prev;
diff --git a/include/dnsjit/core/object/udp.lua b/include/dnsjit/core/object/udp.lua
index 0e0393f..e23408b 100644
--- a/include/dnsjit/core/object/udp.lua
+++ b/include/dnsjit/core/object/udp.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/objects.lua b/include/dnsjit/core/objects.lua
index 2ba9407..c4b7639 100644
--- a/include/dnsjit/core/objects.lua
+++ b/include/dnsjit/core/objects.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/producer.c b/include/dnsjit/core/producer.c
index 315a838..61ea255 100644
--- a/include/dnsjit/core/producer.c
+++ b/include/dnsjit/core/producer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/producer.h b/include/dnsjit/core/producer.h
index 038e3a2..139782e 100644
--- a/include/dnsjit/core/producer.h
+++ b/include/dnsjit/core/producer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/producer.hh b/include/dnsjit/core/producer.hh
index 1cb6b54..ab3a222 100644
--- a/include/dnsjit/core/producer.hh
+++ b/include/dnsjit/core/producer.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,6 +18,6 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef const core_object_t* (*core_producer_t)(void* ctx);
diff --git a/include/dnsjit/core/producer.lua b/include/dnsjit/core/producer.lua
index b0ab4fe..e457807 100644
--- a/include/dnsjit/core/producer.lua
+++ b/include/dnsjit/core/producer.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/receiver.c b/include/dnsjit/core/receiver.c
index 7a484a2..5264549 100644
--- a/include/dnsjit/core/receiver.c
+++ b/include/dnsjit/core/receiver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/receiver.h b/include/dnsjit/core/receiver.h
index 8cb2132..e109778 100644
--- a/include/dnsjit/core/receiver.h
+++ b/include/dnsjit/core/receiver.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/receiver.hh b/include/dnsjit/core/receiver.hh
index eb3041e..3bea05f 100644
--- a/include/dnsjit/core/receiver.hh
+++ b/include/dnsjit/core/receiver.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,6 +18,6 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef void (*core_receiver_t)(void* ctx, const core_object_t* obj);
diff --git a/include/dnsjit/core/receiver.lua b/include/dnsjit/core/receiver.lua
index 66b6a7c..91c4cee 100644
--- a/include/dnsjit/core/receiver.lua
+++ b/include/dnsjit/core/receiver.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/core/thread.c b/include/dnsjit/core/thread.c
index ff121e4..abaa063 100644
--- a/include/dnsjit/core/thread.c
+++ b/include/dnsjit/core/thread.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -185,7 +185,7 @@ void core_thread_push_string(core_thread_t* self, const char* str, size_t len)
_push(self, item);
}
-void core_thread_push_int64(core_thread_t* self, int64_t i64)
+void core_thread_push_number(core_thread_t* self, double num)
{
core_thread_item_t* item;
mlassert_self();
@@ -194,7 +194,7 @@ void core_thread_push_int64(core_thread_t* self, int64_t i64)
item->next = 0;
item->ptr = 0;
item->str = 0;
- item->i64 = i64;
+ item->num = num;
_push(self, item);
}
diff --git a/include/dnsjit/core/thread.h b/include/dnsjit/core/thread.h
index f6a0576..ffae739 100644
--- a/include/dnsjit/core/thread.h
+++ b/include/dnsjit/core/thread.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/thread.hh b/include/dnsjit/core/thread.hh
index 1771333..1161f13 100644
--- a/include/dnsjit/core/thread.hh
+++ b/include/dnsjit/core/thread.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
typedef struct core_thread_item core_thread_item_t;
struct core_thread_item {
@@ -27,8 +27,8 @@ struct core_thread_item {
void* ptr;
char * type, *module;
- char* str;
- int64_t i64;
+ char* str;
+ double num;
};
typedef struct core_thread {
@@ -52,5 +52,5 @@ int core_thread_start(core_thread_t* self, const char* byt
int core_thread_stop(core_thread_t* self);
void core_thread_push(core_thread_t* self, void* ptr, const char* type, size_t type_len, const char* module, size_t module_len);
void core_thread_push_string(core_thread_t* self, const char* str, size_t len);
-void core_thread_push_int64(core_thread_t* self, int64_t i64);
+void core_thread_push_number(core_thread_t* self, double num);
const core_thread_item_t* core_thread_pop(core_thread_t* self);
diff --git a/include/dnsjit/core/thread.lua b/include/dnsjit/core/thread.lua
index e79d356..577e9bf 100644
--- a/include/dnsjit/core/thread.lua
+++ b/include/dnsjit/core/thread.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
@@ -87,7 +87,7 @@ function Thread:push(...)
if t == "string" then
C.core_thread_push_string(self, obj, #obj)
elseif t == "number" then
- C.core_thread_push_int64(self, obj)
+ C.core_thread_push_number(self, obj)
else
local ptr, type, module = obj:share()
C.core_thread_push(self, ptr, type, #type, module, #module)
@@ -108,7 +108,7 @@ function Thread:pop(num)
end
if item.ptr == nil then
if item.str == nil then
- return tonumber(item.i64)
+ return tonumber(item.num)
end
return ffi.string(item.str)
end
@@ -123,7 +123,7 @@ function Thread:pop(num)
if item.ptr == nil then
if item.str == nil then
- table.insert(ret, tonumber(item.i64))
+ table.insert(ret, tonumber(item.num))
else
table.insert(ret, ffi.string(item.str))
end
diff --git a/include/dnsjit/core/timespec.h b/include/dnsjit/core/timespec.h
index 3b52d4a..5d99e24 100644
--- a/include/dnsjit/core/timespec.h
+++ b/include/dnsjit/core/timespec.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/timespec.hh b/include/dnsjit/core/timespec.hh
index 249a3ae..0c40d11 100644
--- a/include/dnsjit/core/timespec.hh
+++ b/include/dnsjit/core/timespec.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/core/timespec.lua b/include/dnsjit/core/timespec.lua
index a53eada..ab810e0 100644
--- a/include/dnsjit/core/timespec.lua
+++ b/include/dnsjit/core/timespec.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/dnsjit.1in b/include/dnsjit/dnsjit.1in
index 7512409..3d2262e 100644
--- a/include/dnsjit/dnsjit.1in
+++ b/include/dnsjit/dnsjit.1in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2018-2023, OARC, Inc.
+.\" Copyright (c) 2018-2024 OARC, Inc.
.\" All rights reserved.
.\"
.\" This file is part of dnsjit.
diff --git a/include/dnsjit/dnsjit.c b/include/dnsjit/dnsjit.c
index 4d05d5f..20b8d14 100644
--- a/include/dnsjit/dnsjit.c
+++ b/include/dnsjit/dnsjit.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -27,52 +27,18 @@
#include <lualib.h>
#include <lauxlib.h>
-#include <pthread.h>
-#include <signal.h>
-#include <string.h>
#include <stdio.h>
-static void* _sighthr(void* arg)
-{
- sigset_t* set = (sigset_t*)arg;
- int sig = 0, err;
-
- if ((err = sigwait(set, &sig))) {
- gldebug("sigwait %d", err);
- }
- glfatal("signal %d", sig);
-
- return 0;
-}
-
int main(int argc, char* argv[])
{
lua_State* L;
int n, err;
- sigset_t set;
- pthread_t sighthr;
if (argc < 2) {
fprintf(stderr, "usage: %s <file.lua> ...\n", argv[0]);
exit(1);
}
- sigfillset(&set);
- if ((err = pthread_sigmask(SIG_BLOCK, &set, 0))) {
- glfatal("Unable to set blocked signals with pthread_sigmask()");
- return 2;
- }
-
- sigemptyset(&set);
- sigaddset(&set, SIGTERM);
- sigaddset(&set, SIGQUIT);
- sigaddset(&set, SIGINT);
-
- if ((err = pthread_create(&sighthr, 0, _sighthr, &set))) {
- glfatal("Unable to start signal thread with pthread_create()");
- return 2;
- }
-
L = luaL_newstate();
luaL_openlibs(L);
dnsjit_globals(L);
diff --git a/include/dnsjit/filter.lua b/include/dnsjit/filter.lua
index 4b58a15..29f0c77 100644
--- a/include/dnsjit/filter.lua
+++ b/include/dnsjit/filter.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/filter/copy.hh b/include/dnsjit/filter/copy.hh
index edf7fc7..7af2ce4 100644
--- a/include/dnsjit/filter/copy.hh
+++ b/include/dnsjit/filter/copy.hh
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct filter_copy {
core_log_t _log;
diff --git a/include/dnsjit/filter/ipsplit.hh b/include/dnsjit/filter/ipsplit.hh
index c362ac3..6c74a6c 100644
--- a/include/dnsjit/filter/ipsplit.hh
+++ b/include/dnsjit/filter/ipsplit.hh
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct filter_ipsplit_recv filter_ipsplit_recv_t;
struct filter_ipsplit_recv {
diff --git a/include/dnsjit/filter/layer.c b/include/dnsjit/filter/layer.c
index dd03c5d..80f0450 100644
--- a/include/dnsjit/filter/layer.c
+++ b/include/dnsjit/filter/layer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -180,7 +180,7 @@ static inline uint32_t _need32(const void* ptr)
p += x; \
l -= x
-//static int _ip(filter_layer_t* self, const core_object_t* obj, const unsigned char* pkt, size_t len);
+// static int _ip(filter_layer_t* self, const core_object_t* obj, const unsigned char* pkt, size_t len);
static inline int _proto(filter_layer_t* self, uint8_t proto, const core_object_t* obj, const unsigned char* pkt, size_t len)
{
diff --git a/include/dnsjit/filter/layer.h b/include/dnsjit/filter/layer.h
index e656f76..6e527d9 100644
--- a/include/dnsjit/filter/layer.h
+++ b/include/dnsjit/filter/layer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/filter/layer.hh b/include/dnsjit/filter/layer.hh
index bfeabfe..d60d1fc 100644
--- a/include/dnsjit/filter/layer.hh
+++ b/include/dnsjit/filter/layer.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,23 +18,23 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
-//lua:require("dnsjit.core.object.null_h")
-//lua:require("dnsjit.core.object.ether_h")
-//lua:require("dnsjit.core.object.loop_h")
-//lua:require("dnsjit.core.object.linuxsll_h")
-//lua:require("dnsjit.core.object.ieee802_h")
-//lua:require("dnsjit.core.object.ip_h")
-//lua:require("dnsjit.core.object.ip6_h")
-//lua:require("dnsjit.core.object.gre_h")
-//lua:require("dnsjit.core.object.icmp_h")
-//lua:require("dnsjit.core.object.icmp6_h")
-//lua:require("dnsjit.core.object.udp_h")
-//lua:require("dnsjit.core.object.tcp_h")
-//lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.object.null_h")
+// lua:require("dnsjit.core.object.ether_h")
+// lua:require("dnsjit.core.object.loop_h")
+// lua:require("dnsjit.core.object.linuxsll_h")
+// lua:require("dnsjit.core.object.ieee802_h")
+// lua:require("dnsjit.core.object.ip_h")
+// lua:require("dnsjit.core.object.ip6_h")
+// lua:require("dnsjit.core.object.gre_h")
+// lua:require("dnsjit.core.object.icmp_h")
+// lua:require("dnsjit.core.object.icmp6_h")
+// lua:require("dnsjit.core.object.udp_h")
+// lua:require("dnsjit.core.object.tcp_h")
+// lua:require("dnsjit.core.object.payload_h")
typedef struct filter_layer {
core_log_t _log;
diff --git a/include/dnsjit/filter/layer.lua b/include/dnsjit/filter/layer.lua
index da000f4..c0e497e 100644
--- a/include/dnsjit/filter/layer.lua
+++ b/include/dnsjit/filter/layer.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/filter/split.c b/include/dnsjit/filter/split.c
index 616f690..27a6c28 100644
--- a/include/dnsjit/filter/split.c
+++ b/include/dnsjit/filter/split.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/filter/split.h b/include/dnsjit/filter/split.h
index c4796b7..24ab39d 100644
--- a/include/dnsjit/filter/split.h
+++ b/include/dnsjit/filter/split.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/filter/split.hh b/include/dnsjit/filter/split.hh
index 044a851..44c7af9 100644
--- a/include/dnsjit/filter/split.hh
+++ b/include/dnsjit/filter/split.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef enum filter_split_mode {
FILTER_SPLIT_MODE_ROUNDROBIN,
diff --git a/include/dnsjit/filter/split.lua b/include/dnsjit/filter/split.lua
index 9a14c68..e16cbee 100644
--- a/include/dnsjit/filter/split.lua
+++ b/include/dnsjit/filter/split.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/filter/timing.c b/include/dnsjit/filter/timing.c
index 9351a90..225d372 100644
--- a/include/dnsjit/filter/timing.c
+++ b/include/dnsjit/filter/timing.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/filter/timing.h b/include/dnsjit/filter/timing.h
index 9a67974..328777e 100644
--- a/include/dnsjit/filter/timing.h
+++ b/include/dnsjit/filter/timing.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/filter/timing.hh b/include/dnsjit/filter/timing.hh
index beb35bb..2e29d8a 100644
--- a/include/dnsjit/filter/timing.hh
+++ b/include/dnsjit/filter/timing.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,10 +18,10 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct filter_timing {
core_log_t _log;
diff --git a/include/dnsjit/filter/timing.lua b/include/dnsjit/filter/timing.lua
index 2255ebc..72d8fed 100644
--- a/include/dnsjit/filter/timing.lua
+++ b/include/dnsjit/filter/timing.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/gen-manpage.lua b/include/dnsjit/gen-manpage.lua
index 459d7eb..d19f4b1 100644
--- a/include/dnsjit/gen-manpage.lua
+++ b/include/dnsjit/gen-manpage.lua
@@ -1,5 +1,5 @@
print[[
-.\" Copyright (c) 2018-2023, OARC, Inc.
+.\" Copyright (c) 2018-2024 OARC, Inc.
.\" All rights reserved.
.\"
.\" This file is part of dnsjit.
diff --git a/include/dnsjit/globals.c b/include/dnsjit/globals.c
index a9c2e1d..90f724b 100644
--- a/include/dnsjit/globals.c
+++ b/include/dnsjit/globals.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/globals.h b/include/dnsjit/globals.h
index e6ed354..8b4346a 100644
--- a/include/dnsjit/globals.h
+++ b/include/dnsjit/globals.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input.lua b/include/dnsjit/input.lua
index 3fb3705..268d667 100644
--- a/include/dnsjit/input.lua
+++ b/include/dnsjit/input.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/input/fpcap.c b/include/dnsjit/input/fpcap.c
index 8c585c8..04885c6 100644
--- a/include/dnsjit/input/fpcap.c
+++ b/include/dnsjit/input/fpcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/fpcap.h b/include/dnsjit/input/fpcap.h
index e327acd..4f2967e 100644
--- a/include/dnsjit/input/fpcap.h
+++ b/include/dnsjit/input/fpcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/fpcap.hh b/include/dnsjit/input/fpcap.hh
index aacad46..dd8e19d 100644
--- a/include/dnsjit/input/fpcap.hh
+++ b/include/dnsjit/input/fpcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,10 +18,10 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef struct input_fpcap {
core_log_t _log;
diff --git a/include/dnsjit/input/fpcap.lua b/include/dnsjit/input/fpcap.lua
index 3372228..e0d9447 100644
--- a/include/dnsjit/input/fpcap.lua
+++ b/include/dnsjit/input/fpcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/input/mmpcap.c b/include/dnsjit/input/mmpcap.c
index c5b8542..2caf5cf 100644
--- a/include/dnsjit/input/mmpcap.c
+++ b/include/dnsjit/input/mmpcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/mmpcap.h b/include/dnsjit/input/mmpcap.h
index caecb38..8844cb7 100644
--- a/include/dnsjit/input/mmpcap.h
+++ b/include/dnsjit/input/mmpcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/mmpcap.hh b/include/dnsjit/input/mmpcap.hh
index 0f793fc..387d5a6 100644
--- a/include/dnsjit/input/mmpcap.hh
+++ b/include/dnsjit/input/mmpcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,10 +18,10 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef struct input_mmpcap {
core_log_t _log;
diff --git a/include/dnsjit/input/mmpcap.lua b/include/dnsjit/input/mmpcap.lua
index 97d3b47..983d693 100644
--- a/include/dnsjit/input/mmpcap.lua
+++ b/include/dnsjit/input/mmpcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/input/pcap.c b/include/dnsjit/input/pcap.c
index 6a2e245..2304109 100644
--- a/include/dnsjit/input/pcap.c
+++ b/include/dnsjit/input/pcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/pcap.h b/include/dnsjit/input/pcap.h
index 2756153..5b091ba 100644
--- a/include/dnsjit/input/pcap.h
+++ b/include/dnsjit/input/pcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/pcap.hh b/include/dnsjit/input/pcap.hh
index 20b156a..de694a7 100644
--- a/include/dnsjit/input/pcap.hh
+++ b/include/dnsjit/input/pcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -22,10 +22,10 @@
typedef struct pcap {} pcap_t;
#endif
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef struct input_pcap {
core_log_t _log;
diff --git a/include/dnsjit/input/pcap.lua b/include/dnsjit/input/pcap.lua
index 49f05c6..237a8db 100644
--- a/include/dnsjit/input/pcap.lua
+++ b/include/dnsjit/input/pcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/input/zero.lua b/include/dnsjit/input/zero.lua
index e152c79..6c50d91 100644
--- a/include/dnsjit/input/zero.lua
+++ b/include/dnsjit/input/zero.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/input/zmmpcap.c b/include/dnsjit/input/zmmpcap.c
new file mode 100644
index 0000000..5c920e1
--- /dev/null
+++ b/include/dnsjit/input/zmmpcap.c
@@ -0,0 +1,677 @@
+/*
+ * Copyright (c) 2018-2024 OARC, Inc.
+ * All rights reserved.
+ *
+ * This file is part of dnsjit.
+ *
+ * dnsjit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * dnsjit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "input/zmmpcap.h"
+#include "core/assert.h"
+#include "core/object/pcap.h"
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#else
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#endif
+#endif
+#endif
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifndef bswap_16
+#ifndef bswap16
+#define bswap_16(x) swap16(x)
+#define bswap_32(x) swap32(x)
+#define bswap_64(x) swap64(x)
+#else
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+#endif
+#endif
+#include <pcap/pcap.h>
+
+#ifdef HAVE_LZ4
+#include <lz4frame.h>
+struct _lz4_ctx {
+ LZ4F_dctx* ctx;
+ LZ4F_decompressOptions_t opts;
+};
+#define lz4 ((struct _lz4_ctx*)self->comp_ctx)
+#endif
+
+#ifdef HAVE_ZSTD
+#include <zstd.h>
+struct _zstd_ctx {
+ ZSTD_DCtx* ctx;
+ ZSTD_inBuffer in;
+ ZSTD_outBuffer out;
+};
+#define zstd ((struct _zstd_ctx*)self->comp_ctx)
+#endif
+
+#include <zlib.h>
+struct _gzip_ctx {
+ z_stream strm;
+};
+#define gzip ((struct _gzip_ctx*)self->comp_ctx)
+
+#ifdef HAVE_LZMA
+#include <lzma.h>
+struct _lzma_ctx {
+ lzma_stream strm;
+};
+static lzma_stream lzma_stream_init = LZMA_STREAM_INIT;
+#define lzma ((struct _lzma_ctx*)self->comp_ctx)
+#endif
+
+static core_log_t _log = LOG_T_INIT("input.zmmpcap");
+static input_zmmpcap_t _defaults = {
+ LOG_T_INIT_OBJ("input.zmmpcap"),
+ 0, 0,
+ 0, 0, 0,
+ CORE_OBJECT_PCAP_INIT(0),
+ input_zmmpcap_type_none, 0,
+ 0, 0, 0, 0,
+ -1, 0, 0, 0, MAP_FAILED,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0
+};
+
+core_log_t* input_zmmpcap_log()
+{
+ return &_log;
+}
+
+void input_zmmpcap_init(input_zmmpcap_t* self)
+{
+ mlassert_self();
+
+ *self = _defaults;
+}
+
+void input_zmmpcap_destroy(input_zmmpcap_t* self)
+{
+ mlassert_self();
+
+ free(self->out);
+
+ switch (self->compression) {
+#ifdef HAVE_LZ4
+ case input_zmmpcap_type_lz4: {
+ LZ4F_errorCode_t code;
+
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
+ }
+ free(lz4);
+ break;
+ }
+#endif
+#ifdef HAVE_ZSTD
+ case input_zmmpcap_type_zstd:
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
+ }
+ free(zstd);
+ break;
+#endif
+ case input_zmmpcap_type_gzip:
+ if (gzip) {
+ inflateEnd(&gzip->strm);
+ }
+ free(gzip);
+ break;
+#ifdef HAVE_LZMA
+ case input_zmmpcap_type_lzma:
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ break;
+#endif
+ default:
+ break;
+ }
+
+ if (self->map != MAP_FAILED) {
+ munmap(self->map, self->len);
+ }
+ if (self->fd > -1) {
+ close(self->fd);
+ }
+ free(self->buf);
+}
+
+static ssize_t _read(input_zmmpcap_t* self, void* dst, size_t len, void** dstp)
+{
+ switch (self->compression) {
+#ifdef HAVE_LZ4
+ case input_zmmpcap_type_lz4: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (self->at >= self->len) {
+ return 0;
+ }
+
+ size_t dst_size = self->out_size, src_size = self->len - self->at;
+ size_t code = LZ4F_decompress(lz4->ctx, self->out, &dst_size, &self->map[self->at], &src_size, &lz4->opts);
+ if (LZ4F_isError(code)) {
+ lfatal("LZ4F_decompress() failed: %s", LZ4F_getErrorName(code));
+ }
+
+ self->at += src_size;
+ self->out_at = 0;
+ self->out_have = dst_size;
+ }
+ }
+#endif
+#ifdef HAVE_ZSTD
+ case input_zmmpcap_type_zstd: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (zstd->in.pos >= zstd->in.size) {
+ return 0;
+ }
+
+ zstd->out.size = self->out_size;
+ zstd->out.pos = 0;
+ size_t code = ZSTD_decompressStream(zstd->ctx, &zstd->out, &zstd->in);
+ if (ZSTD_isError(code)) {
+ lfatal("ZSTD_decompressStream() failed: %s", ZSTD_getErrorName(code));
+ }
+
+ self->out_have = zstd->out.pos;
+ self->out_at = 0;
+ }
+ }
+#endif
+ case input_zmmpcap_type_gzip: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (gzip->strm.avail_in <= 0) {
+ return 0;
+ }
+
+ gzip->strm.next_out = self->out;
+ gzip->strm.avail_out = self->out_size;
+
+ self->out_at = 0;
+ int ret = inflate(&gzip->strm, Z_NO_FLUSH);
+ if (ret != Z_OK) {
+ if (ret == Z_STREAM_END) {
+ self->out_have = self->out_size - gzip->strm.avail_out;
+ if (self->out_have > 0) {
+ continue;
+ }
+ return 0;
+ }
+ lfatal("inflate() failed: %d: %s", ret, gzip->strm.msg);
+ }
+
+ self->out_have = self->out_size - gzip->strm.avail_out;
+ }
+ }
+#ifdef HAVE_LZMA
+ case input_zmmpcap_type_lzma: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ lzma_action action = LZMA_RUN;
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (lzma->strm.avail_in <= 0) {
+ return 0;
+ }
+
+ lzma->strm.next_out = self->out;
+ lzma->strm.avail_out = self->out_size;
+
+ self->out_at = 0;
+ lzma_ret ret = lzma_code(&lzma->strm, action);
+ if (ret != LZMA_OK) {
+ if (ret == LZMA_STREAM_END) {
+ self->out_have = self->out_size - lzma->strm.avail_out;
+ if (self->out_have > 0) {
+ continue;
+ }
+ return 0;
+ }
+ lfatal("lzma_code() failed: %d", ret);
+ }
+
+ self->out_have = self->out_size - lzma->strm.avail_out;
+ }
+ }
+#endif
+ default:
+ return 0;
+ }
+}
+
+int input_zmmpcap_open(input_zmmpcap_t* self, const char* file)
+{
+ struct stat sb;
+ mlassert_self();
+ lassert(file, "file is nil");
+
+ if (self->fd != -1) {
+ lfatal("already opened");
+ }
+
+ if ((self->fd = open(file, O_RDONLY)) < 0) {
+ lcritical("open(%s) error %s", file, core_log_errstr(errno));
+ return -1;
+ }
+
+ if (fstat(self->fd, &sb)) {
+ lcritical("stat(%s) error %s", file, core_log_errstr(errno));
+ return -1;
+ }
+ self->len = sb.st_size;
+
+ if ((self->map = mmap(0, self->len, PROT_READ, MAP_PRIVATE, self->fd, 0)) == MAP_FAILED) {
+ lcritical("mmap(%s) error %s", file, core_log_errstr(errno));
+ return -1;
+ }
+
+ switch (self->compression) {
+#ifdef HAVE_LZ4
+ case input_zmmpcap_type_lz4: {
+ LZ4F_errorCode_t code;
+
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
+ }
+ free(lz4);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _lz4_ctx)));
+ if ((code = LZ4F_createDecompressionContext(&lz4->ctx, LZ4F_VERSION))) {
+ lfatal("LZ4F_createDecompressionContext() failed: %s", LZ4F_getErrorName(code));
+ }
+ lz4->opts.stableDst = 1;
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+ break;
+ }
+#endif
+#ifdef HAVE_ZSTD
+ case input_zmmpcap_type_zstd:
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
+ }
+ free(zstd);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _zstd_ctx)));
+ lfatal_oom(zstd->ctx = ZSTD_createDCtx());
+ self->out_size = ZSTD_DStreamOutSize();
+ lfatal_oom(self->out = malloc(self->out_size + 1));
+
+ zstd->in.src = self->map;
+ zstd->in.size = self->len;
+ zstd->out.dst = self->out;
+ zstd->out.size = self->out_size;
+ break;
+#endif
+ case input_zmmpcap_type_gzip: {
+ if (gzip) {
+ inflateEnd(&gzip->strm);
+ }
+ free(gzip);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _gzip_ctx)));
+ int ret = inflateInit2(&gzip->strm, 32);
+ if (ret != Z_OK) {
+ lcritical("inflateInit() error: %d", ret);
+ return -1;
+ }
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+
+ gzip->strm.next_in = self->map;
+ gzip->strm.avail_in = self->len;
+ break;
+ }
+#ifdef HAVE_LZMA
+ case input_zmmpcap_type_lzma: {
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _lzma_ctx)));
+ lzma->strm = lzma_stream_init;
+ lzma_ret ret = lzma_stream_decoder(&lzma->strm, UINT64_MAX, LZMA_CONCATENATED);
+ if (ret != LZMA_OK) {
+ lcritical("lzma_stream_decoder() error: %d", ret);
+ return -1;
+ }
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+
+ lzma->strm.next_in = self->map;
+ lzma->strm.avail_in = self->len;
+ break;
+ }
+#endif
+ default:
+ lcritical("no support for selected compression");
+ return -2;
+ }
+
+ if (_read(self, &self->magic_number, 4, 0) != 4
+ || _read(self, &self->version_major, 2, 0) != 2
+ || _read(self, &self->version_minor, 2, 0) != 2
+ || _read(self, &self->thiszone, 4, 0) != 4
+ || _read(self, &self->sigfigs, 4, 0) != 4
+ || _read(self, &self->snaplen, 4, 0) != 4
+ || _read(self, &self->network, 4, 0) != 4) {
+ lcritical("could not read full PCAP header");
+ return -2;
+ }
+ switch (self->magic_number) {
+ case 0x4d3cb2a1:
+ self->is_nanosec = 1;
+ case 0xd4c3b2a1:
+ self->is_swapped = 1;
+ self->version_major = bswap_16(self->version_major);
+ self->version_minor = bswap_16(self->version_minor);
+ self->thiszone = (int32_t)bswap_32((uint32_t)self->thiszone);
+ self->sigfigs = bswap_32(self->sigfigs);
+ self->snaplen = bswap_32(self->snaplen);
+ self->network = bswap_32(self->network);
+ break;
+ case 0xa1b2c3d4:
+ case 0xa1b23c4d:
+ break;
+ default:
+ lcritical("invalid PCAP header");
+ return -2;
+ }
+
+ if (self->version_major != 2 || self->version_minor != 4) {
+ lcritical("unsupported PCAP version v%u.%u", self->version_major, self->version_minor);
+ return -2;
+ }
+
+ /*
+ * Translation taken from https://github.com/the-tcpdump-group/libpcap/blob/90543970fd5fbed261d3637f5ec4811d7dde4e49/pcap-common.c#L1212 .
+ */
+ switch (self->network) {
+ case 101: /* LINKTYPE_RAW */
+ self->linktype = DLT_RAW;
+ break;
+#ifdef DLT_FR
+ case 107: /* LINKTYPE_FRELAY */
+ self->linktype = DLT_FR;
+ break;
+#endif
+ case 100: /* LINKTYPE_ATM_RFC1483 */
+ self->linktype = DLT_ATM_RFC1483;
+ break;
+ case 102: /* LINKTYPE_SLIP_BSDOS */
+ self->linktype = DLT_SLIP_BSDOS;
+ break;
+ case 103: /* LINKTYPE_PPP_BSDOS */
+ self->linktype = DLT_PPP_BSDOS;
+ break;
+ case 104: /* LINKTYPE_C_HDLC */
+ self->linktype = DLT_C_HDLC;
+ break;
+ case 106: /* LINKTYPE_ATM_CLIP */
+ self->linktype = DLT_ATM_CLIP;
+ break;
+ case 50: /* LINKTYPE_PPP_HDLC */
+ self->linktype = DLT_PPP_SERIAL;
+ break;
+ case 51: /* LINKTYPE_PPP_ETHER */
+ self->linktype = DLT_PPP_ETHER;
+ break;
+ default:
+ self->linktype = self->network;
+ }
+
+ free(self->buf);
+ lfatal_oom(self->buf = malloc(self->snaplen));
+ self->prod_pkt.snaplen = self->snaplen;
+ self->prod_pkt.linktype = self->linktype;
+ self->prod_pkt.is_swapped = self->is_swapped;
+
+ ldebug("pcap v%u.%u snaplen:%lu %s", self->version_major, self->version_minor, self->snaplen, self->is_swapped ? " swapped" : "");
+
+ return 0;
+}
+
+int input_zmmpcap_run(input_zmmpcap_t* self)
+{
+ struct {
+ uint32_t ts_sec;
+ uint32_t ts_usec;
+ uint32_t incl_len;
+ uint32_t orig_len;
+ } hdr;
+ int ret;
+ core_object_pcap_t pkt = CORE_OBJECT_PCAP_INIT(0);
+ mlassert_self();
+
+ if (self->map == MAP_FAILED) {
+ lfatal("no PCAP opened");
+ }
+ if (!self->recv) {
+ lfatal("no receiver set");
+ }
+
+ pkt.snaplen = self->snaplen;
+ pkt.linktype = self->linktype;
+ pkt.is_swapped = self->is_swapped;
+
+ while ((ret = _read(self, &hdr, 16, 0)) == 16) {
+ if (self->is_swapped) {
+ hdr.ts_sec = bswap_32(hdr.ts_sec);
+ hdr.ts_usec = bswap_32(hdr.ts_usec);
+ hdr.incl_len = bswap_32(hdr.incl_len);
+ hdr.orig_len = bswap_32(hdr.orig_len);
+ }
+ if (hdr.incl_len > self->snaplen) {
+ lwarning("invalid packet length, larger then snaplen");
+ return -1;
+ }
+ pkt.bytes = (unsigned char*)self->buf;
+ if (_read(self, self->buf, hdr.incl_len, (void**)&pkt.bytes) != hdr.incl_len) {
+ lwarning("could not read all of packet, aborting");
+ return -1;
+ }
+
+ self->pkts++;
+
+ pkt.ts.sec = hdr.ts_sec;
+ if (self->is_nanosec) {
+ pkt.ts.nsec = hdr.ts_usec;
+ } else {
+ pkt.ts.nsec = hdr.ts_usec * 1000;
+ }
+ pkt.caplen = hdr.incl_len;
+ pkt.len = hdr.orig_len;
+
+ self->recv(self->ctx, (core_object_t*)&pkt);
+ }
+ if (ret) {
+ lwarning("could not read next PCAP header, aborting");
+ return -1;
+ }
+
+ return 0;
+}
+
+static const core_object_t* _produce(input_zmmpcap_t* self)
+{
+ struct {
+ uint32_t ts_sec;
+ uint32_t ts_usec;
+ uint32_t incl_len;
+ uint32_t orig_len;
+ } hdr;
+ int ret;
+ mlassert_self();
+
+ if (self->is_broken) {
+ lwarning("PCAP is broken, will not read next packet");
+ return 0;
+ }
+
+ if ((ret = _read(self, &hdr, 16, 0)) != 16) {
+ if (ret) {
+ lwarning("could not read next PCAP header, aborting");
+ self->is_broken = 1;
+ }
+ return 0;
+ }
+
+ if (self->is_swapped) {
+ hdr.ts_sec = bswap_32(hdr.ts_sec);
+ hdr.ts_usec = bswap_32(hdr.ts_usec);
+ hdr.incl_len = bswap_32(hdr.incl_len);
+ hdr.orig_len = bswap_32(hdr.orig_len);
+ }
+ if (hdr.incl_len > self->snaplen) {
+ lwarning("invalid packet length, larger then snaplen");
+ self->is_broken = 1;
+ return 0;
+ }
+ self->prod_pkt.bytes = (unsigned char*)self->buf;
+ if (_read(self, self->buf, hdr.incl_len, (void**)&self->prod_pkt.bytes) != hdr.incl_len) {
+ lwarning("could not read all of packet, aborting");
+ self->is_broken = 1;
+ return 0;
+ }
+
+ self->pkts++;
+
+ self->prod_pkt.ts.sec = hdr.ts_sec;
+ if (self->is_nanosec) {
+ self->prod_pkt.ts.nsec = hdr.ts_usec;
+ } else {
+ self->prod_pkt.ts.nsec = hdr.ts_usec * 1000;
+ }
+ self->prod_pkt.caplen = hdr.incl_len;
+ self->prod_pkt.len = hdr.orig_len;
+
+ return (core_object_t*)&self->prod_pkt;
+}
+
+core_producer_t input_zmmpcap_producer(input_zmmpcap_t* self)
+{
+ mlassert_self();
+
+ if (self->map == MAP_FAILED) {
+ lfatal("no PCAP opened");
+ }
+
+ return (core_producer_t)_produce;
+}
diff --git a/include/dnsjit/input/zmmpcap.h b/include/dnsjit/input/zmmpcap.h
new file mode 100644
index 0000000..baea3f5
--- /dev/null
+++ b/include/dnsjit/input/zmmpcap.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2018-2024 OARC, Inc.
+ * All rights reserved.
+ *
+ * This file is part of dnsjit.
+ *
+ * dnsjit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * dnsjit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <dnsjit/core/log.h>
+#include <dnsjit/core/receiver.h>
+#include <dnsjit/core/producer.h>
+#include <dnsjit/core/object/pcap.h>
+
+#ifndef __dnsjit_input_zmmpcap_h
+#define __dnsjit_input_zmmpcap_h
+
+#include <dnsjit/input/zmmpcap.hh>
+
+#endif
diff --git a/include/dnsjit/input/zmmpcap.hh b/include/dnsjit/input/zmmpcap.hh
new file mode 100644
index 0000000..7e930cf
--- /dev/null
+++ b/include/dnsjit/input/zmmpcap.hh
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018-2024 OARC, Inc.
+ * All rights reserved.
+ *
+ * This file is part of dnsjit.
+ *
+ * dnsjit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * dnsjit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
+
+typedef enum input_zmmpcap_type {
+ input_zmmpcap_type_none,
+ input_zmmpcap_type_lz4,
+ input_zmmpcap_type_zstd,
+ input_zmmpcap_type_gzip,
+ input_zmmpcap_type_lzma
+} input_zmmpcap_type_t;
+
+typedef struct input_zmmpcap {
+ core_log_t _log;
+ core_receiver_t recv;
+ void* ctx;
+
+ uint8_t is_swapped;
+ uint8_t is_nanosec;
+ uint8_t is_broken;
+
+ core_object_pcap_t prod_pkt;
+
+ input_zmmpcap_type_t compression;
+ void* comp_ctx;
+
+ void* out;
+ size_t out_size;
+ size_t out_have;
+ size_t out_at;
+
+ int fd;
+ size_t len, at;
+ size_t pkts;
+ uint8_t *map, *buf;
+
+ uint32_t magic_number;
+ uint16_t version_major;
+ uint16_t version_minor;
+ int32_t thiszone;
+ uint32_t sigfigs;
+ uint32_t snaplen;
+ uint32_t network;
+
+ uint32_t linktype;
+} input_zmmpcap_t;
+
+core_log_t* input_zmmpcap_log();
+
+void input_zmmpcap_init(input_zmmpcap_t* self);
+void input_zmmpcap_destroy(input_zmmpcap_t* self);
+int input_zmmpcap_open(input_zmmpcap_t* self, const char* file);
+int input_zmmpcap_run(input_zmmpcap_t* self);
+int input_zmmpcap_have_support(input_zmmpcap_t* self);
+
+core_producer_t input_zmmpcap_producer(input_zmmpcap_t* self);
diff --git a/include/dnsjit/input/zmmpcap.lua b/include/dnsjit/input/zmmpcap.lua
new file mode 100644
index 0000000..7646869
--- /dev/null
+++ b/include/dnsjit/input/zmmpcap.lua
@@ -0,0 +1,149 @@
+-- Copyright (c) 2018-2024 OARC, Inc.
+-- All rights reserved.
+--
+-- This file is part of dnsjit.
+--
+-- dnsjit is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- dnsjit is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+
+-- dnsjit.input.zmmpcap
+-- Read input from a PCAP file using mmap()
+-- local input = require("dnsjit.input.zmmpcap").new()
+-- input:zstd()
+-- input:open("file.pcap.zst")
+-- input:receiver(filter_or_output)
+-- input:run()
+--
+-- Read input from a PCAP file by mapping the whole file to memory using
+-- .B mmap()
+-- and parse the PCAP without libpcap.
+-- After opening a file and reading the PCAP header, the attributes are
+-- populated.
+-- .SS Attributes
+-- .TP
+-- is_swapped
+-- Indicate if the byte order in the PCAP is in reverse order of the host.
+-- .TP
+-- is_nanosec
+-- Indicate if the time stamps are in nanoseconds or not.
+-- .TP
+-- magic_number
+-- Magic number.
+-- .TP
+-- version_major
+-- Major version number.
+-- .TP
+-- version_minor
+-- Minor version number.
+-- .TP
+-- thiszone
+-- GMT to local correction.
+-- .TP
+-- sigfigs
+-- Accuracy of timestamps.
+-- .TP
+-- snaplen
+-- Max length of captured packets, in octets.
+-- .TP
+-- network
+-- The link type found in the PCAP header, see https://www.tcpdump.org/linktypes.html .
+-- .TP
+-- linktype
+-- The data link type, mapped from
+-- .IR network .
+module(...,package.seeall)
+
+require("dnsjit.input.zmmpcap_h")
+local ffi = require("ffi")
+local C = ffi.C
+
+local t_name = "input_zmmpcap_t"
+local input_zmmpcap_t = ffi.typeof(t_name)
+local Zmmpcap = {}
+
+-- Create a new Zmmpcap input.
+function Zmmpcap.new()
+ local self = {
+ _receiver = nil,
+ obj = input_zmmpcap_t(),
+ }
+ C.input_zmmpcap_init(self.obj)
+ ffi.gc(self.obj, C.input_zmmpcap_destroy)
+ return setmetatable(self, { __index = Zmmpcap })
+end
+
+-- Return the Log object to control logging of this instance or module.
+function Zmmpcap:log()
+ if self == nil then
+ return C.input_zmmpcap_log()
+ end
+ return self.obj._log
+end
+
+-- Set the receiver to pass objects to.
+function Zmmpcap:receiver(o)
+ self.obj.recv, self.obj.ctx = o:receive()
+ self._receiver = o
+end
+
+-- Return the C functions and context for producing objects.
+function Zmmpcap:produce()
+ return C.input_zmmpcap_producer(self.obj), self.obj
+end
+
+-- Use liblz4 to decompress the input file/data.
+function Zmmpcap:lz4()
+ self.obj.compression = "input_zmmpcap_type_lz4"
+end
+
+-- Use libzstd to decompress the input file/data.
+function Zmmpcap:zstd()
+ self.obj.compression = "input_zmmpcap_type_zstd"
+end
+
+-- Use zlib/gzip to decompress the input file/data.
+function Zmmpcap:gzip()
+ self.obj.compression = "input_zmmpcap_type_gzip"
+end
+
+-- Use liblzma/xz to decompress the input file/data.
+function Zmmpcap:lzma()
+ self.obj.compression = "input_zmmpcap_type_lzma"
+end
+
+-- Return true if support for selected compression library is built in.
+function Zmmpcap:have_support()
+ if C.input_zmmpcap_have_support(self.obj) == 1 then
+ return true
+ end
+ return false
+end
+
+-- Open a PCAP file for processing and read the PCAP header.
+-- Returns 0 on success.
+function Zmmpcap:open(file)
+ return C.input_zmmpcap_open(self.obj, file)
+end
+
+-- Start processing packets and send each packet read to the receiver.
+-- Returns 0 if all packets was read successfully.
+function Zmmpcap:run()
+ return C.input_zmmpcap_run(self.obj)
+end
+
+-- Return the number of packets seen.
+function Zmmpcap:packets()
+ return tonumber(self.obj.pkts)
+end
+
+return Zmmpcap
diff --git a/include/dnsjit/input/zpcap.c b/include/dnsjit/input/zpcap.c
index d62714c..dfeb89b 100644
--- a/include/dnsjit/input/zpcap.c
+++ b/include/dnsjit/input/zpcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -53,6 +53,7 @@
#endif
#include <pcap/pcap.h>
#include <string.h>
+#include <unistd.h>
#ifdef HAVE_LZ4
#include <lz4frame.h>
@@ -62,6 +63,7 @@ struct _lz4_ctx {
};
#define lz4 ((struct _lz4_ctx*)self->comp_ctx)
#endif
+
#ifdef HAVE_ZSTD
#include <zstd.h>
struct _zstd_ctx {
@@ -72,6 +74,21 @@ struct _zstd_ctx {
#define zstd ((struct _zstd_ctx*)self->comp_ctx)
#endif
+#include <zlib.h>
+struct _gzip_ctx {
+ gzFile fp;
+};
+#define gzip ((struct _gzip_ctx*)self->comp_ctx)
+
+#ifdef HAVE_LZMA
+#include <lzma.h>
+struct _lzma_ctx {
+ lzma_stream strm;
+};
+static lzma_stream lzma_stream_init = LZMA_STREAM_INIT;
+#define lzma ((struct _lzma_ctx*)self->comp_ctx)
+#endif
+
#define MAX_SNAPLEN 0x40000
static core_log_t _log = LOG_T_INIT("input.zpcap");
@@ -108,10 +125,8 @@ void input_zpcap_destroy(input_zpcap_t* self)
case input_zpcap_type_lz4: {
LZ4F_errorCode_t code;
- if (lz4) {
- if (lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
- lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
- }
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
}
free(lz4);
free(self->in);
@@ -121,16 +136,29 @@ void input_zpcap_destroy(input_zpcap_t* self)
#endif
#ifdef HAVE_ZSTD
case input_zpcap_type_zstd:
- if (zstd) {
- if (zstd->ctx) {
- ZSTD_freeDCtx(zstd->ctx);
- }
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
}
free(zstd);
free(self->in);
free(self->out);
break;
#endif
+ case input_zpcap_type_gzip:
+ if (gzip && gzip->fp) {
+ gzclose(gzip->fp);
+ }
+ free(gzip);
+ break;
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma:
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ free(self->out);
+ break;
+#endif
default:
break;
}
@@ -148,7 +176,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
case input_zpcap_type_lz4: {
size_t need = len;
- if (dstp && self->out_have > need) {
+ if (dstp && self->out_have >= need) {
*dstp = self->out + self->out_at;
self->out_have -= need;
self->out_at += need;
@@ -156,7 +184,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
}
for (;;) {
- if (self->out_have > need) {
+ if (self->out_have >= need) {
memcpy(dst, self->out + self->out_at, need);
self->out_have -= need;
self->out_at += need;
@@ -201,7 +229,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
case input_zpcap_type_zstd: {
size_t need = len;
- if (dstp && self->out_have > need) {
+ if (dstp && self->out_have >= need) {
*dstp = self->out + self->out_at;
self->out_have -= need;
self->out_at += need;
@@ -209,7 +237,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
}
for (;;) {
- if (self->out_have > need) {
+ if (self->out_have >= need) {
memcpy(dst, self->out + self->out_at, need);
self->out_have -= need;
self->out_at += need;
@@ -241,6 +269,59 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
}
}
#endif
+ case input_zpcap_type_gzip:
+ return gzfread(dst, 1, len, gzip->fp);
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ lzma_action action = LZMA_RUN;
+ uint8_t inbuf[BUFSIZ];
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ ssize_t n = fread(inbuf, 1, sizeof(inbuf), self->file);
+ if (n < 0) {
+ return n;
+ }
+ if (!n) {
+ action = LZMA_FINISH;
+ }
+
+ lzma->strm.next_in = inbuf;
+ lzma->strm.avail_in = n;
+ lzma->strm.next_out = self->out;
+ lzma->strm.avail_out = self->out_size;
+
+ lzma_ret ret = lzma_code(&lzma->strm, action);
+ if (ret != LZMA_OK) {
+ if (ret == LZMA_STREAM_END) {
+ return 0;
+ }
+ lfatal("lzma_code() failed: %d", ret);
+ }
+
+ self->out_at = 0;
+ self->out_have = self->out_size - lzma->strm.avail_out;
+ }
+ }
+#endif
default:
return 0;
}
@@ -265,10 +346,8 @@ static int _open(input_zpcap_t* self)
case input_zpcap_type_lz4: {
LZ4F_errorCode_t code;
- if (lz4) {
- if (lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
- lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
- }
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
}
free(lz4);
free(self->in);
@@ -290,10 +369,8 @@ static int _open(input_zpcap_t* self)
#endif
#ifdef HAVE_ZSTD
case input_zpcap_type_zstd:
- if (zstd) {
- if (zstd->ctx) {
- ZSTD_freeDCtx(zstd->ctx);
- }
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
}
free(zstd);
free(self->in);
@@ -311,6 +388,39 @@ static int _open(input_zpcap_t* self)
zstd->out.size = self->out_size;
break;
#endif
+ case input_zpcap_type_gzip:
+ free(gzip);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _gzip_ctx)));
+
+ int fd = dup(fileno((FILE*)self->file));
+ if (!(gzip->fp = gzdopen(fd, "rb"))) {
+ lcritical("gzdopen(%d) error: %s", fd, core_log_errstr(errno));
+ close(fd);
+ return -1;
+ }
+ break;
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma:
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _lzma_ctx)));
+ lzma->strm = lzma_stream_init;
+ lzma_ret ret = lzma_stream_decoder(&lzma->strm, UINT64_MAX, LZMA_CONCATENATED);
+ if (ret != LZMA_OK) {
+ lcritical("lzma_stream_decoder() error: %d", ret);
+ return -1;
+ }
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+
+ break;
+#endif
default:
lcritical("no support for selected compression");
return -2;
@@ -393,6 +503,7 @@ static int _open(input_zpcap_t* self)
self->linktype = self->network;
}
+ free(self->buf);
lfatal_oom(self->buf = malloc(self->snaplen));
self->prod_pkt.snaplen = self->snaplen;
self->prod_pkt.linktype = self->linktype;
@@ -508,6 +619,12 @@ int input_zpcap_have_support(input_zpcap_t* self)
case input_zpcap_type_zstd:
return 1;
#endif
+ case input_zpcap_type_gzip:
+ return 1;
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma:
+ return 1;
+#endif
default:
break;
}
diff --git a/include/dnsjit/input/zpcap.h b/include/dnsjit/input/zpcap.h
index 275c623..cab85bb 100644
--- a/include/dnsjit/input/zpcap.h
+++ b/include/dnsjit/input/zpcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/input/zpcap.hh b/include/dnsjit/input/zpcap.hh
index b683306..596fc2b 100644
--- a/include/dnsjit/input/zpcap.hh
+++ b/include/dnsjit/input/zpcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,15 +18,17 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef enum input_zpcap_type {
input_zpcap_type_none,
input_zpcap_type_lz4,
- input_zpcap_type_zstd
+ input_zpcap_type_zstd,
+ input_zpcap_type_gzip,
+ input_zpcap_type_lzma
} input_zpcap_type_t;
typedef struct input_zpcap {
diff --git a/include/dnsjit/input/zpcap.lua b/include/dnsjit/input/zpcap.lua
index 93b730b..5f2869c 100644
--- a/include/dnsjit/input/zpcap.lua
+++ b/include/dnsjit/input/zpcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
@@ -119,6 +119,16 @@ function Zpcap:zstd()
self.obj.compression = "input_zpcap_type_zstd"
end
+-- Use zlib/gzip to decompress the input file/data.
+function Zpcap:gzip()
+ self.obj.compression = "input_zpcap_type_gzip"
+end
+
+-- Use liblzma/xz to decompress the input file/data.
+function Zpcap:lzma()
+ self.obj.compression = "input_zpcap_type_lzma"
+end
+
-- Return true if support for selected compression library is built in.
function Zpcap:have_support()
if C.input_zpcap_have_support(self.obj) == 1 then
diff --git a/include/dnsjit/lib.lua b/include/dnsjit/lib.lua
index 6741eb3..c3c7c84 100644
--- a/include/dnsjit/lib.lua
+++ b/include/dnsjit/lib.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/lib/clock.c b/include/dnsjit/lib/clock.c
index a5889ef..9e1c2a3 100644
--- a/include/dnsjit/lib/clock.c
+++ b/include/dnsjit/lib/clock.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/lib/clock.h b/include/dnsjit/lib/clock.h
index b00d4fe..45120d9 100644
--- a/include/dnsjit/lib/clock.h
+++ b/include/dnsjit/lib/clock.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/lib/clock.hh b/include/dnsjit/lib/clock.hh
index f69a1bc..77e1308 100644
--- a/include/dnsjit/lib/clock.hh
+++ b/include/dnsjit/lib/clock.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.timespec_h")
typedef enum lib_clock_clkid {
LIB_CLOCK_REALTIME,
diff --git a/include/dnsjit/lib/clock.lua b/include/dnsjit/lib/clock.lua
index cdad30e..74c1857 100644
--- a/include/dnsjit/lib/clock.lua
+++ b/include/dnsjit/lib/clock.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/lib/getopt.lua b/include/dnsjit/lib/getopt.lua
index 416a658..0622dda 100644
--- a/include/dnsjit/lib/getopt.lua
+++ b/include/dnsjit/lib/getopt.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/lib/ip.lua b/include/dnsjit/lib/ip.lua
index 48b69e5..839af9b 100644
--- a/include/dnsjit/lib/ip.lua
+++ b/include/dnsjit/lib/ip.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/lib/parseconf.lua b/include/dnsjit/lib/parseconf.lua
index 374e9aa..45e04ca 100644
--- a/include/dnsjit/lib/parseconf.lua
+++ b/include/dnsjit/lib/parseconf.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/lib/trie.c b/include/dnsjit/lib/trie.c
index 158c5ca..7a39a7d 100644
--- a/include/dnsjit/lib/trie.c
+++ b/include/dnsjit/lib/trie.c
@@ -39,17 +39,17 @@ enum knot_error {
&& __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
/*!
- * \brief Use a pointer alignment hack to save memory.
- *
- * When on, isbranch() relies on the fact that in leaf_t the first pointer
- * is aligned on multiple of 4 bytes and that the flags bitfield is
- * overlaid over the lowest two bits of that pointer.
- * Neither is really guaranteed by the C standards; the second part should
- * be OK with x86_64 ABI and most likely any other little-endian platform.
- * It would be possible to manipulate the right bits portably, but it would
- * complicate the code nontrivially. C++ doesn't even guarantee type-punning.
- * In debug mode we check this works OK when creating a new trie instance.
- */
+ * \brief Use a pointer alignment hack to save memory.
+ *
+ * When on, isbranch() relies on the fact that in leaf_t the first pointer
+ * is aligned on multiple of 4 bytes and that the flags bitfield is
+ * overlaid over the lowest two bits of that pointer.
+ * Neither is really guaranteed by the C standards; the second part should
+ * be OK with x86_64 ABI and most likely any other little-endian platform.
+ * It would be possible to manipulate the right bits portably, but it would
+ * complicate the code nontrivially. C++ doesn't even guarantee type-punning.
+ * In debug mode we check this works OK when creating a new trie instance.
+ */
#define FLAGS_HACK 1
#else
#define FLAGS_HACK 0
@@ -490,6 +490,10 @@ static int ns_longer_alloc(nstack_t* ns)
memcpy(st, ns->stack, ns->len * sizeof(node_t*));
} else {
st = realloc(ns->stack, new_size);
+ if (st == NULL) {
+ free(ns->stack); // left behind by realloc, callers bail out
+ ns->stack = NULL;
+ }
}
if (st == NULL)
return KNOT_ENOMEM;
@@ -732,8 +736,8 @@ int trie_get_leq(trie_t* tbl, const uint8_t* key, uint32_t len, trie_val_t** val
// but try the previous child if key was less (it may not exist)
bitmap_t b = twigbit(t, key, len);
int i = hastwig(t, b)
- ? twigoff(t, b) - (un_key < un_leaf)
- : twigoff(t, b) - 1 /*twigoff returns successor when !hastwig*/;
+ ? twigoff(t, b) - (un_key < un_leaf)
+ : twigoff(t, b) - 1 /*twigoff returns successor when !hastwig*/;
if (i >= 0) {
ERR_RETURN(ns_longer(ns));
ns->stack[ns->len++] = twig(t, i);
diff --git a/include/dnsjit/output.lua b/include/dnsjit/output.lua
index a565c2c..de21a96 100644
--- a/include/dnsjit/output.lua
+++ b/include/dnsjit/output.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/dnscli.c b/include/dnsjit/output/dnscli.c
index d7e0a14..ad25b1c 100644
--- a/include/dnsjit/output/dnscli.c
+++ b/include/dnsjit/output/dnscli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -212,7 +212,7 @@ int output_dnscli_connect(output_dnscli_t* self, const char* host, const char* p
}
if (self->timeout.sec > 0 || self->timeout.nsec > 0) {
self->poll.fd = self->fd;
- self->poll_timeout = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); //NOSONAR
+ self->poll_timeout = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); // NOSONAR
if (!self->poll_timeout) {
self->poll_timeout = 1;
}
diff --git a/include/dnsjit/output/dnscli.h b/include/dnsjit/output/dnscli.h
index 4026558..1cf352e 100644
--- a/include/dnsjit/output/dnscli.h
+++ b/include/dnsjit/output/dnscli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/dnscli.hh b/include/dnsjit/output/dnscli.hh
index bf579df..f86bccc 100644
--- a/include/dnsjit/output/dnscli.hh
+++ b/include/dnsjit/output/dnscli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,12 +18,12 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef enum output_dnscli_mode {
OUTPUT_DNSCLI_MODE_NONE = 0,
diff --git a/include/dnsjit/output/dnscli.lua b/include/dnsjit/output/dnscli.lua
index e19a2f4..7b308c0 100644
--- a/include/dnsjit/output/dnscli.lua
+++ b/include/dnsjit/output/dnscli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/null.lua b/include/dnsjit/output/null.lua
index 07e84a6..4c5c1e0 100644
--- a/include/dnsjit/output/null.lua
+++ b/include/dnsjit/output/null.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/pcap.c b/include/dnsjit/output/pcap.c
index 749a36b..3ac6a70 100644
--- a/include/dnsjit/output/pcap.c
+++ b/include/dnsjit/output/pcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/pcap.h b/include/dnsjit/output/pcap.h
index e40c8ca..b326e48 100644
--- a/include/dnsjit/output/pcap.h
+++ b/include/dnsjit/output/pcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/pcap.hh b/include/dnsjit/output/pcap.hh
index aecf3bd..43e0fb7 100644
--- a/include/dnsjit/output/pcap.hh
+++ b/include/dnsjit/output/pcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -22,9 +22,9 @@
typedef struct pcap_dumper {} pcap_dumper_t;
#endif
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.input.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.input.pcap_h")
typedef struct output_pcap {
core_log_t _log;
diff --git a/include/dnsjit/output/pcap.lua b/include/dnsjit/output/pcap.lua
index 7b9a56a..3c62bb2 100644
--- a/include/dnsjit/output/pcap.lua
+++ b/include/dnsjit/output/pcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/respdiff.c b/include/dnsjit/output/respdiff.c
index 7a2927a..b245e67 100644
--- a/include/dnsjit/output/respdiff.c
+++ b/include/dnsjit/output/respdiff.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/respdiff.h b/include/dnsjit/output/respdiff.h
index 881cfe4..2d9fee5 100644
--- a/include/dnsjit/output/respdiff.h
+++ b/include/dnsjit/output/respdiff.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/respdiff.hh b/include/dnsjit/output/respdiff.hh
index 4cdd22e..6edda6e 100644
--- a/include/dnsjit/output/respdiff.hh
+++ b/include/dnsjit/output/respdiff.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct output_respdiff {
core_log_t _log;
diff --git a/include/dnsjit/output/respdiff.lua b/include/dnsjit/output/respdiff.lua
index 5364853..78831ff 100644
--- a/include/dnsjit/output/respdiff.lua
+++ b/include/dnsjit/output/respdiff.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/tcpcli.c b/include/dnsjit/output/tcpcli.c
index df1a73c..9d76a03 100644
--- a/include/dnsjit/output/tcpcli.c
+++ b/include/dnsjit/output/tcpcli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -270,7 +270,7 @@ static const core_object_t* _produce(output_tcpcli_t* self)
p.fd = self->fd;
p.events = POLLIN;
p.revents = 0;
- to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); //NOSONAR
+ to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); // NOSONAR
if (!to) {
to = 1;
}
diff --git a/include/dnsjit/output/tcpcli.h b/include/dnsjit/output/tcpcli.h
index 9cd455c..a44018b 100644
--- a/include/dnsjit/output/tcpcli.h
+++ b/include/dnsjit/output/tcpcli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/tcpcli.hh b/include/dnsjit/output/tcpcli.hh
index a270c09..e538100 100644
--- a/include/dnsjit/output/tcpcli.hh
+++ b/include/dnsjit/output/tcpcli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,11 +18,11 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct output_tcpcli {
core_log_t _log;
diff --git a/include/dnsjit/output/tcpcli.lua b/include/dnsjit/output/tcpcli.lua
index 4f9108f..98bcfb5 100644
--- a/include/dnsjit/output/tcpcli.lua
+++ b/include/dnsjit/output/tcpcli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/tlscli.c b/include/dnsjit/output/tlscli.c
index cd1aac0..d9a85e7 100644
--- a/include/dnsjit/output/tlscli.c
+++ b/include/dnsjit/output/tlscli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/tlscli.h b/include/dnsjit/output/tlscli.h
index 3eae045..83d2449 100644
--- a/include/dnsjit/output/tlscli.h
+++ b/include/dnsjit/output/tlscli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/tlscli.hh b/include/dnsjit/output/tlscli.hh
index b0cbf38..355e9ae 100644
--- a/include/dnsjit/output/tlscli.hh
+++ b/include/dnsjit/output/tlscli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,12 +18,12 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct output_tlscli {
core_log_t _log;
diff --git a/include/dnsjit/output/tlscli.lua b/include/dnsjit/output/tlscli.lua
index b5ac762..ee7fbfe 100644
--- a/include/dnsjit/output/tlscli.lua
+++ b/include/dnsjit/output/tlscli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/output/udpcli.c b/include/dnsjit/output/udpcli.c
index ae89c84..85894cc 100644
--- a/include/dnsjit/output/udpcli.c
+++ b/include/dnsjit/output/udpcli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -242,7 +242,7 @@ static const core_object_t* _produce_block(output_udpcli_t* self)
p.fd = self->fd;
p.events = POLLIN;
p.revents = 0;
- to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); //NOSONAR
+ to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); // NOSONAR
if (!to) {
to = 1;
}
diff --git a/include/dnsjit/output/udpcli.h b/include/dnsjit/output/udpcli.h
index 4c8b594..0aec60f 100644
--- a/include/dnsjit/output/udpcli.h
+++ b/include/dnsjit/output/udpcli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/include/dnsjit/output/udpcli.hh b/include/dnsjit/output/udpcli.hh
index d74623d..c7cbf83 100644
--- a/include/dnsjit/output/udpcli.hh
+++ b/include/dnsjit/output/udpcli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,12 +18,12 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct output_udpcli {
core_log_t _log;
diff --git a/include/dnsjit/output/udpcli.lua b/include/dnsjit/output/udpcli.lua
index 4537d66..575f19d 100644
--- a/include/dnsjit/output/udpcli.lua
+++ b/include/dnsjit/output/udpcli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/include/dnsjit/test/Makefile.am b/include/dnsjit/test/Makefile.am
index 42189ca..a3f343f 100644
--- a/include/dnsjit/test/Makefile.am
+++ b/include/dnsjit/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -23,7 +23,8 @@ CLEANFILES = test*.log test*.trs test*.out \
TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \
test-trie.sh test-base64url.sh
-test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist
+test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist \
+ dns.pcap.xz-dist dns.pcap.gz-dist
test2.sh: dns.pcap-dist
@@ -46,7 +47,13 @@ test-trie.sh: pellets.pcap-dist dns.pcap-dist
.zst.zst-dist:
cp "$<" "$@"
+.xz.xz-dist:
+ cp "$<" "$@"
+
+.gz.gz-dist:
+ cp "$<" "$@"
+
EXTRA_DIST = $(TESTS) \
dns.pcap pellets.pcap test_ipsplit.lua test_trie.lua test_base64url.lua \
test1.gold test2.gold test3.gold test4.gold test_compressupport.lua \
- dns.pcap.lz4 dns.pcap.zst
+ dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz
diff --git a/include/dnsjit/test/Makefile.in b/include/dnsjit/test/Makefile.in
index 77f7f4d..713d49a 100644
--- a/include/dnsjit/test/Makefile.in
+++ b/include/dnsjit/test/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -471,6 +471,8 @@ libdir = @libdir@
libexecdir = @libexecdir@
liblz4_CFLAGS = @liblz4_CFLAGS@
liblz4_LIBS = @liblz4_LIBS@
+liblzma_CFLAGS = @liblzma_CFLAGS@
+liblzma_LIBS = @liblzma_LIBS@
libpcap_CFLAGS = @libpcap_CFLAGS@
libpcap_LIBS = @libpcap_LIBS@
libzstd_CFLAGS = @libzstd_CFLAGS@
@@ -505,12 +507,12 @@ TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \
EXTRA_DIST = $(TESTS) \
dns.pcap pellets.pcap test_ipsplit.lua test_trie.lua test_base64url.lua \
test1.gold test2.gold test3.gold test4.gold test_compressupport.lua \
- dns.pcap.lz4 dns.pcap.zst
+ dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz
all: all-am
.SUFFIXES:
-.SUFFIXES: .log .lz4 .lz4-dist .pcap .pcap-dist .test .test$(EXEEXT) .trs .zst .zst-dist
+.SUFFIXES: .gz .gz-dist .log .lz4 .lz4-dist .pcap .pcap-dist .test .test$(EXEEXT) .trs .xz .xz-dist .zst .zst-dist
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -926,7 +928,8 @@ uninstall-am:
.PRECIOUS: Makefile
-test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist
+test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist \
+ dns.pcap.xz-dist dns.pcap.gz-dist
test2.sh: dns.pcap-dist
@@ -949,6 +952,12 @@ test-trie.sh: pellets.pcap-dist dns.pcap-dist
.zst.zst-dist:
cp "$<" "$@"
+.xz.xz-dist:
+ cp "$<" "$@"
+
+.gz.gz-dist:
+ cp "$<" "$@"
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/include/dnsjit/test/dns.pcap.gz b/include/dnsjit/test/dns.pcap.gz
new file mode 100644
index 0000000..5ad94b4
--- /dev/null
+++ b/include/dnsjit/test/dns.pcap.gz
Binary files differ
diff --git a/include/dnsjit/test/dns.pcap.xz b/include/dnsjit/test/dns.pcap.xz
new file mode 100644
index 0000000..064f4a5
--- /dev/null
+++ b/include/dnsjit/test/dns.pcap.xz
Binary files differ
diff --git a/include/dnsjit/test/test1.sh b/include/dnsjit/test/test1.sh
index 4b403d5..400b92c 100755
--- a/include/dnsjit/test/test1.sh
+++ b/include/dnsjit/test/test1.sh
@@ -1,5 +1,5 @@
-#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+#!/bin/sh -ex
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -29,3 +29,28 @@ if echo "$support"|grep -q zstd; then
../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.zst-dist zstd >test1.out
diff "$srcdir/test1.gold" test1.out
fi
+if echo "$support"|grep -q lzma; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.xz-dist xz >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q gzip; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.gz-dist gz >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+
+if echo "$support"|grep -q lz4; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.lz4-dist lz4 mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q zstd; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.zst-dist zstd mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q lzma; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.xz-dist xz mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q gzip; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.gz-dist gz mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
diff --git a/include/dnsjit/test/test2.sh b/include/dnsjit/test/test2.sh
index bc5e502..40c0928 100755
--- a/include/dnsjit/test/test2.sh
+++ b/include/dnsjit/test/test2.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/include/dnsjit/test/test3.sh b/include/dnsjit/test/test3.sh
index 5a0af46..e8e6a71 100755
--- a/include/dnsjit/test/test3.sh
+++ b/include/dnsjit/test/test3.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/include/dnsjit/test/test4.sh b/include/dnsjit/test/test4.sh
index 2c21a75..b72c781 100755
--- a/include/dnsjit/test/test4.sh
+++ b/include/dnsjit/test/test4.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/include/dnsjit/test/test6.sh b/include/dnsjit/test/test6.sh
index b83b193..23c3575 100755
--- a/include/dnsjit/test/test6.sh
+++ b/include/dnsjit/test/test6.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/include/dnsjit/test/test_compressupport.lua b/include/dnsjit/test/test_compressupport.lua
index 9d4502e..b7818d8 100644
--- a/include/dnsjit/test/test_compressupport.lua
+++ b/include/dnsjit/test/test_compressupport.lua
@@ -8,3 +8,11 @@ zpcap:zstd()
if zpcap:have_support() then
print("zstd")
end
+zpcap:lzma()
+if zpcap:have_support() then
+ print("lzma")
+end
+zpcap:gzip()
+if zpcap:have_support() then
+ print("gzip")
+end
diff --git a/include/dnsjit/version.h b/include/dnsjit/version.h
index 94a09d3..94fffa0 100644
--- a/include/dnsjit/version.h
+++ b/include/dnsjit/version.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -22,7 +22,7 @@
#define __dnsjit_version_h
#define DNSJIT_MAJOR_VERSION 1
-#define DNSJIT_MINOR_VERSION 3
+#define DNSJIT_MINOR_VERSION 4
#define DNSJIT_PATCH_VERSION 0
#endif
diff --git a/m4/dl.sh b/m4/dl.sh
index 4989220..5577b79 100755
--- a/m4/dl.sh
+++ b/m4/dl.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/src/Makefile.am b/src/Makefile.am
index 0f088af..90fd511 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -29,7 +29,8 @@ AM_CFLAGS = -Werror=attributes \
$(PTHREAD_CFLAGS) \
$(luajit_CFLAGS) \
$(liblz4_CFLAGS) $(libzstd_CFLAGS) \
- $(libpcap_CFLAGS) $(gnutls_CFLAGS)
+ $(libpcap_CFLAGS) $(gnutls_CFLAGS) \
+ $(liblzma_CFLAGS)
EXTRA_DIST = gen-manpage.lua gen-compat.lua gen-errno.sh dnsjit.1in
@@ -44,19 +45,19 @@ nobase_dnsjitinclude_HEADERS = globals.h version.h
lua_hobjects = core/compat.luaho
lua_objects = core.luao lib.luao input.luao filter.luao output.luao
dnsjit_LDADD = $(PTHREAD_LIBS) $(luajit_LIBS) $(liblz4_LIBS) $(libzstd_LIBS) \
- $(libpcap_LIBS) $(gnutls_LIBS)
+ $(libpcap_LIBS) $(gnutls_LIBS) $(liblzma_LIBS)
# C source and headers
-dnsjit_SOURCES += core/channel.c core/compat.c core/file.c core/log.c core/object.c core/object/dns.c core/object/ether.c core/object/gre.c core/object/icmp6.c core/object/icmp.c core/object/ieee802.c core/object/ip6.c core/object/ip.c core/object/linuxsll.c core/object/loop.c core/object/null.c core/object/payload.c core/object/pcap.c core/object/tcp.c core/object/udp.c core/producer.c core/receiver.c core/thread.c filter/copy.c filter/ipsplit.c filter/layer.c filter/split.c filter/timing.c input/fpcap.c input/mmpcap.c input/pcap.c input/zpcap.c lib/base64url.c lib/clock.c lib/trie.c output/dnscli.c output/pcap.c output/respdiff.c output/tcpcli.c output/tlscli.c output/udpcli.c
-nobase_dnsjitinclude_HEADERS += core/assert.h core/channel.h core/compat.h core/file.h core/log.h core/object/dns.h core/object/ether.h core/object/gre.h core/object.h core/object/icmp6.h core/object/icmp.h core/object/ieee802.h core/object/ip6.h core/object/ip.h core/object/linuxsll.h core/object/loop.h core/object/null.h core/object/payload.h core/object/pcap.h core/object/tcp.h core/object/udp.h core/producer.h core/receiver.h core/thread.h core/timespec.h filter/copy.h filter/ipsplit.h filter/layer.h filter/split.h filter/timing.h input/fpcap.h input/mmpcap.h input/pcap.h input/zpcap.h lib/base64url.h lib/clock.h lib/trie.h output/dnscli.h output/pcap.h output/respdiff.h output/tcpcli.h output/tlscli.h output/udpcli.h
+dnsjit_SOURCES += core/channel.c core/compat.c core/file.c core/log.c core/object.c core/object/dns.c core/object/ether.c core/object/gre.c core/object/icmp6.c core/object/icmp.c core/object/ieee802.c core/object/ip6.c core/object/ip.c core/object/linuxsll.c core/object/loop.c core/object/null.c core/object/payload.c core/object/pcap.c core/object/tcp.c core/object/udp.c core/producer.c core/receiver.c core/thread.c filter/copy.c filter/ipsplit.c filter/layer.c filter/split.c filter/timing.c input/fpcap.c input/mmpcap.c input/pcap.c input/zmmpcap.c input/zpcap.c lib/base64url.c lib/clock.c lib/trie.c output/dnscli.c output/pcap.c output/respdiff.c output/tcpcli.c output/tlscli.c output/udpcli.c
+nobase_dnsjitinclude_HEADERS += core/assert.h core/channel.h core/compat.h core/file.h core/log.h core/object/dns.h core/object/ether.h core/object/gre.h core/object.h core/object/icmp6.h core/object/icmp.h core/object/ieee802.h core/object/ip6.h core/object/ip.h core/object/linuxsll.h core/object/loop.h core/object/null.h core/object/payload.h core/object/pcap.h core/object/tcp.h core/object/udp.h core/producer.h core/receiver.h core/thread.h core/timespec.h filter/copy.h filter/ipsplit.h filter/layer.h filter/split.h filter/timing.h input/fpcap.h input/mmpcap.h input/pcap.h input/zmmpcap.h input/zpcap.h lib/base64url.h lib/clock.h lib/trie.h output/dnscli.h output/pcap.h output/respdiff.h output/tcpcli.h output/tlscli.h output/udpcli.h
# Lua headers
-nobase_dnsjitinclude_HEADERS += core/channel.hh core/file.hh core/log.hh core/object/dns.hh core/object/ether.hh core/object/gre.hh core/object.hh core/object/icmp6.hh core/object/icmp.hh core/object/ieee802.hh core/object/ip6.hh core/object/ip.hh core/object/linuxsll.hh core/object/loop.hh core/object/null.hh core/object/payload.hh core/object/pcap.hh core/object/tcp.hh core/object/udp.hh core/producer.hh core/receiver.hh core/thread.hh core/timespec.hh filter/copy.hh filter/ipsplit.hh filter/layer.hh filter/split.hh filter/timing.hh input/fpcap.hh input/mmpcap.hh input/pcap.hh input/zpcap.hh lib/base64url.hh lib/clock.hh lib/trie.hh output/dnscli.hh output/pcap.hh output/respdiff.hh output/tcpcli.hh output/tlscli.hh output/udpcli.hh
-lua_hobjects += core/channel.luaho core/file.luaho core/log.luaho core/object/dns.luaho core/object/ether.luaho core/object/gre.luaho core/object/icmp6.luaho core/object/icmp.luaho core/object/ieee802.luaho core/object/ip6.luaho core/object/ip.luaho core/object/linuxsll.luaho core/object/loop.luaho core/object.luaho core/object/null.luaho core/object/payload.luaho core/object/pcap.luaho core/object/tcp.luaho core/object/udp.luaho core/producer.luaho core/receiver.luaho core/thread.luaho core/timespec.luaho filter/copy.luaho filter/ipsplit.luaho filter/layer.luaho filter/split.luaho filter/timing.luaho input/fpcap.luaho input/mmpcap.luaho input/pcap.luaho input/zpcap.luaho lib/base64url.luaho lib/clock.luaho lib/trie.luaho output/dnscli.luaho output/pcap.luaho output/respdiff.luaho output/tcpcli.luaho output/tlscli.luaho output/udpcli.luaho
+nobase_dnsjitinclude_HEADERS += core/channel.hh core/file.hh core/log.hh core/object/dns.hh core/object/ether.hh core/object/gre.hh core/object.hh core/object/icmp6.hh core/object/icmp.hh core/object/ieee802.hh core/object/ip6.hh core/object/ip.hh core/object/linuxsll.hh core/object/loop.hh core/object/null.hh core/object/payload.hh core/object/pcap.hh core/object/tcp.hh core/object/udp.hh core/producer.hh core/receiver.hh core/thread.hh core/timespec.hh filter/copy.hh filter/ipsplit.hh filter/layer.hh filter/split.hh filter/timing.hh input/fpcap.hh input/mmpcap.hh input/pcap.hh input/zmmpcap.hh input/zpcap.hh lib/base64url.hh lib/clock.hh lib/trie.hh output/dnscli.hh output/pcap.hh output/respdiff.hh output/tcpcli.hh output/tlscli.hh output/udpcli.hh
+lua_hobjects += core/channel.luaho core/file.luaho core/log.luaho core/object/dns.luaho core/object/ether.luaho core/object/gre.luaho core/object/icmp6.luaho core/object/icmp.luaho core/object/ieee802.luaho core/object/ip6.luaho core/object/ip.luaho core/object/linuxsll.luaho core/object/loop.luaho core/object.luaho core/object/null.luaho core/object/payload.luaho core/object/pcap.luaho core/object/tcp.luaho core/object/udp.luaho core/producer.luaho core/receiver.luaho core/thread.luaho core/timespec.luaho filter/copy.luaho filter/ipsplit.luaho filter/layer.luaho filter/split.luaho filter/timing.luaho input/fpcap.luaho input/mmpcap.luaho input/pcap.luaho input/zmmpcap.luaho input/zpcap.luaho lib/base64url.luaho lib/clock.luaho lib/trie.luaho output/dnscli.luaho output/pcap.luaho output/respdiff.luaho output/tcpcli.luaho output/tlscli.luaho output/udpcli.luaho
# Lua sources
-dist_dnsjit_SOURCES += core/channel.lua core/compat.lua core/file.lua core/loader.lua core/log.lua core/object/dns/label.lua core/object/dns.lua core/object/dns/q.lua core/object/dns/rr.lua core/object/ether.lua core/object/gre.lua core/object/icmp6.lua core/object/icmp.lua core/object/ieee802.lua core/object/ip6.lua core/object/ip.lua core/object/linuxsll.lua core/object/loop.lua core/object.lua core/object/null.lua core/object/payload.lua core/object/pcap.lua core/objects.lua core/object/tcp.lua core/object/udp.lua core/producer.lua core/receiver.lua core/thread.lua core/timespec.lua filter/copy.lua filter/ipsplit.lua filter/layer.lua filter/split.lua filter/timing.lua input/fpcap.lua input/mmpcap.lua input/pcap.lua input/zero.lua input/zpcap.lua lib/base64url.lua lib/clock.lua lib/getopt.lua lib/ip.lua lib/parseconf.lua lib/trie/iter.lua lib/trie.lua lib/trie/node.lua output/dnscli.lua output/null.lua output/pcap.lua output/respdiff.lua output/tcpcli.lua output/tlscli.lua output/udpcli.lua
-lua_objects += core/channel.luao core/compat.luao core/file.luao core/loader.luao core/log.luao core/object/dns/label.luao core/object/dns.luao core/object/dns/q.luao core/object/dns/rr.luao core/object/ether.luao core/object/gre.luao core/object/icmp6.luao core/object/icmp.luao core/object/ieee802.luao core/object/ip6.luao core/object/ip.luao core/object/linuxsll.luao core/object/loop.luao core/object.luao core/object/null.luao core/object/payload.luao core/object/pcap.luao core/objects.luao core/object/tcp.luao core/object/udp.luao core/producer.luao core/receiver.luao core/thread.luao core/timespec.luao filter/copy.luao filter/ipsplit.luao filter/layer.luao filter/split.luao filter/timing.luao input/fpcap.luao input/mmpcap.luao input/pcap.luao input/zero.luao input/zpcap.luao lib/base64url.luao lib/clock.luao lib/getopt.luao lib/ip.luao lib/parseconf.luao lib/trie/iter.luao lib/trie.luao lib/trie/node.luao output/dnscli.luao output/null.luao output/pcap.luao output/respdiff.luao output/tcpcli.luao output/tlscli.luao output/udpcli.luao
+dist_dnsjit_SOURCES += core/channel.lua core/compat.lua core/file.lua core/loader.lua core/log.lua core/object/dns/label.lua core/object/dns.lua core/object/dns/q.lua core/object/dns/rr.lua core/object/ether.lua core/object/gre.lua core/object/icmp6.lua core/object/icmp.lua core/object/ieee802.lua core/object/ip6.lua core/object/ip.lua core/object/linuxsll.lua core/object/loop.lua core/object.lua core/object/null.lua core/object/payload.lua core/object/pcap.lua core/objects.lua core/object/tcp.lua core/object/udp.lua core/producer.lua core/receiver.lua core/thread.lua core/timespec.lua filter/copy.lua filter/ipsplit.lua filter/layer.lua filter/split.lua filter/timing.lua input/fpcap.lua input/mmpcap.lua input/pcap.lua input/zero.lua input/zmmpcap.lua input/zpcap.lua lib/base64url.lua lib/clock.lua lib/getopt.lua lib/ip.lua lib/parseconf.lua lib/trie/iter.lua lib/trie.lua lib/trie/node.lua output/dnscli.lua output/null.lua output/pcap.lua output/respdiff.lua output/tcpcli.lua output/tlscli.lua output/udpcli.lua
+lua_objects += core/channel.luao core/compat.luao core/file.luao core/loader.luao core/log.luao core/object/dns/label.luao core/object/dns.luao core/object/dns/q.luao core/object/dns/rr.luao core/object/ether.luao core/object/gre.luao core/object/icmp6.luao core/object/icmp.luao core/object/ieee802.luao core/object/ip6.luao core/object/ip.luao core/object/linuxsll.luao core/object/loop.luao core/object.luao core/object/null.luao core/object/payload.luao core/object/pcap.luao core/objects.luao core/object/tcp.luao core/object/udp.luao core/producer.luao core/receiver.luao core/thread.luao core/timespec.luao filter/copy.luao filter/ipsplit.luao filter/layer.luao filter/split.luao filter/timing.luao input/fpcap.luao input/mmpcap.luao input/pcap.luao input/zero.luao input/zmmpcap.luao input/zpcap.luao lib/base64url.luao lib/clock.luao lib/getopt.luao lib/ip.luao lib/parseconf.luao lib/trie/iter.luao lib/trie.luao lib/trie/node.luao output/dnscli.luao output/null.luao output/pcap.luao output/respdiff.luao output/tcpcli.luao output/tlscli.luao output/udpcli.luao
dnsjit_LDFLAGS = -Wl,-E
dnsjit_LDADD += $(lua_hobjects) $(lua_objects)
@@ -66,7 +67,7 @@ man1_MANS = dnsjit.1
CLEANFILES += $(man1_MANS)
man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.3 dnsjit.output.3
-man3_MANS += dnsjit.core.channel.3 dnsjit.core.compat.3 dnsjit.core.file.3 dnsjit.core.loader.3 dnsjit.core.log.3 dnsjit.core.object.3 dnsjit.core.object.dns.3 dnsjit.core.object.dns.label.3 dnsjit.core.object.dns.q.3 dnsjit.core.object.dns.rr.3 dnsjit.core.object.ether.3 dnsjit.core.object.gre.3 dnsjit.core.object.icmp.3 dnsjit.core.object.icmp6.3 dnsjit.core.object.ieee802.3 dnsjit.core.object.ip.3 dnsjit.core.object.ip6.3 dnsjit.core.object.linuxsll.3 dnsjit.core.object.loop.3 dnsjit.core.object.null.3 dnsjit.core.object.payload.3 dnsjit.core.object.pcap.3 dnsjit.core.objects.3 dnsjit.core.object.tcp.3 dnsjit.core.object.udp.3 dnsjit.core.producer.3 dnsjit.core.receiver.3 dnsjit.core.thread.3 dnsjit.core.timespec.3 dnsjit.filter.copy.3 dnsjit.filter.ipsplit.3 dnsjit.filter.layer.3 dnsjit.filter.split.3 dnsjit.filter.timing.3 dnsjit.input.fpcap.3 dnsjit.input.mmpcap.3 dnsjit.input.pcap.3 dnsjit.input.zero.3 dnsjit.input.zpcap.3 dnsjit.lib.base64url.3 dnsjit.lib.clock.3 dnsjit.lib.getopt.3 dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 dnsjit.lib.trie.3 dnsjit.lib.trie.iter.3 dnsjit.lib.trie.node.3 dnsjit.output.dnscli.3 dnsjit.output.null.3 dnsjit.output.pcap.3 dnsjit.output.respdiff.3 dnsjit.output.tcpcli.3 dnsjit.output.tlscli.3 dnsjit.output.udpcli.3
+man3_MANS += dnsjit.core.channel.3 dnsjit.core.compat.3 dnsjit.core.file.3 dnsjit.core.loader.3 dnsjit.core.log.3 dnsjit.core.object.3 dnsjit.core.object.dns.3 dnsjit.core.object.dns.label.3 dnsjit.core.object.dns.q.3 dnsjit.core.object.dns.rr.3 dnsjit.core.object.ether.3 dnsjit.core.object.gre.3 dnsjit.core.object.icmp.3 dnsjit.core.object.icmp6.3 dnsjit.core.object.ieee802.3 dnsjit.core.object.ip.3 dnsjit.core.object.ip6.3 dnsjit.core.object.linuxsll.3 dnsjit.core.object.loop.3 dnsjit.core.object.null.3 dnsjit.core.object.payload.3 dnsjit.core.object.pcap.3 dnsjit.core.objects.3 dnsjit.core.object.tcp.3 dnsjit.core.object.udp.3 dnsjit.core.producer.3 dnsjit.core.receiver.3 dnsjit.core.thread.3 dnsjit.core.timespec.3 dnsjit.filter.copy.3 dnsjit.filter.ipsplit.3 dnsjit.filter.layer.3 dnsjit.filter.split.3 dnsjit.filter.timing.3 dnsjit.input.fpcap.3 dnsjit.input.mmpcap.3 dnsjit.input.pcap.3 dnsjit.input.zero.3 dnsjit.input.zmmpcap.3 dnsjit.input.zpcap.3 dnsjit.lib.base64url.3 dnsjit.lib.clock.3 dnsjit.lib.getopt.3 dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 dnsjit.lib.trie.3 dnsjit.lib.trie.iter.3 dnsjit.lib.trie.node.3 dnsjit.output.dnscli.3 dnsjit.output.null.3 dnsjit.output.pcap.3 dnsjit.output.respdiff.3 dnsjit.output.tcpcli.3 dnsjit.output.tlscli.3 dnsjit.output.udpcli.3
CLEANFILES += *.3in $(man3_MANS)
.lua.luao:
@@ -80,7 +81,7 @@ CLEANFILES += *.3in $(man3_MANS)
.hh.luah:
@mkdir -p `dirname "$@"`
@echo 'module(...,package.seeall);' > "$@"
- @cat "$<" | grep '^//lua:' | sed 's%^//lua:%%' >> "$@"
+ @cat "$<" | grep '^// *lua:' | sed 's%^// *lua:%%' >> "$@"
@echo 'require("ffi").cdef[[' >> "$@"
@cat "$<" | grep -v '^#' >> "$@"
@echo ']]' >> "$@"
@@ -240,6 +241,9 @@ dnsjit.input.pcap.3in: input/pcap.lua gen-manpage.lua
dnsjit.input.zero.3in: input/zero.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zero.lua" > "$@"
+dnsjit.input.zmmpcap.3in: input/zmmpcap.lua gen-manpage.lua
+ $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zmmpcap.lua" > "$@"
+
dnsjit.input.zpcap.3in: input/zpcap.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zpcap.lua" > "$@"
diff --git a/src/Makefile.in b/src/Makefile.in
index eb8523b..16dd15f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -150,18 +150,18 @@ am_dnsjit_OBJECTS = dnsjit.$(OBJEXT) globals.$(OBJEXT) \
filter/layer.$(OBJEXT) filter/split.$(OBJEXT) \
filter/timing.$(OBJEXT) input/fpcap.$(OBJEXT) \
input/mmpcap.$(OBJEXT) input/pcap.$(OBJEXT) \
- input/zpcap.$(OBJEXT) lib/base64url.$(OBJEXT) \
- lib/clock.$(OBJEXT) lib/trie.$(OBJEXT) output/dnscli.$(OBJEXT) \
- output/pcap.$(OBJEXT) output/respdiff.$(OBJEXT) \
- output/tcpcli.$(OBJEXT) output/tlscli.$(OBJEXT) \
- output/udpcli.$(OBJEXT)
+ input/zmmpcap.$(OBJEXT) input/zpcap.$(OBJEXT) \
+ lib/base64url.$(OBJEXT) lib/clock.$(OBJEXT) lib/trie.$(OBJEXT) \
+ output/dnscli.$(OBJEXT) output/pcap.$(OBJEXT) \
+ output/respdiff.$(OBJEXT) output/tcpcli.$(OBJEXT) \
+ output/tlscli.$(OBJEXT) output/udpcli.$(OBJEXT)
dist_dnsjit_OBJECTS =
dnsjit_OBJECTS = $(am_dnsjit_OBJECTS) $(dist_dnsjit_OBJECTS)
am__DEPENDENCIES_1 =
dnsjit_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(lua_hobjects) \
- $(lua_objects)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(lua_hobjects) $(lua_objects)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@@ -201,11 +201,12 @@ am__depfiles_remade = ./$(DEPDIR)/dnsjit.Po ./$(DEPDIR)/globals.Po \
filter/$(DEPDIR)/layer.Po filter/$(DEPDIR)/split.Po \
filter/$(DEPDIR)/timing.Po input/$(DEPDIR)/fpcap.Po \
input/$(DEPDIR)/mmpcap.Po input/$(DEPDIR)/pcap.Po \
- input/$(DEPDIR)/zpcap.Po lib/$(DEPDIR)/base64url.Po \
- lib/$(DEPDIR)/clock.Po lib/$(DEPDIR)/trie.Po \
- output/$(DEPDIR)/dnscli.Po output/$(DEPDIR)/pcap.Po \
- output/$(DEPDIR)/respdiff.Po output/$(DEPDIR)/tcpcli.Po \
- output/$(DEPDIR)/tlscli.Po output/$(DEPDIR)/udpcli.Po
+ input/$(DEPDIR)/zmmpcap.Po input/$(DEPDIR)/zpcap.Po \
+ lib/$(DEPDIR)/base64url.Po lib/$(DEPDIR)/clock.Po \
+ lib/$(DEPDIR)/trie.Po output/$(DEPDIR)/dnscli.Po \
+ output/$(DEPDIR)/pcap.Po output/$(DEPDIR)/respdiff.Po \
+ output/$(DEPDIR)/tcpcli.Po output/$(DEPDIR)/tlscli.Po \
+ output/$(DEPDIR)/udpcli.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -445,6 +446,8 @@ libdir = @libdir@
libexecdir = @libexecdir@
liblz4_CFLAGS = @liblz4_CFLAGS@
liblz4_LIBS = @liblz4_LIBS@
+liblzma_CFLAGS = @liblzma_CFLAGS@
+liblzma_LIBS = @liblzma_LIBS@
libpcap_CFLAGS = @libpcap_CFLAGS@
libpcap_LIBS = @libpcap_LIBS@
libzstd_CFLAGS = @libzstd_CFLAGS@
@@ -481,7 +484,8 @@ AM_CFLAGS = -Werror=attributes \
$(PTHREAD_CFLAGS) \
$(luajit_CFLAGS) \
$(liblz4_CFLAGS) $(libzstd_CFLAGS) \
- $(libpcap_CFLAGS) $(gnutls_CFLAGS)
+ $(libpcap_CFLAGS) $(gnutls_CFLAGS) \
+ $(liblzma_CFLAGS)
EXTRA_DIST = gen-manpage.lua gen-compat.lua gen-errno.sh dnsjit.1in
BUILT_SOURCES = core/compat.hh core/log_errstr.c
@@ -496,10 +500,10 @@ dnsjit_SOURCES = dnsjit.c globals.c core/channel.c core/compat.c \
core/object/tcp.c core/object/udp.c core/producer.c \
core/receiver.c core/thread.c filter/copy.c filter/ipsplit.c \
filter/layer.c filter/split.c filter/timing.c input/fpcap.c \
- input/mmpcap.c input/pcap.c input/zpcap.c lib/base64url.c \
- lib/clock.c lib/trie.c output/dnscli.c output/pcap.c \
- output/respdiff.c output/tcpcli.c output/tlscli.c \
- output/udpcli.c
+ input/mmpcap.c input/pcap.c input/zmmpcap.c input/zpcap.c \
+ lib/base64url.c lib/clock.c lib/trie.c output/dnscli.c \
+ output/pcap.c output/respdiff.c output/tcpcli.c \
+ output/tlscli.c output/udpcli.c
# Lua sources
dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.lua \
@@ -516,9 +520,9 @@ dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.lua \
core/thread.lua core/timespec.lua filter/copy.lua \
filter/ipsplit.lua filter/layer.lua filter/split.lua \
filter/timing.lua input/fpcap.lua input/mmpcap.lua \
- input/pcap.lua input/zero.lua input/zpcap.lua \
- lib/base64url.lua lib/clock.lua lib/getopt.lua lib/ip.lua \
- lib/parseconf.lua lib/trie/iter.lua lib/trie.lua \
+ input/pcap.lua input/zero.lua input/zmmpcap.lua \
+ input/zpcap.lua lib/base64url.lua lib/clock.lua lib/getopt.lua \
+ lib/ip.lua lib/parseconf.lua lib/trie/iter.lua lib/trie.lua \
lib/trie/node.lua output/dnscli.lua output/null.lua \
output/pcap.lua output/respdiff.lua output/tcpcli.lua \
output/tlscli.lua output/udpcli.lua
@@ -535,23 +539,23 @@ nobase_dnsjitinclude_HEADERS = globals.h version.h core/assert.h \
core/object/udp.h core/producer.h core/receiver.h \
core/thread.h core/timespec.h filter/copy.h filter/ipsplit.h \
filter/layer.h filter/split.h filter/timing.h input/fpcap.h \
- input/mmpcap.h input/pcap.h input/zpcap.h lib/base64url.h \
- lib/clock.h lib/trie.h output/dnscli.h output/pcap.h \
- output/respdiff.h output/tcpcli.h output/tlscli.h \
- output/udpcli.h core/channel.hh core/file.hh core/log.hh \
- core/object/dns.hh core/object/ether.hh core/object/gre.hh \
- core/object.hh core/object/icmp6.hh core/object/icmp.hh \
- core/object/ieee802.hh core/object/ip6.hh core/object/ip.hh \
- core/object/linuxsll.hh core/object/loop.hh \
+ input/mmpcap.h input/pcap.h input/zmmpcap.h input/zpcap.h \
+ lib/base64url.h lib/clock.h lib/trie.h output/dnscli.h \
+ output/pcap.h output/respdiff.h output/tcpcli.h \
+ output/tlscli.h output/udpcli.h core/channel.hh core/file.hh \
+ core/log.hh core/object/dns.hh core/object/ether.hh \
+ core/object/gre.hh core/object.hh core/object/icmp6.hh \
+ core/object/icmp.hh core/object/ieee802.hh core/object/ip6.hh \
+ core/object/ip.hh core/object/linuxsll.hh core/object/loop.hh \
core/object/null.hh core/object/payload.hh core/object/pcap.hh \
core/object/tcp.hh core/object/udp.hh core/producer.hh \
core/receiver.hh core/thread.hh core/timespec.hh \
filter/copy.hh filter/ipsplit.hh filter/layer.hh \
filter/split.hh filter/timing.hh input/fpcap.hh \
- input/mmpcap.hh input/pcap.hh input/zpcap.hh lib/base64url.hh \
- lib/clock.hh lib/trie.hh output/dnscli.hh output/pcap.hh \
- output/respdiff.hh output/tcpcli.hh output/tlscli.hh \
- output/udpcli.hh
+ input/mmpcap.hh input/pcap.hh input/zmmpcap.hh input/zpcap.hh \
+ lib/base64url.hh lib/clock.hh lib/trie.hh output/dnscli.hh \
+ output/pcap.hh output/respdiff.hh output/tcpcli.hh \
+ output/tlscli.hh output/udpcli.hh
lua_hobjects = core/compat.luaho core/channel.luaho core/file.luaho \
core/log.luaho core/object/dns.luaho core/object/ether.luaho \
core/object/gre.luaho core/object/icmp6.luaho \
@@ -565,10 +569,10 @@ lua_hobjects = core/compat.luaho core/channel.luaho core/file.luaho \
core/timespec.luaho filter/copy.luaho filter/ipsplit.luaho \
filter/layer.luaho filter/split.luaho filter/timing.luaho \
input/fpcap.luaho input/mmpcap.luaho input/pcap.luaho \
- input/zpcap.luaho lib/base64url.luaho lib/clock.luaho \
- lib/trie.luaho output/dnscli.luaho output/pcap.luaho \
- output/respdiff.luaho output/tcpcli.luaho output/tlscli.luaho \
- output/udpcli.luaho
+ input/zmmpcap.luaho input/zpcap.luaho lib/base64url.luaho \
+ lib/clock.luaho lib/trie.luaho output/dnscli.luaho \
+ output/pcap.luaho output/respdiff.luaho output/tcpcli.luaho \
+ output/tlscli.luaho output/udpcli.luaho
lua_objects = core.luao lib.luao input.luao filter.luao output.luao \
core/channel.luao core/compat.luao core/file.luao \
core/loader.luao core/log.luao core/object/dns/label.luao \
@@ -585,15 +589,15 @@ lua_objects = core.luao lib.luao input.luao filter.luao output.luao \
core/timespec.luao filter/copy.luao filter/ipsplit.luao \
filter/layer.luao filter/split.luao filter/timing.luao \
input/fpcap.luao input/mmpcap.luao input/pcap.luao \
- input/zero.luao input/zpcap.luao lib/base64url.luao \
- lib/clock.luao lib/getopt.luao lib/ip.luao lib/parseconf.luao \
- lib/trie/iter.luao lib/trie.luao lib/trie/node.luao \
- output/dnscli.luao output/null.luao output/pcap.luao \
- output/respdiff.luao output/tcpcli.luao output/tlscli.luao \
- output/udpcli.luao
+ input/zero.luao input/zmmpcap.luao input/zpcap.luao \
+ lib/base64url.luao lib/clock.luao lib/getopt.luao lib/ip.luao \
+ lib/parseconf.luao lib/trie/iter.luao lib/trie.luao \
+ lib/trie/node.luao output/dnscli.luao output/null.luao \
+ output/pcap.luao output/respdiff.luao output/tcpcli.luao \
+ output/tlscli.luao output/udpcli.luao
dnsjit_LDADD = $(PTHREAD_LIBS) $(luajit_LIBS) $(liblz4_LIBS) \
- $(libzstd_LIBS) $(libpcap_LIBS) $(gnutls_LIBS) $(lua_hobjects) \
- $(lua_objects)
+ $(libzstd_LIBS) $(libpcap_LIBS) $(gnutls_LIBS) $(liblzma_LIBS) \
+ $(lua_hobjects) $(lua_objects)
dnsjit_LDFLAGS = -Wl,-E
man1_MANS = dnsjit.1
man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.3 \
@@ -615,13 +619,14 @@ man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.3 \
dnsjit.filter.layer.3 dnsjit.filter.split.3 \
dnsjit.filter.timing.3 dnsjit.input.fpcap.3 \
dnsjit.input.mmpcap.3 dnsjit.input.pcap.3 dnsjit.input.zero.3 \
- dnsjit.input.zpcap.3 dnsjit.lib.base64url.3 dnsjit.lib.clock.3 \
- dnsjit.lib.getopt.3 dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 \
- dnsjit.lib.trie.3 dnsjit.lib.trie.iter.3 \
- dnsjit.lib.trie.node.3 dnsjit.output.dnscli.3 \
- dnsjit.output.null.3 dnsjit.output.pcap.3 \
- dnsjit.output.respdiff.3 dnsjit.output.tcpcli.3 \
- dnsjit.output.tlscli.3 dnsjit.output.udpcli.3
+ dnsjit.input.zmmpcap.3 dnsjit.input.zpcap.3 \
+ dnsjit.lib.base64url.3 dnsjit.lib.clock.3 dnsjit.lib.getopt.3 \
+ dnsjit.lib.ip.3 dnsjit.lib.parseconf.3 dnsjit.lib.trie.3 \
+ dnsjit.lib.trie.iter.3 dnsjit.lib.trie.node.3 \
+ dnsjit.output.dnscli.3 dnsjit.output.null.3 \
+ dnsjit.output.pcap.3 dnsjit.output.respdiff.3 \
+ dnsjit.output.tcpcli.3 dnsjit.output.tlscli.3 \
+ dnsjit.output.udpcli.3
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -806,6 +811,8 @@ input/mmpcap.$(OBJEXT): input/$(am__dirstamp) \
input/$(DEPDIR)/$(am__dirstamp)
input/pcap.$(OBJEXT): input/$(am__dirstamp) \
input/$(DEPDIR)/$(am__dirstamp)
+input/zmmpcap.$(OBJEXT): input/$(am__dirstamp) \
+ input/$(DEPDIR)/$(am__dirstamp)
input/zpcap.$(OBJEXT): input/$(am__dirstamp) \
input/$(DEPDIR)/$(am__dirstamp)
lib/$(am__dirstamp):
@@ -886,6 +893,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/fpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/mmpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/pcap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/zmmpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@input/$(DEPDIR)/zpcap.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/base64url.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/clock.Po@am__quote@ # am--include-marker
@@ -1291,6 +1299,7 @@ distclean: distclean-recursive
-rm -f input/$(DEPDIR)/fpcap.Po
-rm -f input/$(DEPDIR)/mmpcap.Po
-rm -f input/$(DEPDIR)/pcap.Po
+ -rm -f input/$(DEPDIR)/zmmpcap.Po
-rm -f input/$(DEPDIR)/zpcap.Po
-rm -f lib/$(DEPDIR)/base64url.Po
-rm -f lib/$(DEPDIR)/clock.Po
@@ -1383,6 +1392,7 @@ maintainer-clean: maintainer-clean-recursive
-rm -f input/$(DEPDIR)/fpcap.Po
-rm -f input/$(DEPDIR)/mmpcap.Po
-rm -f input/$(DEPDIR)/pcap.Po
+ -rm -f input/$(DEPDIR)/zmmpcap.Po
-rm -f input/$(DEPDIR)/zpcap.Po
-rm -f lib/$(DEPDIR)/base64url.Po
-rm -f lib/$(DEPDIR)/clock.Po
@@ -1450,7 +1460,7 @@ uninstall-man: uninstall-man1 uninstall-man3
.hh.luah:
@mkdir -p `dirname "$@"`
@echo 'module(...,package.seeall);' > "$@"
- @cat "$<" | grep '^//lua:' | sed 's%^//lua:%%' >> "$@"
+ @cat "$<" | grep '^// *lua:' | sed 's%^// *lua:%%' >> "$@"
@echo 'require("ffi").cdef[[' >> "$@"
@cat "$<" | grep -v '^#' >> "$@"
@echo ']]' >> "$@"
@@ -1607,6 +1617,9 @@ dnsjit.input.pcap.3in: input/pcap.lua gen-manpage.lua
dnsjit.input.zero.3in: input/zero.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zero.lua" > "$@"
+dnsjit.input.zmmpcap.3in: input/zmmpcap.lua gen-manpage.lua
+ $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zmmpcap.lua" > "$@"
+
dnsjit.input.zpcap.3in: input/zpcap.lua gen-manpage.lua
$(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/input/zpcap.lua" > "$@"
diff --git a/src/config.h.in b/src/config.h.in
index 137a5b3..999ca87 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -91,12 +91,18 @@
/* Define to 1 if you have the `pcap' library (-lpcap). */
#undef HAVE_LIBPCAP
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
/* Define to 1 if you have the <lmdb.h> header file. */
#undef HAVE_LMDB_H
/* Use liblz4 */
#undef HAVE_LZ4
+/* Use liblzma */
+#undef HAVE_LZMA
+
/* Define to 1 if you have the <machine/endian.h> header file. */
#undef HAVE_MACHINE_ENDIAN_H
diff --git a/src/core.lua b/src/core.lua
index 1b16d8d..bff4223 100644
--- a/src/core.lua
+++ b/src/core.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/assert.h b/src/core/assert.h
index a7d14a4..36083be 100644
--- a/src/core/assert.h
+++ b/src/core/assert.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/channel.c b/src/core/channel.c
index bbabbcc..6c6d1b4 100644
--- a/src/core/channel.c
+++ b/src/core/channel.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/channel.h b/src/core/channel.h
index fcfb382..15b3e0a 100644
--- a/src/core/channel.h
+++ b/src/core/channel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/channel.hh b/src/core/channel.hh
index 9661381..0f3bc81 100644
--- a/src/core/channel.hh
+++ b/src/core/channel.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,9 +18,9 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct core_channel {
core_log_t _log;
diff --git a/src/core/channel.lua b/src/core/channel.lua
index b652b4a..10edfde 100644
--- a/src/core/channel.lua
+++ b/src/core/channel.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/compat.c b/src/core/compat.c
index 47d8d41..3138829 100644
--- a/src/core/compat.c
+++ b/src/core/compat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/compat.h b/src/core/compat.h
index a6ed26c..1f4f8b9 100644
--- a/src/core/compat.h
+++ b/src/core/compat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/compat.lua b/src/core/compat.lua
index 167b312..98c6611 100644
--- a/src/core/compat.lua
+++ b/src/core/compat.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/file.c b/src/core/file.c
index 4f40c55..8d2eddb 100644
--- a/src/core/file.c
+++ b/src/core/file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/file.h b/src/core/file.h
index 06d75b8..280d320 100644
--- a/src/core/file.h
+++ b/src/core/file.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/file.hh b/src/core/file.hh
index bbf402e..eb87f3b 100644
--- a/src/core/file.hh
+++ b/src/core/file.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/file.lua b/src/core/file.lua
index ce5bb58..33e180c 100644
--- a/src/core/file.lua
+++ b/src/core/file.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/loader.lua b/src/core/loader.lua
index 4cc689f..1c5f9e2 100644
--- a/src/core/loader.lua
+++ b/src/core/loader.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/log.c b/src/core/log.c
index fbf72ae..03b7b2e 100644
--- a/src/core/log.c
+++ b/src/core/log.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/log.h b/src/core/log.h
index be13898..7e012c6 100644
--- a/src/core/log.h
+++ b/src/core/log.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/log.hh b/src/core/log.hh
index 1ec35f3..9921d4c 100644
--- a/src/core/log.hh
+++ b/src/core/log.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/log.lua b/src/core/log.lua
index 6547531..b08cc59 100644
--- a/src/core/log.lua
+++ b/src/core/log.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object.c b/src/core/object.c
index b277f4b..33190dd 100644
--- a/src/core/object.c
+++ b/src/core/object.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object.h b/src/core/object.h
index ec78a15..3a0c0cb 100644
--- a/src/core/object.h
+++ b/src/core/object.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object.hh b/src/core/object.hh
index 7fb8706..5e125c4 100644
--- a/src/core/object.hh
+++ b/src/core/object.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object.lua b/src/core/object.lua
index f59e969..f950ce1 100644
--- a/src/core/object.lua
+++ b/src/core/object.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/dns.c b/src/core/object/dns.c
index a4bf309..85eb9a7 100644
--- a/src/core/object/dns.c
+++ b/src/core/object/dns.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/dns.h b/src/core/object/dns.h
index 143ff89..a2b3d56 100644
--- a/src/core/object/dns.h
+++ b/src/core/object/dns.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/dns.hh b/src/core/object/dns.hh
index b4aefdd..4efd148 100644
--- a/src/core/object/dns.hh
+++ b/src/core/object/dns.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_dns_label {
uint8_t is_end;
diff --git a/src/core/object/dns.lua b/src/core/object/dns.lua
index 632fe95..6cb3477 100644
--- a/src/core/object/dns.lua
+++ b/src/core/object/dns.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/dns/label.lua b/src/core/object/dns/label.lua
index 27bf918..34e77d8 100644
--- a/src/core/object/dns/label.lua
+++ b/src/core/object/dns/label.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/dns/q.lua b/src/core/object/dns/q.lua
index 2eaa7fa..5b90d6c 100644
--- a/src/core/object/dns/q.lua
+++ b/src/core/object/dns/q.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/dns/rr.lua b/src/core/object/dns/rr.lua
index 967d9f1..5689b5f 100644
--- a/src/core/object/dns/rr.lua
+++ b/src/core/object/dns/rr.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/ether.c b/src/core/object/ether.c
index dc05391..0d8b160 100644
--- a/src/core/object/ether.c
+++ b/src/core/object/ether.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ether.h b/src/core/object/ether.h
index a5de6f7..7f7f948 100644
--- a/src/core/object/ether.h
+++ b/src/core/object/ether.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ether.hh b/src/core/object/ether.hh
index a3f638e..9e5fc4f 100644
--- a/src/core/object/ether.hh
+++ b/src/core/object/ether.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ether {
const core_object_t* obj_prev;
diff --git a/src/core/object/ether.lua b/src/core/object/ether.lua
index 04de9c2..00400d0 100644
--- a/src/core/object/ether.lua
+++ b/src/core/object/ether.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/gre.c b/src/core/object/gre.c
index c359f60..9b5187e 100644
--- a/src/core/object/gre.c
+++ b/src/core/object/gre.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/gre.h b/src/core/object/gre.h
index 4caa6fa..6c6142c 100644
--- a/src/core/object/gre.h
+++ b/src/core/object/gre.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/gre.hh b/src/core/object/gre.hh
index c2008a7..18ab7c8 100644
--- a/src/core/object/gre.hh
+++ b/src/core/object/gre.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_gre {
const core_object_t* obj_prev;
diff --git a/src/core/object/gre.lua b/src/core/object/gre.lua
index 22a73f5..e518888 100644
--- a/src/core/object/gre.lua
+++ b/src/core/object/gre.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/icmp.c b/src/core/object/icmp.c
index 3b9ed38..609b4e2 100644
--- a/src/core/object/icmp.c
+++ b/src/core/object/icmp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/icmp.h b/src/core/object/icmp.h
index 931c866..e923b16 100644
--- a/src/core/object/icmp.h
+++ b/src/core/object/icmp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/icmp.hh b/src/core/object/icmp.hh
index 4374a8b..faf528d 100644
--- a/src/core/object/icmp.hh
+++ b/src/core/object/icmp.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_icmp {
const core_object_t* obj_prev;
diff --git a/src/core/object/icmp.lua b/src/core/object/icmp.lua
index d2a29c8..dd916d4 100644
--- a/src/core/object/icmp.lua
+++ b/src/core/object/icmp.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/icmp6.c b/src/core/object/icmp6.c
index d312712..250d5a5 100644
--- a/src/core/object/icmp6.c
+++ b/src/core/object/icmp6.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/icmp6.h b/src/core/object/icmp6.h
index fc79f62..62ad056 100644
--- a/src/core/object/icmp6.h
+++ b/src/core/object/icmp6.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/icmp6.hh b/src/core/object/icmp6.hh
index 47967ef..250af69 100644
--- a/src/core/object/icmp6.hh
+++ b/src/core/object/icmp6.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_icmp6 {
const core_object_t* obj_prev;
diff --git a/src/core/object/icmp6.lua b/src/core/object/icmp6.lua
index 3ec938e..8ac6c8f 100644
--- a/src/core/object/icmp6.lua
+++ b/src/core/object/icmp6.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/ieee802.c b/src/core/object/ieee802.c
index 5cd1bec..e81fbab 100644
--- a/src/core/object/ieee802.c
+++ b/src/core/object/ieee802.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ieee802.h b/src/core/object/ieee802.h
index 84214c8..487acb3 100644
--- a/src/core/object/ieee802.h
+++ b/src/core/object/ieee802.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ieee802.hh b/src/core/object/ieee802.hh
index 4303efb..3abb71d 100644
--- a/src/core/object/ieee802.hh
+++ b/src/core/object/ieee802.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ieee802 {
const core_object_t* obj_prev;
diff --git a/src/core/object/ieee802.lua b/src/core/object/ieee802.lua
index 5d75a70..e0d5e23 100644
--- a/src/core/object/ieee802.lua
+++ b/src/core/object/ieee802.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/ip.c b/src/core/object/ip.c
index 91a6d42..ff58810 100644
--- a/src/core/object/ip.c
+++ b/src/core/object/ip.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ip.h b/src/core/object/ip.h
index cc79fb0..1fdcdb8 100644
--- a/src/core/object/ip.h
+++ b/src/core/object/ip.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ip.hh b/src/core/object/ip.hh
index 0f92747..8bdb288 100644
--- a/src/core/object/ip.hh
+++ b/src/core/object/ip.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ip {
const core_object_t* obj_prev;
diff --git a/src/core/object/ip.lua b/src/core/object/ip.lua
index 84e65b6..787acb8 100644
--- a/src/core/object/ip.lua
+++ b/src/core/object/ip.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/ip6.c b/src/core/object/ip6.c
index 4d639b4..8117226 100644
--- a/src/core/object/ip6.c
+++ b/src/core/object/ip6.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ip6.h b/src/core/object/ip6.h
index 831513b..35f31df 100644
--- a/src/core/object/ip6.h
+++ b/src/core/object/ip6.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/ip6.hh b/src/core/object/ip6.hh
index 6ea20cc..5b4823e 100644
--- a/src/core/object/ip6.hh
+++ b/src/core/object/ip6.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_ip6 {
const core_object_t* obj_prev;
diff --git a/src/core/object/ip6.lua b/src/core/object/ip6.lua
index cdadd7c..459e7dd 100644
--- a/src/core/object/ip6.lua
+++ b/src/core/object/ip6.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/linuxsll.c b/src/core/object/linuxsll.c
index 5f8898e..f96d55a 100644
--- a/src/core/object/linuxsll.c
+++ b/src/core/object/linuxsll.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/linuxsll.h b/src/core/object/linuxsll.h
index e6c36a9..c9c2c3f 100644
--- a/src/core/object/linuxsll.h
+++ b/src/core/object/linuxsll.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/linuxsll.hh b/src/core/object/linuxsll.hh
index 093f430..d9dc99b 100644
--- a/src/core/object/linuxsll.hh
+++ b/src/core/object/linuxsll.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_linuxsll {
const core_object_t* obj_prev;
diff --git a/src/core/object/linuxsll.lua b/src/core/object/linuxsll.lua
index 29f59db..8436ce0 100644
--- a/src/core/object/linuxsll.lua
+++ b/src/core/object/linuxsll.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/loop.c b/src/core/object/loop.c
index 0c9acf8..6ab171b 100644
--- a/src/core/object/loop.c
+++ b/src/core/object/loop.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/loop.h b/src/core/object/loop.h
index 1c91b18..911ba45 100644
--- a/src/core/object/loop.h
+++ b/src/core/object/loop.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/loop.hh b/src/core/object/loop.hh
index acaf1c1..b1e4991 100644
--- a/src/core/object/loop.hh
+++ b/src/core/object/loop.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_loop {
const core_object_t* obj_prev;
diff --git a/src/core/object/loop.lua b/src/core/object/loop.lua
index 5fbec27..f38b70d 100644
--- a/src/core/object/loop.lua
+++ b/src/core/object/loop.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/null.c b/src/core/object/null.c
index d9fe8b9..8e0b9fd 100644
--- a/src/core/object/null.c
+++ b/src/core/object/null.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/null.h b/src/core/object/null.h
index e173f0b..d807541 100644
--- a/src/core/object/null.h
+++ b/src/core/object/null.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/null.hh b/src/core/object/null.hh
index d934185..95293a3 100644
--- a/src/core/object/null.hh
+++ b/src/core/object/null.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_null {
const core_object_t* obj_prev;
diff --git a/src/core/object/null.lua b/src/core/object/null.lua
index 3d4f456..46939eb 100644
--- a/src/core/object/null.lua
+++ b/src/core/object/null.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/payload.c b/src/core/object/payload.c
index efc5726..17188d2 100644
--- a/src/core/object/payload.c
+++ b/src/core/object/payload.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/payload.h b/src/core/object/payload.h
index dc3ae6a..898379a 100644
--- a/src/core/object/payload.h
+++ b/src/core/object/payload.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/payload.hh b/src/core/object/payload.hh
index 573fd45..e9d86fb 100644
--- a/src/core/object/payload.hh
+++ b/src/core/object/payload.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_payload {
const core_object_t* obj_prev;
diff --git a/src/core/object/payload.lua b/src/core/object/payload.lua
index cb80b13..ac4d2a7 100644
--- a/src/core/object/payload.lua
+++ b/src/core/object/payload.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/pcap.c b/src/core/object/pcap.c
index fe9beca..fc6c7be 100644
--- a/src/core/object/pcap.c
+++ b/src/core/object/pcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/pcap.h b/src/core/object/pcap.h
index e88102e..ed87c26 100644
--- a/src/core/object/pcap.h
+++ b/src/core/object/pcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/pcap.hh b/src/core/object/pcap.hh
index 09a50df..4d2ec48 100644
--- a/src/core/object/pcap.hh
+++ b/src/core/object/pcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct core_object_pcap {
const core_object_t* obj_prev;
diff --git a/src/core/object/pcap.lua b/src/core/object/pcap.lua
index 0b0e1aa..66b049e 100644
--- a/src/core/object/pcap.lua
+++ b/src/core/object/pcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/tcp.c b/src/core/object/tcp.c
index f46bfe6..4a916c6 100644
--- a/src/core/object/tcp.c
+++ b/src/core/object/tcp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/tcp.h b/src/core/object/tcp.h
index 41fddcc..490b644 100644
--- a/src/core/object/tcp.h
+++ b/src/core/object/tcp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/tcp.hh b/src/core/object/tcp.hh
index 869ab9a..b9a659a 100644
--- a/src/core/object/tcp.hh
+++ b/src/core/object/tcp.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_tcp {
const core_object_t* obj_prev;
diff --git a/src/core/object/tcp.lua b/src/core/object/tcp.lua
index 1856098..5e23a4b 100644
--- a/src/core/object/tcp.lua
+++ b/src/core/object/tcp.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/object/udp.c b/src/core/object/udp.c
index c58fc5d..ff6c7a2 100644
--- a/src/core/object/udp.c
+++ b/src/core/object/udp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/udp.h b/src/core/object/udp.h
index 00c95e0..c58b13d 100644
--- a/src/core/object/udp.h
+++ b/src/core/object/udp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/object/udp.hh b/src/core/object/udp.hh
index 7dbe20f..39748a4 100644
--- a/src/core/object/udp.hh
+++ b/src/core/object/udp.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef struct core_object_udp {
const core_object_t* obj_prev;
diff --git a/src/core/object/udp.lua b/src/core/object/udp.lua
index 0e0393f..e23408b 100644
--- a/src/core/object/udp.lua
+++ b/src/core/object/udp.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/objects.lua b/src/core/objects.lua
index 2ba9407..c4b7639 100644
--- a/src/core/objects.lua
+++ b/src/core/objects.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/producer.c b/src/core/producer.c
index 315a838..61ea255 100644
--- a/src/core/producer.c
+++ b/src/core/producer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/producer.h b/src/core/producer.h
index 038e3a2..139782e 100644
--- a/src/core/producer.h
+++ b/src/core/producer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/producer.hh b/src/core/producer.hh
index 1cb6b54..ab3a222 100644
--- a/src/core/producer.hh
+++ b/src/core/producer.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,6 +18,6 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef const core_object_t* (*core_producer_t)(void* ctx);
diff --git a/src/core/producer.lua b/src/core/producer.lua
index b0ab4fe..e457807 100644
--- a/src/core/producer.lua
+++ b/src/core/producer.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/receiver.c b/src/core/receiver.c
index 7a484a2..5264549 100644
--- a/src/core/receiver.c
+++ b/src/core/receiver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/receiver.h b/src/core/receiver.h
index 8cb2132..e109778 100644
--- a/src/core/receiver.h
+++ b/src/core/receiver.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/receiver.hh b/src/core/receiver.hh
index eb3041e..3bea05f 100644
--- a/src/core/receiver.hh
+++ b/src/core/receiver.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,6 +18,6 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.object_h")
+// lua:require("dnsjit.core.object_h")
typedef void (*core_receiver_t)(void* ctx, const core_object_t* obj);
diff --git a/src/core/receiver.lua b/src/core/receiver.lua
index 66b6a7c..91c4cee 100644
--- a/src/core/receiver.lua
+++ b/src/core/receiver.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/core/thread.c b/src/core/thread.c
index ff121e4..abaa063 100644
--- a/src/core/thread.c
+++ b/src/core/thread.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -185,7 +185,7 @@ void core_thread_push_string(core_thread_t* self, const char* str, size_t len)
_push(self, item);
}
-void core_thread_push_int64(core_thread_t* self, int64_t i64)
+void core_thread_push_number(core_thread_t* self, double num)
{
core_thread_item_t* item;
mlassert_self();
@@ -194,7 +194,7 @@ void core_thread_push_int64(core_thread_t* self, int64_t i64)
item->next = 0;
item->ptr = 0;
item->str = 0;
- item->i64 = i64;
+ item->num = num;
_push(self, item);
}
diff --git a/src/core/thread.h b/src/core/thread.h
index f6a0576..ffae739 100644
--- a/src/core/thread.h
+++ b/src/core/thread.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/thread.hh b/src/core/thread.hh
index 1771333..1161f13 100644
--- a/src/core/thread.hh
+++ b/src/core/thread.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
typedef struct core_thread_item core_thread_item_t;
struct core_thread_item {
@@ -27,8 +27,8 @@ struct core_thread_item {
void* ptr;
char * type, *module;
- char* str;
- int64_t i64;
+ char* str;
+ double num;
};
typedef struct core_thread {
@@ -52,5 +52,5 @@ int core_thread_start(core_thread_t* self, const char* byt
int core_thread_stop(core_thread_t* self);
void core_thread_push(core_thread_t* self, void* ptr, const char* type, size_t type_len, const char* module, size_t module_len);
void core_thread_push_string(core_thread_t* self, const char* str, size_t len);
-void core_thread_push_int64(core_thread_t* self, int64_t i64);
+void core_thread_push_number(core_thread_t* self, double num);
const core_thread_item_t* core_thread_pop(core_thread_t* self);
diff --git a/src/core/thread.lua b/src/core/thread.lua
index e79d356..577e9bf 100644
--- a/src/core/thread.lua
+++ b/src/core/thread.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
@@ -87,7 +87,7 @@ function Thread:push(...)
if t == "string" then
C.core_thread_push_string(self, obj, #obj)
elseif t == "number" then
- C.core_thread_push_int64(self, obj)
+ C.core_thread_push_number(self, obj)
else
local ptr, type, module = obj:share()
C.core_thread_push(self, ptr, type, #type, module, #module)
@@ -108,7 +108,7 @@ function Thread:pop(num)
end
if item.ptr == nil then
if item.str == nil then
- return tonumber(item.i64)
+ return tonumber(item.num)
end
return ffi.string(item.str)
end
@@ -123,7 +123,7 @@ function Thread:pop(num)
if item.ptr == nil then
if item.str == nil then
- table.insert(ret, tonumber(item.i64))
+ table.insert(ret, tonumber(item.num))
else
table.insert(ret, ffi.string(item.str))
end
diff --git a/src/core/timespec.h b/src/core/timespec.h
index 3b52d4a..5d99e24 100644
--- a/src/core/timespec.h
+++ b/src/core/timespec.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/timespec.hh b/src/core/timespec.hh
index 249a3ae..0c40d11 100644
--- a/src/core/timespec.hh
+++ b/src/core/timespec.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/core/timespec.lua b/src/core/timespec.lua
index a53eada..ab810e0 100644
--- a/src/core/timespec.lua
+++ b/src/core/timespec.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/dnsjit.1in b/src/dnsjit.1in
index 7512409..3d2262e 100644
--- a/src/dnsjit.1in
+++ b/src/dnsjit.1in
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2018-2023, OARC, Inc.
+.\" Copyright (c) 2018-2024 OARC, Inc.
.\" All rights reserved.
.\"
.\" This file is part of dnsjit.
diff --git a/src/dnsjit.c b/src/dnsjit.c
index 4d05d5f..20b8d14 100644
--- a/src/dnsjit.c
+++ b/src/dnsjit.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -27,52 +27,18 @@
#include <lualib.h>
#include <lauxlib.h>
-#include <pthread.h>
-#include <signal.h>
-#include <string.h>
#include <stdio.h>
-static void* _sighthr(void* arg)
-{
- sigset_t* set = (sigset_t*)arg;
- int sig = 0, err;
-
- if ((err = sigwait(set, &sig))) {
- gldebug("sigwait %d", err);
- }
- glfatal("signal %d", sig);
-
- return 0;
-}
-
int main(int argc, char* argv[])
{
lua_State* L;
int n, err;
- sigset_t set;
- pthread_t sighthr;
if (argc < 2) {
fprintf(stderr, "usage: %s <file.lua> ...\n", argv[0]);
exit(1);
}
- sigfillset(&set);
- if ((err = pthread_sigmask(SIG_BLOCK, &set, 0))) {
- glfatal("Unable to set blocked signals with pthread_sigmask()");
- return 2;
- }
-
- sigemptyset(&set);
- sigaddset(&set, SIGTERM);
- sigaddset(&set, SIGQUIT);
- sigaddset(&set, SIGINT);
-
- if ((err = pthread_create(&sighthr, 0, _sighthr, &set))) {
- glfatal("Unable to start signal thread with pthread_create()");
- return 2;
- }
-
L = luaL_newstate();
luaL_openlibs(L);
dnsjit_globals(L);
diff --git a/src/filter.lua b/src/filter.lua
index 4b58a15..29f0c77 100644
--- a/src/filter.lua
+++ b/src/filter.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/filter/copy.hh b/src/filter/copy.hh
index edf7fc7..7af2ce4 100644
--- a/src/filter/copy.hh
+++ b/src/filter/copy.hh
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct filter_copy {
core_log_t _log;
diff --git a/src/filter/ipsplit.hh b/src/filter/ipsplit.hh
index c362ac3..6c74a6c 100644
--- a/src/filter/ipsplit.hh
+++ b/src/filter/ipsplit.hh
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct filter_ipsplit_recv filter_ipsplit_recv_t;
struct filter_ipsplit_recv {
diff --git a/src/filter/layer.c b/src/filter/layer.c
index dd03c5d..80f0450 100644
--- a/src/filter/layer.c
+++ b/src/filter/layer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -180,7 +180,7 @@ static inline uint32_t _need32(const void* ptr)
p += x; \
l -= x
-//static int _ip(filter_layer_t* self, const core_object_t* obj, const unsigned char* pkt, size_t len);
+// static int _ip(filter_layer_t* self, const core_object_t* obj, const unsigned char* pkt, size_t len);
static inline int _proto(filter_layer_t* self, uint8_t proto, const core_object_t* obj, const unsigned char* pkt, size_t len)
{
diff --git a/src/filter/layer.h b/src/filter/layer.h
index e656f76..6e527d9 100644
--- a/src/filter/layer.h
+++ b/src/filter/layer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/filter/layer.hh b/src/filter/layer.hh
index bfeabfe..d60d1fc 100644
--- a/src/filter/layer.hh
+++ b/src/filter/layer.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,23 +18,23 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
-//lua:require("dnsjit.core.object.null_h")
-//lua:require("dnsjit.core.object.ether_h")
-//lua:require("dnsjit.core.object.loop_h")
-//lua:require("dnsjit.core.object.linuxsll_h")
-//lua:require("dnsjit.core.object.ieee802_h")
-//lua:require("dnsjit.core.object.ip_h")
-//lua:require("dnsjit.core.object.ip6_h")
-//lua:require("dnsjit.core.object.gre_h")
-//lua:require("dnsjit.core.object.icmp_h")
-//lua:require("dnsjit.core.object.icmp6_h")
-//lua:require("dnsjit.core.object.udp_h")
-//lua:require("dnsjit.core.object.tcp_h")
-//lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.object.null_h")
+// lua:require("dnsjit.core.object.ether_h")
+// lua:require("dnsjit.core.object.loop_h")
+// lua:require("dnsjit.core.object.linuxsll_h")
+// lua:require("dnsjit.core.object.ieee802_h")
+// lua:require("dnsjit.core.object.ip_h")
+// lua:require("dnsjit.core.object.ip6_h")
+// lua:require("dnsjit.core.object.gre_h")
+// lua:require("dnsjit.core.object.icmp_h")
+// lua:require("dnsjit.core.object.icmp6_h")
+// lua:require("dnsjit.core.object.udp_h")
+// lua:require("dnsjit.core.object.tcp_h")
+// lua:require("dnsjit.core.object.payload_h")
typedef struct filter_layer {
core_log_t _log;
diff --git a/src/filter/layer.lua b/src/filter/layer.lua
index da000f4..c0e497e 100644
--- a/src/filter/layer.lua
+++ b/src/filter/layer.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/filter/split.c b/src/filter/split.c
index 616f690..27a6c28 100644
--- a/src/filter/split.c
+++ b/src/filter/split.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/filter/split.h b/src/filter/split.h
index c4796b7..24ab39d 100644
--- a/src/filter/split.h
+++ b/src/filter/split.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/filter/split.hh b/src/filter/split.hh
index 044a851..44c7af9 100644
--- a/src/filter/split.hh
+++ b/src/filter/split.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef enum filter_split_mode {
FILTER_SPLIT_MODE_ROUNDROBIN,
diff --git a/src/filter/split.lua b/src/filter/split.lua
index 9a14c68..e16cbee 100644
--- a/src/filter/split.lua
+++ b/src/filter/split.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/filter/timing.c b/src/filter/timing.c
index 9351a90..225d372 100644
--- a/src/filter/timing.c
+++ b/src/filter/timing.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/filter/timing.h b/src/filter/timing.h
index 9a67974..328777e 100644
--- a/src/filter/timing.h
+++ b/src/filter/timing.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/filter/timing.hh b/src/filter/timing.hh
index beb35bb..2e29d8a 100644
--- a/src/filter/timing.hh
+++ b/src/filter/timing.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,10 +18,10 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct filter_timing {
core_log_t _log;
diff --git a/src/filter/timing.lua b/src/filter/timing.lua
index 2255ebc..72d8fed 100644
--- a/src/filter/timing.lua
+++ b/src/filter/timing.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/gen-manpage.lua b/src/gen-manpage.lua
index 459d7eb..d19f4b1 100644
--- a/src/gen-manpage.lua
+++ b/src/gen-manpage.lua
@@ -1,5 +1,5 @@
print[[
-.\" Copyright (c) 2018-2023, OARC, Inc.
+.\" Copyright (c) 2018-2024 OARC, Inc.
.\" All rights reserved.
.\"
.\" This file is part of dnsjit.
diff --git a/src/globals.c b/src/globals.c
index a9c2e1d..90f724b 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/globals.h b/src/globals.h
index e6ed354..8b4346a 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input.lua b/src/input.lua
index 3fb3705..268d667 100644
--- a/src/input.lua
+++ b/src/input.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/input/fpcap.c b/src/input/fpcap.c
index 8c585c8..04885c6 100644
--- a/src/input/fpcap.c
+++ b/src/input/fpcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/fpcap.h b/src/input/fpcap.h
index e327acd..4f2967e 100644
--- a/src/input/fpcap.h
+++ b/src/input/fpcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/fpcap.hh b/src/input/fpcap.hh
index aacad46..dd8e19d 100644
--- a/src/input/fpcap.hh
+++ b/src/input/fpcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,10 +18,10 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef struct input_fpcap {
core_log_t _log;
diff --git a/src/input/fpcap.lua b/src/input/fpcap.lua
index 3372228..e0d9447 100644
--- a/src/input/fpcap.lua
+++ b/src/input/fpcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/input/mmpcap.c b/src/input/mmpcap.c
index c5b8542..2caf5cf 100644
--- a/src/input/mmpcap.c
+++ b/src/input/mmpcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/mmpcap.h b/src/input/mmpcap.h
index caecb38..8844cb7 100644
--- a/src/input/mmpcap.h
+++ b/src/input/mmpcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/mmpcap.hh b/src/input/mmpcap.hh
index 0f793fc..387d5a6 100644
--- a/src/input/mmpcap.hh
+++ b/src/input/mmpcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,10 +18,10 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef struct input_mmpcap {
core_log_t _log;
diff --git a/src/input/mmpcap.lua b/src/input/mmpcap.lua
index 97d3b47..983d693 100644
--- a/src/input/mmpcap.lua
+++ b/src/input/mmpcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/input/pcap.c b/src/input/pcap.c
index 6a2e245..2304109 100644
--- a/src/input/pcap.c
+++ b/src/input/pcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/pcap.h b/src/input/pcap.h
index 2756153..5b091ba 100644
--- a/src/input/pcap.h
+++ b/src/input/pcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/pcap.hh b/src/input/pcap.hh
index 20b156a..de694a7 100644
--- a/src/input/pcap.hh
+++ b/src/input/pcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -22,10 +22,10 @@
typedef struct pcap {} pcap_t;
#endif
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef struct input_pcap {
core_log_t _log;
diff --git a/src/input/pcap.lua b/src/input/pcap.lua
index 49f05c6..237a8db 100644
--- a/src/input/pcap.lua
+++ b/src/input/pcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/input/zero.lua b/src/input/zero.lua
index e152c79..6c50d91 100644
--- a/src/input/zero.lua
+++ b/src/input/zero.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/input/zmmpcap.c b/src/input/zmmpcap.c
new file mode 100644
index 0000000..5c920e1
--- /dev/null
+++ b/src/input/zmmpcap.c
@@ -0,0 +1,677 @@
+/*
+ * Copyright (c) 2018-2024 OARC, Inc.
+ * All rights reserved.
+ *
+ * This file is part of dnsjit.
+ *
+ * dnsjit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * dnsjit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "input/zmmpcap.h"
+#include "core/assert.h"
+#include "core/object/pcap.h"
+
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#ifdef HAVE_ENDIAN_H
+#include <endian.h>
+#else
+#ifdef HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#endif
+#endif
+#endif
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+#ifndef bswap_16
+#ifndef bswap16
+#define bswap_16(x) swap16(x)
+#define bswap_32(x) swap32(x)
+#define bswap_64(x) swap64(x)
+#else
+#define bswap_16(x) bswap16(x)
+#define bswap_32(x) bswap32(x)
+#define bswap_64(x) bswap64(x)
+#endif
+#endif
+#include <pcap/pcap.h>
+
+#ifdef HAVE_LZ4
+#include <lz4frame.h>
+struct _lz4_ctx {
+ LZ4F_dctx* ctx;
+ LZ4F_decompressOptions_t opts;
+};
+#define lz4 ((struct _lz4_ctx*)self->comp_ctx)
+#endif
+
+#ifdef HAVE_ZSTD
+#include <zstd.h>
+struct _zstd_ctx {
+ ZSTD_DCtx* ctx;
+ ZSTD_inBuffer in;
+ ZSTD_outBuffer out;
+};
+#define zstd ((struct _zstd_ctx*)self->comp_ctx)
+#endif
+
+#include <zlib.h>
+struct _gzip_ctx {
+ z_stream strm;
+};
+#define gzip ((struct _gzip_ctx*)self->comp_ctx)
+
+#ifdef HAVE_LZMA
+#include <lzma.h>
+struct _lzma_ctx {
+ lzma_stream strm;
+};
+static lzma_stream lzma_stream_init = LZMA_STREAM_INIT;
+#define lzma ((struct _lzma_ctx*)self->comp_ctx)
+#endif
+
+static core_log_t _log = LOG_T_INIT("input.zmmpcap");
+static input_zmmpcap_t _defaults = {
+ LOG_T_INIT_OBJ("input.zmmpcap"),
+ 0, 0,
+ 0, 0, 0,
+ CORE_OBJECT_PCAP_INIT(0),
+ input_zmmpcap_type_none, 0,
+ 0, 0, 0, 0,
+ -1, 0, 0, 0, MAP_FAILED,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0
+};
+
+core_log_t* input_zmmpcap_log()
+{
+ return &_log;
+}
+
+void input_zmmpcap_init(input_zmmpcap_t* self)
+{
+ mlassert_self();
+
+ *self = _defaults;
+}
+
+void input_zmmpcap_destroy(input_zmmpcap_t* self)
+{
+ mlassert_self();
+
+ free(self->out);
+
+ switch (self->compression) {
+#ifdef HAVE_LZ4
+ case input_zmmpcap_type_lz4: {
+ LZ4F_errorCode_t code;
+
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
+ }
+ free(lz4);
+ break;
+ }
+#endif
+#ifdef HAVE_ZSTD
+ case input_zmmpcap_type_zstd:
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
+ }
+ free(zstd);
+ break;
+#endif
+ case input_zmmpcap_type_gzip:
+ if (gzip) {
+ inflateEnd(&gzip->strm);
+ }
+ free(gzip);
+ break;
+#ifdef HAVE_LZMA
+ case input_zmmpcap_type_lzma:
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ break;
+#endif
+ default:
+ break;
+ }
+
+ if (self->map != MAP_FAILED) {
+ munmap(self->map, self->len);
+ }
+ if (self->fd > -1) {
+ close(self->fd);
+ }
+ free(self->buf);
+}
+
+static ssize_t _read(input_zmmpcap_t* self, void* dst, size_t len, void** dstp)
+{
+ switch (self->compression) {
+#ifdef HAVE_LZ4
+ case input_zmmpcap_type_lz4: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (self->at >= self->len) {
+ return 0;
+ }
+
+ size_t dst_size = self->out_size, src_size = self->len - self->at;
+ size_t code = LZ4F_decompress(lz4->ctx, self->out, &dst_size, &self->map[self->at], &src_size, &lz4->opts);
+ if (LZ4F_isError(code)) {
+ lfatal("LZ4F_decompress() failed: %s", LZ4F_getErrorName(code));
+ }
+
+ self->at += src_size;
+ self->out_at = 0;
+ self->out_have = dst_size;
+ }
+ }
+#endif
+#ifdef HAVE_ZSTD
+ case input_zmmpcap_type_zstd: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (zstd->in.pos >= zstd->in.size) {
+ return 0;
+ }
+
+ zstd->out.size = self->out_size;
+ zstd->out.pos = 0;
+ size_t code = ZSTD_decompressStream(zstd->ctx, &zstd->out, &zstd->in);
+ if (ZSTD_isError(code)) {
+ lfatal("ZSTD_decompressStream() failed: %s", ZSTD_getErrorName(code));
+ }
+
+ self->out_have = zstd->out.pos;
+ self->out_at = 0;
+ }
+ }
+#endif
+ case input_zmmpcap_type_gzip: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (gzip->strm.avail_in <= 0) {
+ return 0;
+ }
+
+ gzip->strm.next_out = self->out;
+ gzip->strm.avail_out = self->out_size;
+
+ self->out_at = 0;
+ int ret = inflate(&gzip->strm, Z_NO_FLUSH);
+ if (ret != Z_OK) {
+ if (ret == Z_STREAM_END) {
+ self->out_have = self->out_size - gzip->strm.avail_out;
+ if (self->out_have > 0) {
+ continue;
+ }
+ return 0;
+ }
+ lfatal("inflate() failed: %d: %s", ret, gzip->strm.msg);
+ }
+
+ self->out_have = self->out_size - gzip->strm.avail_out;
+ }
+ }
+#ifdef HAVE_LZMA
+ case input_zmmpcap_type_lzma: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ lzma_action action = LZMA_RUN;
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ if (lzma->strm.avail_in <= 0) {
+ return 0;
+ }
+
+ lzma->strm.next_out = self->out;
+ lzma->strm.avail_out = self->out_size;
+
+ self->out_at = 0;
+ lzma_ret ret = lzma_code(&lzma->strm, action);
+ if (ret != LZMA_OK) {
+ if (ret == LZMA_STREAM_END) {
+ self->out_have = self->out_size - lzma->strm.avail_out;
+ if (self->out_have > 0) {
+ continue;
+ }
+ return 0;
+ }
+ lfatal("lzma_code() failed: %d", ret);
+ }
+
+ self->out_have = self->out_size - lzma->strm.avail_out;
+ }
+ }
+#endif
+ default:
+ return 0;
+ }
+}
+
+int input_zmmpcap_open(input_zmmpcap_t* self, const char* file)
+{
+ struct stat sb;
+ mlassert_self();
+ lassert(file, "file is nil");
+
+ if (self->fd != -1) {
+ lfatal("already opened");
+ }
+
+ if ((self->fd = open(file, O_RDONLY)) < 0) {
+ lcritical("open(%s) error %s", file, core_log_errstr(errno));
+ return -1;
+ }
+
+ if (fstat(self->fd, &sb)) {
+ lcritical("stat(%s) error %s", file, core_log_errstr(errno));
+ return -1;
+ }
+ self->len = sb.st_size;
+
+ if ((self->map = mmap(0, self->len, PROT_READ, MAP_PRIVATE, self->fd, 0)) == MAP_FAILED) {
+ lcritical("mmap(%s) error %s", file, core_log_errstr(errno));
+ return -1;
+ }
+
+ switch (self->compression) {
+#ifdef HAVE_LZ4
+ case input_zmmpcap_type_lz4: {
+ LZ4F_errorCode_t code;
+
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
+ }
+ free(lz4);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _lz4_ctx)));
+ if ((code = LZ4F_createDecompressionContext(&lz4->ctx, LZ4F_VERSION))) {
+ lfatal("LZ4F_createDecompressionContext() failed: %s", LZ4F_getErrorName(code));
+ }
+ lz4->opts.stableDst = 1;
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+ break;
+ }
+#endif
+#ifdef HAVE_ZSTD
+ case input_zmmpcap_type_zstd:
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
+ }
+ free(zstd);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _zstd_ctx)));
+ lfatal_oom(zstd->ctx = ZSTD_createDCtx());
+ self->out_size = ZSTD_DStreamOutSize();
+ lfatal_oom(self->out = malloc(self->out_size + 1));
+
+ zstd->in.src = self->map;
+ zstd->in.size = self->len;
+ zstd->out.dst = self->out;
+ zstd->out.size = self->out_size;
+ break;
+#endif
+ case input_zmmpcap_type_gzip: {
+ if (gzip) {
+ inflateEnd(&gzip->strm);
+ }
+ free(gzip);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _gzip_ctx)));
+ int ret = inflateInit2(&gzip->strm, 32);
+ if (ret != Z_OK) {
+ lcritical("inflateInit() error: %d", ret);
+ return -1;
+ }
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+
+ gzip->strm.next_in = self->map;
+ gzip->strm.avail_in = self->len;
+ break;
+ }
+#ifdef HAVE_LZMA
+ case input_zmmpcap_type_lzma: {
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _lzma_ctx)));
+ lzma->strm = lzma_stream_init;
+ lzma_ret ret = lzma_stream_decoder(&lzma->strm, UINT64_MAX, LZMA_CONCATENATED);
+ if (ret != LZMA_OK) {
+ lcritical("lzma_stream_decoder() error: %d", ret);
+ return -1;
+ }
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+
+ lzma->strm.next_in = self->map;
+ lzma->strm.avail_in = self->len;
+ break;
+ }
+#endif
+ default:
+ lcritical("no support for selected compression");
+ return -2;
+ }
+
+ if (_read(self, &self->magic_number, 4, 0) != 4
+ || _read(self, &self->version_major, 2, 0) != 2
+ || _read(self, &self->version_minor, 2, 0) != 2
+ || _read(self, &self->thiszone, 4, 0) != 4
+ || _read(self, &self->sigfigs, 4, 0) != 4
+ || _read(self, &self->snaplen, 4, 0) != 4
+ || _read(self, &self->network, 4, 0) != 4) {
+ lcritical("could not read full PCAP header");
+ return -2;
+ }
+ switch (self->magic_number) {
+ case 0x4d3cb2a1:
+ self->is_nanosec = 1;
+ case 0xd4c3b2a1:
+ self->is_swapped = 1;
+ self->version_major = bswap_16(self->version_major);
+ self->version_minor = bswap_16(self->version_minor);
+ self->thiszone = (int32_t)bswap_32((uint32_t)self->thiszone);
+ self->sigfigs = bswap_32(self->sigfigs);
+ self->snaplen = bswap_32(self->snaplen);
+ self->network = bswap_32(self->network);
+ break;
+ case 0xa1b2c3d4:
+ case 0xa1b23c4d:
+ break;
+ default:
+ lcritical("invalid PCAP header");
+ return -2;
+ }
+
+ if (self->version_major != 2 || self->version_minor != 4) {
+ lcritical("unsupported PCAP version v%u.%u", self->version_major, self->version_minor);
+ return -2;
+ }
+
+ /*
+ * Translation taken from https://github.com/the-tcpdump-group/libpcap/blob/90543970fd5fbed261d3637f5ec4811d7dde4e49/pcap-common.c#L1212 .
+ */
+ switch (self->network) {
+ case 101: /* LINKTYPE_RAW */
+ self->linktype = DLT_RAW;
+ break;
+#ifdef DLT_FR
+ case 107: /* LINKTYPE_FRELAY */
+ self->linktype = DLT_FR;
+ break;
+#endif
+ case 100: /* LINKTYPE_ATM_RFC1483 */
+ self->linktype = DLT_ATM_RFC1483;
+ break;
+ case 102: /* LINKTYPE_SLIP_BSDOS */
+ self->linktype = DLT_SLIP_BSDOS;
+ break;
+ case 103: /* LINKTYPE_PPP_BSDOS */
+ self->linktype = DLT_PPP_BSDOS;
+ break;
+ case 104: /* LINKTYPE_C_HDLC */
+ self->linktype = DLT_C_HDLC;
+ break;
+ case 106: /* LINKTYPE_ATM_CLIP */
+ self->linktype = DLT_ATM_CLIP;
+ break;
+ case 50: /* LINKTYPE_PPP_HDLC */
+ self->linktype = DLT_PPP_SERIAL;
+ break;
+ case 51: /* LINKTYPE_PPP_ETHER */
+ self->linktype = DLT_PPP_ETHER;
+ break;
+ default:
+ self->linktype = self->network;
+ }
+
+ free(self->buf);
+ lfatal_oom(self->buf = malloc(self->snaplen));
+ self->prod_pkt.snaplen = self->snaplen;
+ self->prod_pkt.linktype = self->linktype;
+ self->prod_pkt.is_swapped = self->is_swapped;
+
+ ldebug("pcap v%u.%u snaplen:%lu %s", self->version_major, self->version_minor, self->snaplen, self->is_swapped ? " swapped" : "");
+
+ return 0;
+}
+
+int input_zmmpcap_run(input_zmmpcap_t* self)
+{
+ struct {
+ uint32_t ts_sec;
+ uint32_t ts_usec;
+ uint32_t incl_len;
+ uint32_t orig_len;
+ } hdr;
+ int ret;
+ core_object_pcap_t pkt = CORE_OBJECT_PCAP_INIT(0);
+ mlassert_self();
+
+ if (self->map == MAP_FAILED) {
+ lfatal("no PCAP opened");
+ }
+ if (!self->recv) {
+ lfatal("no receiver set");
+ }
+
+ pkt.snaplen = self->snaplen;
+ pkt.linktype = self->linktype;
+ pkt.is_swapped = self->is_swapped;
+
+ while ((ret = _read(self, &hdr, 16, 0)) == 16) {
+ if (self->is_swapped) {
+ hdr.ts_sec = bswap_32(hdr.ts_sec);
+ hdr.ts_usec = bswap_32(hdr.ts_usec);
+ hdr.incl_len = bswap_32(hdr.incl_len);
+ hdr.orig_len = bswap_32(hdr.orig_len);
+ }
+ if (hdr.incl_len > self->snaplen) {
+ lwarning("invalid packet length, larger then snaplen");
+ return -1;
+ }
+ pkt.bytes = (unsigned char*)self->buf;
+ if (_read(self, self->buf, hdr.incl_len, (void**)&pkt.bytes) != hdr.incl_len) {
+ lwarning("could not read all of packet, aborting");
+ return -1;
+ }
+
+ self->pkts++;
+
+ pkt.ts.sec = hdr.ts_sec;
+ if (self->is_nanosec) {
+ pkt.ts.nsec = hdr.ts_usec;
+ } else {
+ pkt.ts.nsec = hdr.ts_usec * 1000;
+ }
+ pkt.caplen = hdr.incl_len;
+ pkt.len = hdr.orig_len;
+
+ self->recv(self->ctx, (core_object_t*)&pkt);
+ }
+ if (ret) {
+ lwarning("could not read next PCAP header, aborting");
+ return -1;
+ }
+
+ return 0;
+}
+
+static const core_object_t* _produce(input_zmmpcap_t* self)
+{
+ struct {
+ uint32_t ts_sec;
+ uint32_t ts_usec;
+ uint32_t incl_len;
+ uint32_t orig_len;
+ } hdr;
+ int ret;
+ mlassert_self();
+
+ if (self->is_broken) {
+ lwarning("PCAP is broken, will not read next packet");
+ return 0;
+ }
+
+ if ((ret = _read(self, &hdr, 16, 0)) != 16) {
+ if (ret) {
+ lwarning("could not read next PCAP header, aborting");
+ self->is_broken = 1;
+ }
+ return 0;
+ }
+
+ if (self->is_swapped) {
+ hdr.ts_sec = bswap_32(hdr.ts_sec);
+ hdr.ts_usec = bswap_32(hdr.ts_usec);
+ hdr.incl_len = bswap_32(hdr.incl_len);
+ hdr.orig_len = bswap_32(hdr.orig_len);
+ }
+ if (hdr.incl_len > self->snaplen) {
+ lwarning("invalid packet length, larger then snaplen");
+ self->is_broken = 1;
+ return 0;
+ }
+ self->prod_pkt.bytes = (unsigned char*)self->buf;
+ if (_read(self, self->buf, hdr.incl_len, (void**)&self->prod_pkt.bytes) != hdr.incl_len) {
+ lwarning("could not read all of packet, aborting");
+ self->is_broken = 1;
+ return 0;
+ }
+
+ self->pkts++;
+
+ self->prod_pkt.ts.sec = hdr.ts_sec;
+ if (self->is_nanosec) {
+ self->prod_pkt.ts.nsec = hdr.ts_usec;
+ } else {
+ self->prod_pkt.ts.nsec = hdr.ts_usec * 1000;
+ }
+ self->prod_pkt.caplen = hdr.incl_len;
+ self->prod_pkt.len = hdr.orig_len;
+
+ return (core_object_t*)&self->prod_pkt;
+}
+
+core_producer_t input_zmmpcap_producer(input_zmmpcap_t* self)
+{
+ mlassert_self();
+
+ if (self->map == MAP_FAILED) {
+ lfatal("no PCAP opened");
+ }
+
+ return (core_producer_t)_produce;
+}
diff --git a/src/input/zmmpcap.h b/src/input/zmmpcap.h
new file mode 100644
index 0000000..baea3f5
--- /dev/null
+++ b/src/input/zmmpcap.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2018-2024 OARC, Inc.
+ * All rights reserved.
+ *
+ * This file is part of dnsjit.
+ *
+ * dnsjit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * dnsjit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <dnsjit/core/log.h>
+#include <dnsjit/core/receiver.h>
+#include <dnsjit/core/producer.h>
+#include <dnsjit/core/object/pcap.h>
+
+#ifndef __dnsjit_input_zmmpcap_h
+#define __dnsjit_input_zmmpcap_h
+
+#include <dnsjit/input/zmmpcap.hh>
+
+#endif
diff --git a/src/input/zmmpcap.hh b/src/input/zmmpcap.hh
new file mode 100644
index 0000000..7e930cf
--- /dev/null
+++ b/src/input/zmmpcap.hh
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018-2024 OARC, Inc.
+ * All rights reserved.
+ *
+ * This file is part of dnsjit.
+ *
+ * dnsjit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * dnsjit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
+
+typedef enum input_zmmpcap_type {
+ input_zmmpcap_type_none,
+ input_zmmpcap_type_lz4,
+ input_zmmpcap_type_zstd,
+ input_zmmpcap_type_gzip,
+ input_zmmpcap_type_lzma
+} input_zmmpcap_type_t;
+
+typedef struct input_zmmpcap {
+ core_log_t _log;
+ core_receiver_t recv;
+ void* ctx;
+
+ uint8_t is_swapped;
+ uint8_t is_nanosec;
+ uint8_t is_broken;
+
+ core_object_pcap_t prod_pkt;
+
+ input_zmmpcap_type_t compression;
+ void* comp_ctx;
+
+ void* out;
+ size_t out_size;
+ size_t out_have;
+ size_t out_at;
+
+ int fd;
+ size_t len, at;
+ size_t pkts;
+ uint8_t *map, *buf;
+
+ uint32_t magic_number;
+ uint16_t version_major;
+ uint16_t version_minor;
+ int32_t thiszone;
+ uint32_t sigfigs;
+ uint32_t snaplen;
+ uint32_t network;
+
+ uint32_t linktype;
+} input_zmmpcap_t;
+
+core_log_t* input_zmmpcap_log();
+
+void input_zmmpcap_init(input_zmmpcap_t* self);
+void input_zmmpcap_destroy(input_zmmpcap_t* self);
+int input_zmmpcap_open(input_zmmpcap_t* self, const char* file);
+int input_zmmpcap_run(input_zmmpcap_t* self);
+int input_zmmpcap_have_support(input_zmmpcap_t* self);
+
+core_producer_t input_zmmpcap_producer(input_zmmpcap_t* self);
diff --git a/src/input/zmmpcap.lua b/src/input/zmmpcap.lua
new file mode 100644
index 0000000..7646869
--- /dev/null
+++ b/src/input/zmmpcap.lua
@@ -0,0 +1,149 @@
+-- Copyright (c) 2018-2024 OARC, Inc.
+-- All rights reserved.
+--
+-- This file is part of dnsjit.
+--
+-- dnsjit is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- dnsjit is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
+
+-- dnsjit.input.zmmpcap
+-- Read input from a PCAP file using mmap()
+-- local input = require("dnsjit.input.zmmpcap").new()
+-- input:zstd()
+-- input:open("file.pcap.zst")
+-- input:receiver(filter_or_output)
+-- input:run()
+--
+-- Read input from a PCAP file by mapping the whole file to memory using
+-- .B mmap()
+-- and parse the PCAP without libpcap.
+-- After opening a file and reading the PCAP header, the attributes are
+-- populated.
+-- .SS Attributes
+-- .TP
+-- is_swapped
+-- Indicate if the byte order in the PCAP is in reverse order of the host.
+-- .TP
+-- is_nanosec
+-- Indicate if the time stamps are in nanoseconds or not.
+-- .TP
+-- magic_number
+-- Magic number.
+-- .TP
+-- version_major
+-- Major version number.
+-- .TP
+-- version_minor
+-- Minor version number.
+-- .TP
+-- thiszone
+-- GMT to local correction.
+-- .TP
+-- sigfigs
+-- Accuracy of timestamps.
+-- .TP
+-- snaplen
+-- Max length of captured packets, in octets.
+-- .TP
+-- network
+-- The link type found in the PCAP header, see https://www.tcpdump.org/linktypes.html .
+-- .TP
+-- linktype
+-- The data link type, mapped from
+-- .IR network .
+module(...,package.seeall)
+
+require("dnsjit.input.zmmpcap_h")
+local ffi = require("ffi")
+local C = ffi.C
+
+local t_name = "input_zmmpcap_t"
+local input_zmmpcap_t = ffi.typeof(t_name)
+local Zmmpcap = {}
+
+-- Create a new Zmmpcap input.
+function Zmmpcap.new()
+ local self = {
+ _receiver = nil,
+ obj = input_zmmpcap_t(),
+ }
+ C.input_zmmpcap_init(self.obj)
+ ffi.gc(self.obj, C.input_zmmpcap_destroy)
+ return setmetatable(self, { __index = Zmmpcap })
+end
+
+-- Return the Log object to control logging of this instance or module.
+function Zmmpcap:log()
+ if self == nil then
+ return C.input_zmmpcap_log()
+ end
+ return self.obj._log
+end
+
+-- Set the receiver to pass objects to.
+function Zmmpcap:receiver(o)
+ self.obj.recv, self.obj.ctx = o:receive()
+ self._receiver = o
+end
+
+-- Return the C functions and context for producing objects.
+function Zmmpcap:produce()
+ return C.input_zmmpcap_producer(self.obj), self.obj
+end
+
+-- Use liblz4 to decompress the input file/data.
+function Zmmpcap:lz4()
+ self.obj.compression = "input_zmmpcap_type_lz4"
+end
+
+-- Use libzstd to decompress the input file/data.
+function Zmmpcap:zstd()
+ self.obj.compression = "input_zmmpcap_type_zstd"
+end
+
+-- Use zlib/gzip to decompress the input file/data.
+function Zmmpcap:gzip()
+ self.obj.compression = "input_zmmpcap_type_gzip"
+end
+
+-- Use liblzma/xz to decompress the input file/data.
+function Zmmpcap:lzma()
+ self.obj.compression = "input_zmmpcap_type_lzma"
+end
+
+-- Return true if support for selected compression library is built in.
+function Zmmpcap:have_support()
+ if C.input_zmmpcap_have_support(self.obj) == 1 then
+ return true
+ end
+ return false
+end
+
+-- Open a PCAP file for processing and read the PCAP header.
+-- Returns 0 on success.
+function Zmmpcap:open(file)
+ return C.input_zmmpcap_open(self.obj, file)
+end
+
+-- Start processing packets and send each packet read to the receiver.
+-- Returns 0 if all packets was read successfully.
+function Zmmpcap:run()
+ return C.input_zmmpcap_run(self.obj)
+end
+
+-- Return the number of packets seen.
+function Zmmpcap:packets()
+ return tonumber(self.obj.pkts)
+end
+
+return Zmmpcap
diff --git a/src/input/zpcap.c b/src/input/zpcap.c
index d62714c..dfeb89b 100644
--- a/src/input/zpcap.c
+++ b/src/input/zpcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -53,6 +53,7 @@
#endif
#include <pcap/pcap.h>
#include <string.h>
+#include <unistd.h>
#ifdef HAVE_LZ4
#include <lz4frame.h>
@@ -62,6 +63,7 @@ struct _lz4_ctx {
};
#define lz4 ((struct _lz4_ctx*)self->comp_ctx)
#endif
+
#ifdef HAVE_ZSTD
#include <zstd.h>
struct _zstd_ctx {
@@ -72,6 +74,21 @@ struct _zstd_ctx {
#define zstd ((struct _zstd_ctx*)self->comp_ctx)
#endif
+#include <zlib.h>
+struct _gzip_ctx {
+ gzFile fp;
+};
+#define gzip ((struct _gzip_ctx*)self->comp_ctx)
+
+#ifdef HAVE_LZMA
+#include <lzma.h>
+struct _lzma_ctx {
+ lzma_stream strm;
+};
+static lzma_stream lzma_stream_init = LZMA_STREAM_INIT;
+#define lzma ((struct _lzma_ctx*)self->comp_ctx)
+#endif
+
#define MAX_SNAPLEN 0x40000
static core_log_t _log = LOG_T_INIT("input.zpcap");
@@ -108,10 +125,8 @@ void input_zpcap_destroy(input_zpcap_t* self)
case input_zpcap_type_lz4: {
LZ4F_errorCode_t code;
- if (lz4) {
- if (lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
- lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
- }
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
}
free(lz4);
free(self->in);
@@ -121,16 +136,29 @@ void input_zpcap_destroy(input_zpcap_t* self)
#endif
#ifdef HAVE_ZSTD
case input_zpcap_type_zstd:
- if (zstd) {
- if (zstd->ctx) {
- ZSTD_freeDCtx(zstd->ctx);
- }
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
}
free(zstd);
free(self->in);
free(self->out);
break;
#endif
+ case input_zpcap_type_gzip:
+ if (gzip && gzip->fp) {
+ gzclose(gzip->fp);
+ }
+ free(gzip);
+ break;
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma:
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ free(self->out);
+ break;
+#endif
default:
break;
}
@@ -148,7 +176,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
case input_zpcap_type_lz4: {
size_t need = len;
- if (dstp && self->out_have > need) {
+ if (dstp && self->out_have >= need) {
*dstp = self->out + self->out_at;
self->out_have -= need;
self->out_at += need;
@@ -156,7 +184,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
}
for (;;) {
- if (self->out_have > need) {
+ if (self->out_have >= need) {
memcpy(dst, self->out + self->out_at, need);
self->out_have -= need;
self->out_at += need;
@@ -201,7 +229,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
case input_zpcap_type_zstd: {
size_t need = len;
- if (dstp && self->out_have > need) {
+ if (dstp && self->out_have >= need) {
*dstp = self->out + self->out_at;
self->out_have -= need;
self->out_at += need;
@@ -209,7 +237,7 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
}
for (;;) {
- if (self->out_have > need) {
+ if (self->out_have >= need) {
memcpy(dst, self->out + self->out_at, need);
self->out_have -= need;
self->out_at += need;
@@ -241,6 +269,59 @@ static ssize_t _read(input_zpcap_t* self, void* dst, size_t len, void** dstp)
}
}
#endif
+ case input_zpcap_type_gzip:
+ return gzfread(dst, 1, len, gzip->fp);
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma: {
+ size_t need = len;
+
+ if (dstp && self->out_have >= need) {
+ *dstp = self->out + self->out_at;
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ lzma_action action = LZMA_RUN;
+ uint8_t inbuf[BUFSIZ];
+ for (;;) {
+ if (self->out_have >= need) {
+ memcpy(dst, self->out + self->out_at, need);
+ self->out_have -= need;
+ self->out_at += need;
+ return len;
+ }
+
+ memcpy(dst, self->out + self->out_at, self->out_have);
+ need -= self->out_have;
+ dst += self->out_have;
+
+ ssize_t n = fread(inbuf, 1, sizeof(inbuf), self->file);
+ if (n < 0) {
+ return n;
+ }
+ if (!n) {
+ action = LZMA_FINISH;
+ }
+
+ lzma->strm.next_in = inbuf;
+ lzma->strm.avail_in = n;
+ lzma->strm.next_out = self->out;
+ lzma->strm.avail_out = self->out_size;
+
+ lzma_ret ret = lzma_code(&lzma->strm, action);
+ if (ret != LZMA_OK) {
+ if (ret == LZMA_STREAM_END) {
+ return 0;
+ }
+ lfatal("lzma_code() failed: %d", ret);
+ }
+
+ self->out_at = 0;
+ self->out_have = self->out_size - lzma->strm.avail_out;
+ }
+ }
+#endif
default:
return 0;
}
@@ -265,10 +346,8 @@ static int _open(input_zpcap_t* self)
case input_zpcap_type_lz4: {
LZ4F_errorCode_t code;
- if (lz4) {
- if (lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
- lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
- }
+ if (lz4 && lz4->ctx && (code = LZ4F_freeDecompressionContext(lz4->ctx))) {
+ lfatal("LZ4F_freeDecompressionContext() failed: %s", LZ4F_getErrorName(code));
}
free(lz4);
free(self->in);
@@ -290,10 +369,8 @@ static int _open(input_zpcap_t* self)
#endif
#ifdef HAVE_ZSTD
case input_zpcap_type_zstd:
- if (zstd) {
- if (zstd->ctx) {
- ZSTD_freeDCtx(zstd->ctx);
- }
+ if (zstd && zstd->ctx) {
+ ZSTD_freeDCtx(zstd->ctx);
}
free(zstd);
free(self->in);
@@ -311,6 +388,39 @@ static int _open(input_zpcap_t* self)
zstd->out.size = self->out_size;
break;
#endif
+ case input_zpcap_type_gzip:
+ free(gzip);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _gzip_ctx)));
+
+ int fd = dup(fileno((FILE*)self->file));
+ if (!(gzip->fp = gzdopen(fd, "rb"))) {
+ lcritical("gzdopen(%d) error: %s", fd, core_log_errstr(errno));
+ close(fd);
+ return -1;
+ }
+ break;
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma:
+ if (lzma) {
+ lzma_end(&lzma->strm);
+ }
+ free(lzma);
+ free(self->out);
+
+ lfatal_oom(self->comp_ctx = calloc(1, sizeof(struct _lzma_ctx)));
+ lzma->strm = lzma_stream_init;
+ lzma_ret ret = lzma_stream_decoder(&lzma->strm, UINT64_MAX, LZMA_CONCATENATED);
+ if (ret != LZMA_OK) {
+ lcritical("lzma_stream_decoder() error: %d", ret);
+ return -1;
+ }
+
+ self->out_size = 256 * 1024;
+ lfatal_oom(self->out = malloc(self->out_size));
+
+ break;
+#endif
default:
lcritical("no support for selected compression");
return -2;
@@ -393,6 +503,7 @@ static int _open(input_zpcap_t* self)
self->linktype = self->network;
}
+ free(self->buf);
lfatal_oom(self->buf = malloc(self->snaplen));
self->prod_pkt.snaplen = self->snaplen;
self->prod_pkt.linktype = self->linktype;
@@ -508,6 +619,12 @@ int input_zpcap_have_support(input_zpcap_t* self)
case input_zpcap_type_zstd:
return 1;
#endif
+ case input_zpcap_type_gzip:
+ return 1;
+#ifdef HAVE_LZMA
+ case input_zpcap_type_lzma:
+ return 1;
+#endif
default:
break;
}
diff --git a/src/input/zpcap.h b/src/input/zpcap.h
index 275c623..cab85bb 100644
--- a/src/input/zpcap.h
+++ b/src/input/zpcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/input/zpcap.hh b/src/input/zpcap.hh
index b683306..596fc2b 100644
--- a/src/input/zpcap.hh
+++ b/src/input/zpcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,15 +18,17 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.pcap_h")
typedef enum input_zpcap_type {
input_zpcap_type_none,
input_zpcap_type_lz4,
- input_zpcap_type_zstd
+ input_zpcap_type_zstd,
+ input_zpcap_type_gzip,
+ input_zpcap_type_lzma
} input_zpcap_type_t;
typedef struct input_zpcap {
diff --git a/src/input/zpcap.lua b/src/input/zpcap.lua
index 93b730b..5f2869c 100644
--- a/src/input/zpcap.lua
+++ b/src/input/zpcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
@@ -119,6 +119,16 @@ function Zpcap:zstd()
self.obj.compression = "input_zpcap_type_zstd"
end
+-- Use zlib/gzip to decompress the input file/data.
+function Zpcap:gzip()
+ self.obj.compression = "input_zpcap_type_gzip"
+end
+
+-- Use liblzma/xz to decompress the input file/data.
+function Zpcap:lzma()
+ self.obj.compression = "input_zpcap_type_lzma"
+end
+
-- Return true if support for selected compression library is built in.
function Zpcap:have_support()
if C.input_zpcap_have_support(self.obj) == 1 then
diff --git a/src/lib.lua b/src/lib.lua
index 6741eb3..c3c7c84 100644
--- a/src/lib.lua
+++ b/src/lib.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/lib/clock.c b/src/lib/clock.c
index a5889ef..9e1c2a3 100644
--- a/src/lib/clock.c
+++ b/src/lib/clock.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/lib/clock.h b/src/lib/clock.h
index b00d4fe..45120d9 100644
--- a/src/lib/clock.h
+++ b/src/lib/clock.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/lib/clock.hh b/src/lib/clock.hh
index f69a1bc..77e1308 100644
--- a/src/lib/clock.hh
+++ b/src/lib/clock.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,7 +18,7 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.timespec_h")
typedef enum lib_clock_clkid {
LIB_CLOCK_REALTIME,
diff --git a/src/lib/clock.lua b/src/lib/clock.lua
index cdad30e..74c1857 100644
--- a/src/lib/clock.lua
+++ b/src/lib/clock.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/lib/getopt.lua b/src/lib/getopt.lua
index 416a658..0622dda 100644
--- a/src/lib/getopt.lua
+++ b/src/lib/getopt.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/lib/ip.lua b/src/lib/ip.lua
index 48b69e5..839af9b 100644
--- a/src/lib/ip.lua
+++ b/src/lib/ip.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/lib/parseconf.lua b/src/lib/parseconf.lua
index 374e9aa..45e04ca 100644
--- a/src/lib/parseconf.lua
+++ b/src/lib/parseconf.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/lib/trie.c b/src/lib/trie.c
index 158c5ca..7a39a7d 100644
--- a/src/lib/trie.c
+++ b/src/lib/trie.c
@@ -39,17 +39,17 @@ enum knot_error {
&& __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
/*!
- * \brief Use a pointer alignment hack to save memory.
- *
- * When on, isbranch() relies on the fact that in leaf_t the first pointer
- * is aligned on multiple of 4 bytes and that the flags bitfield is
- * overlaid over the lowest two bits of that pointer.
- * Neither is really guaranteed by the C standards; the second part should
- * be OK with x86_64 ABI and most likely any other little-endian platform.
- * It would be possible to manipulate the right bits portably, but it would
- * complicate the code nontrivially. C++ doesn't even guarantee type-punning.
- * In debug mode we check this works OK when creating a new trie instance.
- */
+ * \brief Use a pointer alignment hack to save memory.
+ *
+ * When on, isbranch() relies on the fact that in leaf_t the first pointer
+ * is aligned on multiple of 4 bytes and that the flags bitfield is
+ * overlaid over the lowest two bits of that pointer.
+ * Neither is really guaranteed by the C standards; the second part should
+ * be OK with x86_64 ABI and most likely any other little-endian platform.
+ * It would be possible to manipulate the right bits portably, but it would
+ * complicate the code nontrivially. C++ doesn't even guarantee type-punning.
+ * In debug mode we check this works OK when creating a new trie instance.
+ */
#define FLAGS_HACK 1
#else
#define FLAGS_HACK 0
@@ -490,6 +490,10 @@ static int ns_longer_alloc(nstack_t* ns)
memcpy(st, ns->stack, ns->len * sizeof(node_t*));
} else {
st = realloc(ns->stack, new_size);
+ if (st == NULL) {
+ free(ns->stack); // left behind by realloc, callers bail out
+ ns->stack = NULL;
+ }
}
if (st == NULL)
return KNOT_ENOMEM;
@@ -732,8 +736,8 @@ int trie_get_leq(trie_t* tbl, const uint8_t* key, uint32_t len, trie_val_t** val
// but try the previous child if key was less (it may not exist)
bitmap_t b = twigbit(t, key, len);
int i = hastwig(t, b)
- ? twigoff(t, b) - (un_key < un_leaf)
- : twigoff(t, b) - 1 /*twigoff returns successor when !hastwig*/;
+ ? twigoff(t, b) - (un_key < un_leaf)
+ : twigoff(t, b) - 1 /*twigoff returns successor when !hastwig*/;
if (i >= 0) {
ERR_RETURN(ns_longer(ns));
ns->stack[ns->len++] = twig(t, i);
diff --git a/src/output.lua b/src/output.lua
index a565c2c..de21a96 100644
--- a/src/output.lua
+++ b/src/output.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/dnscli.c b/src/output/dnscli.c
index d7e0a14..ad25b1c 100644
--- a/src/output/dnscli.c
+++ b/src/output/dnscli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -212,7 +212,7 @@ int output_dnscli_connect(output_dnscli_t* self, const char* host, const char* p
}
if (self->timeout.sec > 0 || self->timeout.nsec > 0) {
self->poll.fd = self->fd;
- self->poll_timeout = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); //NOSONAR
+ self->poll_timeout = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); // NOSONAR
if (!self->poll_timeout) {
self->poll_timeout = 1;
}
diff --git a/src/output/dnscli.h b/src/output/dnscli.h
index 4026558..1cf352e 100644
--- a/src/output/dnscli.h
+++ b/src/output/dnscli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/dnscli.hh b/src/output/dnscli.hh
index bf579df..f86bccc 100644
--- a/src/output/dnscli.hh
+++ b/src/output/dnscli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,12 +18,12 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef enum output_dnscli_mode {
OUTPUT_DNSCLI_MODE_NONE = 0,
diff --git a/src/output/dnscli.lua b/src/output/dnscli.lua
index e19a2f4..7b308c0 100644
--- a/src/output/dnscli.lua
+++ b/src/output/dnscli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/null.lua b/src/output/null.lua
index 07e84a6..4c5c1e0 100644
--- a/src/output/null.lua
+++ b/src/output/null.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/pcap.c b/src/output/pcap.c
index 749a36b..3ac6a70 100644
--- a/src/output/pcap.c
+++ b/src/output/pcap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/pcap.h b/src/output/pcap.h
index e40c8ca..b326e48 100644
--- a/src/output/pcap.h
+++ b/src/output/pcap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/pcap.hh b/src/output/pcap.hh
index aecf3bd..43e0fb7 100644
--- a/src/output/pcap.hh
+++ b/src/output/pcap.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -22,9 +22,9 @@
typedef struct pcap_dumper {} pcap_dumper_t;
#endif
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.input.pcap_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.input.pcap_h")
typedef struct output_pcap {
core_log_t _log;
diff --git a/src/output/pcap.lua b/src/output/pcap.lua
index 7b9a56a..3c62bb2 100644
--- a/src/output/pcap.lua
+++ b/src/output/pcap.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/respdiff.c b/src/output/respdiff.c
index 7a2927a..b245e67 100644
--- a/src/output/respdiff.c
+++ b/src/output/respdiff.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/respdiff.h b/src/output/respdiff.h
index 881cfe4..2d9fee5 100644
--- a/src/output/respdiff.h
+++ b/src/output/respdiff.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/respdiff.hh b/src/output/respdiff.hh
index 4cdd22e..6edda6e 100644
--- a/src/output/respdiff.hh
+++ b/src/output/respdiff.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,8 +18,8 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
typedef struct output_respdiff {
core_log_t _log;
diff --git a/src/output/respdiff.lua b/src/output/respdiff.lua
index 5364853..78831ff 100644
--- a/src/output/respdiff.lua
+++ b/src/output/respdiff.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/tcpcli.c b/src/output/tcpcli.c
index df1a73c..9d76a03 100644
--- a/src/output/tcpcli.c
+++ b/src/output/tcpcli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -270,7 +270,7 @@ static const core_object_t* _produce(output_tcpcli_t* self)
p.fd = self->fd;
p.events = POLLIN;
p.revents = 0;
- to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); //NOSONAR
+ to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); // NOSONAR
if (!to) {
to = 1;
}
diff --git a/src/output/tcpcli.h b/src/output/tcpcli.h
index 9cd455c..a44018b 100644
--- a/src/output/tcpcli.h
+++ b/src/output/tcpcli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/tcpcli.hh b/src/output/tcpcli.hh
index a270c09..e538100 100644
--- a/src/output/tcpcli.hh
+++ b/src/output/tcpcli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,11 +18,11 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct output_tcpcli {
core_log_t _log;
diff --git a/src/output/tcpcli.lua b/src/output/tcpcli.lua
index 4f9108f..98bcfb5 100644
--- a/src/output/tcpcli.lua
+++ b/src/output/tcpcli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/tlscli.c b/src/output/tlscli.c
index cd1aac0..d9a85e7 100644
--- a/src/output/tlscli.c
+++ b/src/output/tlscli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/tlscli.h b/src/output/tlscli.h
index 3eae045..83d2449 100644
--- a/src/output/tlscli.h
+++ b/src/output/tlscli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/tlscli.hh b/src/output/tlscli.hh
index b0cbf38..355e9ae 100644
--- a/src/output/tlscli.hh
+++ b/src/output/tlscli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,12 +18,12 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct output_tlscli {
core_log_t _log;
diff --git a/src/output/tlscli.lua b/src/output/tlscli.lua
index b5ac762..ee7fbfe 100644
--- a/src/output/tlscli.lua
+++ b/src/output/tlscli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/output/udpcli.c b/src/output/udpcli.c
index ae89c84..85894cc 100644
--- a/src/output/udpcli.c
+++ b/src/output/udpcli.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -242,7 +242,7 @@ static const core_object_t* _produce_block(output_udpcli_t* self)
p.fd = self->fd;
p.events = POLLIN;
p.revents = 0;
- to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); //NOSONAR
+ to = (self->timeout.sec * 1e3) + (self->timeout.nsec / 1e6); // NOSONAR
if (!to) {
to = 1;
}
diff --git a/src/output/udpcli.h b/src/output/udpcli.h
index 4c8b594..0aec60f 100644
--- a/src/output/udpcli.h
+++ b/src/output/udpcli.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
diff --git a/src/output/udpcli.hh b/src/output/udpcli.hh
index d74623d..c7cbf83 100644
--- a/src/output/udpcli.hh
+++ b/src/output/udpcli.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -18,12 +18,12 @@
* along with dnsjit. If not, see <http://www.gnu.org/licenses/>.
*/
-//lua:require("dnsjit.core.compat_h")
-//lua:require("dnsjit.core.log")
-//lua:require("dnsjit.core.receiver_h")
-//lua:require("dnsjit.core.producer_h")
-//lua:require("dnsjit.core.object.payload_h")
-//lua:require("dnsjit.core.timespec_h")
+// lua:require("dnsjit.core.compat_h")
+// lua:require("dnsjit.core.log")
+// lua:require("dnsjit.core.receiver_h")
+// lua:require("dnsjit.core.producer_h")
+// lua:require("dnsjit.core.object.payload_h")
+// lua:require("dnsjit.core.timespec_h")
typedef struct output_udpcli {
core_log_t _log;
diff --git a/src/output/udpcli.lua b/src/output/udpcli.lua
index 4537d66..575f19d 100644
--- a/src/output/udpcli.lua
+++ b/src/output/udpcli.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2018-2023, OARC, Inc.
+-- Copyright (c) 2018-2024 OARC, Inc.
-- All rights reserved.
--
-- This file is part of dnsjit.
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index 42189ca..a3f343f 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -23,7 +23,8 @@ CLEANFILES = test*.log test*.trs test*.out \
TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \
test-trie.sh test-base64url.sh
-test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist
+test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist \
+ dns.pcap.xz-dist dns.pcap.gz-dist
test2.sh: dns.pcap-dist
@@ -46,7 +47,13 @@ test-trie.sh: pellets.pcap-dist dns.pcap-dist
.zst.zst-dist:
cp "$<" "$@"
+.xz.xz-dist:
+ cp "$<" "$@"
+
+.gz.gz-dist:
+ cp "$<" "$@"
+
EXTRA_DIST = $(TESTS) \
dns.pcap pellets.pcap test_ipsplit.lua test_trie.lua test_base64url.lua \
test1.gold test2.gold test3.gold test4.gold test_compressupport.lua \
- dns.pcap.lz4 dns.pcap.zst
+ dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index 77f7f4d..713d49a 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -14,7 +14,7 @@
@SET_MAKE@
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -471,6 +471,8 @@ libdir = @libdir@
libexecdir = @libexecdir@
liblz4_CFLAGS = @liblz4_CFLAGS@
liblz4_LIBS = @liblz4_LIBS@
+liblzma_CFLAGS = @liblzma_CFLAGS@
+liblzma_LIBS = @liblzma_LIBS@
libpcap_CFLAGS = @libpcap_CFLAGS@
libpcap_LIBS = @libpcap_LIBS@
libzstd_CFLAGS = @libzstd_CFLAGS@
@@ -505,12 +507,12 @@ TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \
EXTRA_DIST = $(TESTS) \
dns.pcap pellets.pcap test_ipsplit.lua test_trie.lua test_base64url.lua \
test1.gold test2.gold test3.gold test4.gold test_compressupport.lua \
- dns.pcap.lz4 dns.pcap.zst
+ dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz
all: all-am
.SUFFIXES:
-.SUFFIXES: .log .lz4 .lz4-dist .pcap .pcap-dist .test .test$(EXEEXT) .trs .zst .zst-dist
+.SUFFIXES: .gz .gz-dist .log .lz4 .lz4-dist .pcap .pcap-dist .test .test$(EXEEXT) .trs .xz .xz-dist .zst .zst-dist
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -926,7 +928,8 @@ uninstall-am:
.PRECIOUS: Makefile
-test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist
+test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist \
+ dns.pcap.xz-dist dns.pcap.gz-dist
test2.sh: dns.pcap-dist
@@ -949,6 +952,12 @@ test-trie.sh: pellets.pcap-dist dns.pcap-dist
.zst.zst-dist:
cp "$<" "$@"
+.xz.xz-dist:
+ cp "$<" "$@"
+
+.gz.gz-dist:
+ cp "$<" "$@"
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/src/test/dns.pcap.gz b/src/test/dns.pcap.gz
new file mode 100644
index 0000000..5ad94b4
--- /dev/null
+++ b/src/test/dns.pcap.gz
Binary files differ
diff --git a/src/test/dns.pcap.xz b/src/test/dns.pcap.xz
new file mode 100644
index 0000000..064f4a5
--- /dev/null
+++ b/src/test/dns.pcap.xz
Binary files differ
diff --git a/src/test/test1.sh b/src/test/test1.sh
index 4b403d5..400b92c 100755
--- a/src/test/test1.sh
+++ b/src/test/test1.sh
@@ -1,5 +1,5 @@
-#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+#!/bin/sh -ex
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
@@ -29,3 +29,28 @@ if echo "$support"|grep -q zstd; then
../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.zst-dist zstd >test1.out
diff "$srcdir/test1.gold" test1.out
fi
+if echo "$support"|grep -q lzma; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.xz-dist xz >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q gzip; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.gz-dist gz >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+
+if echo "$support"|grep -q lz4; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.lz4-dist lz4 mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q zstd; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.zst-dist zstd mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q lzma; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.xz-dist xz mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
+if echo "$support"|grep -q gzip; then
+ ../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap.gz-dist gz mmap >test1.out
+ diff "$srcdir/test1.gold" test1.out
+fi
diff --git a/src/test/test2.sh b/src/test/test2.sh
index bc5e502..40c0928 100755
--- a/src/test/test2.sh
+++ b/src/test/test2.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/src/test/test3.sh b/src/test/test3.sh
index 5a0af46..e8e6a71 100755
--- a/src/test/test3.sh
+++ b/src/test/test3.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/src/test/test4.sh b/src/test/test4.sh
index 2c21a75..b72c781 100755
--- a/src/test/test4.sh
+++ b/src/test/test4.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/src/test/test6.sh b/src/test/test6.sh
index b83b193..23c3575 100755
--- a/src/test/test6.sh
+++ b/src/test/test6.sh
@@ -1,5 +1,5 @@
#!/bin/sh -e
-# Copyright (c) 2018-2023, OARC, Inc.
+# Copyright (c) 2018-2024 OARC, Inc.
# All rights reserved.
#
# This file is part of dnsjit.
diff --git a/src/test/test_compressupport.lua b/src/test/test_compressupport.lua
index 9d4502e..b7818d8 100644
--- a/src/test/test_compressupport.lua
+++ b/src/test/test_compressupport.lua
@@ -8,3 +8,11 @@ zpcap:zstd()
if zpcap:have_support() then
print("zstd")
end
+zpcap:lzma()
+if zpcap:have_support() then
+ print("lzma")
+end
+zpcap:gzip()
+if zpcap:have_support() then
+ print("gzip")
+end
diff --git a/src/version.h b/src/version.h
index 94a09d3..94fffa0 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2023, OARC, Inc.
+ * Copyright (c) 2018-2024 OARC, Inc.
* All rights reserved.
*
* This file is part of dnsjit.
@@ -22,7 +22,7 @@
#define __dnsjit_version_h
#define DNSJIT_MAJOR_VERSION 1
-#define DNSJIT_MINOR_VERSION 3
+#define DNSJIT_MINOR_VERSION 4
#define DNSJIT_PATCH_VERSION 0
#endif