From 01446c9ac8cf6cc155e94d152a020f1aef017fab Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 21 Apr 2025 09:36:45 +0200 Subject: [PATCH] Adding upstream version 1.5.0. Signed-off-by: Daniel Baumann --- CHANGES | 41 + Makefile.am | 2 +- Makefile.in | 3 +- README.md | 2 +- aclocal.m4 | 90 +- configure | 443 ++++++--- configure.ac | 6 +- examples/Makefile.am | 2 +- examples/Makefile.in | 3 +- examples/pcap2tcpdns.lua | 34 +- include/dnsjit/Makefile.am | 19 +- include/dnsjit/Makefile.in | 196 ++-- include/dnsjit/core.lua | 2 +- include/dnsjit/core/assert.h | 2 +- include/dnsjit/core/channel.c | 2 +- include/dnsjit/core/channel.h | 2 +- include/dnsjit/core/channel.hh | 2 +- include/dnsjit/core/channel.lua | 2 +- include/dnsjit/core/compat.c | 2 +- include/dnsjit/core/compat.h | 2 +- include/dnsjit/core/compat.lua | 2 +- include/dnsjit/core/file.c | 2 +- include/dnsjit/core/file.h | 2 +- include/dnsjit/core/file.hh | 2 +- include/dnsjit/core/file.lua | 2 +- include/dnsjit/core/loader.lua | 2 +- include/dnsjit/core/log.c | 2 +- include/dnsjit/core/log.h | 2 +- include/dnsjit/core/log.hh | 2 +- include/dnsjit/core/log.lua | 2 +- include/dnsjit/core/object.c | 8 +- include/dnsjit/core/object.h | 3 +- include/dnsjit/core/object.hh | 2 +- include/dnsjit/core/object.lua | 7 +- include/dnsjit/core/object/dns.c | 32 +- include/dnsjit/core/object/dns.h | 2 +- include/dnsjit/core/object/dns.hh | 4 +- include/dnsjit/core/object/dns.lua | 2 +- include/dnsjit/core/object/dns/label.lua | 55 +- include/dnsjit/core/object/dns/q.lua | 2 +- include/dnsjit/core/object/dns/rr.lua | 2 +- include/dnsjit/core/object/ether.c | 2 +- include/dnsjit/core/object/ether.h | 2 +- include/dnsjit/core/object/ether.hh | 2 +- include/dnsjit/core/object/ether.lua | 2 +- include/dnsjit/core/object/gre.c | 2 +- include/dnsjit/core/object/gre.h | 2 +- include/dnsjit/core/object/gre.hh | 2 +- include/dnsjit/core/object/gre.lua | 2 +- include/dnsjit/core/object/icmp.c | 2 +- include/dnsjit/core/object/icmp.h | 2 +- include/dnsjit/core/object/icmp.hh | 2 +- include/dnsjit/core/object/icmp.lua | 2 +- include/dnsjit/core/object/icmp6.c | 2 +- include/dnsjit/core/object/icmp6.h | 2 +- include/dnsjit/core/object/icmp6.hh | 2 +- include/dnsjit/core/object/icmp6.lua | 2 +- include/dnsjit/core/object/ieee802.c | 2 +- include/dnsjit/core/object/ieee802.h | 2 +- include/dnsjit/core/object/ieee802.hh | 2 +- include/dnsjit/core/object/ieee802.lua | 2 +- include/dnsjit/core/object/ip.c | 2 +- include/dnsjit/core/object/ip.h | 2 +- include/dnsjit/core/object/ip.hh | 2 +- include/dnsjit/core/object/ip.lua | 2 +- include/dnsjit/core/object/ip6.c | 2 +- include/dnsjit/core/object/ip6.h | 3 +- include/dnsjit/core/object/ip6.hh | 4 +- include/dnsjit/core/object/ip6.lua | 5 +- include/dnsjit/core/object/linuxsll.c | 2 +- include/dnsjit/core/object/linuxsll.h | 2 +- include/dnsjit/core/object/linuxsll.hh | 2 +- include/dnsjit/core/object/linuxsll.lua | 2 +- .../core/object/{icmp6.c => linuxsll2.c} | 14 +- .../dnsjit/core/object/{gre.h => linuxsll2.h} | 18 +- .../core/object/{linuxsll.hh => linuxsll2.hh} | 20 +- .../dnsjit/core/object/linuxsll2.lua | 56 +- include/dnsjit/core/object/loop.c | 2 +- include/dnsjit/core/object/loop.h | 2 +- include/dnsjit/core/object/loop.hh | 2 +- include/dnsjit/core/object/loop.lua | 2 +- include/dnsjit/core/object/null.c | 2 +- include/dnsjit/core/object/null.h | 2 +- include/dnsjit/core/object/null.hh | 2 +- include/dnsjit/core/object/null.lua | 2 +- include/dnsjit/core/object/payload.c | 2 +- include/dnsjit/core/object/payload.h | 2 +- include/dnsjit/core/object/payload.hh | 2 +- include/dnsjit/core/object/payload.lua | 2 +- include/dnsjit/core/object/pcap.c | 2 +- include/dnsjit/core/object/pcap.h | 2 +- include/dnsjit/core/object/pcap.hh | 2 +- include/dnsjit/core/object/pcap.lua | 2 +- include/dnsjit/core/object/tcp.c | 2 +- include/dnsjit/core/object/tcp.h | 2 +- include/dnsjit/core/object/tcp.hh | 2 +- include/dnsjit/core/object/tcp.lua | 2 +- include/dnsjit/core/object/udp.c | 2 +- include/dnsjit/core/object/udp.h | 2 +- include/dnsjit/core/object/udp.hh | 2 +- include/dnsjit/core/object/udp.lua | 2 +- include/dnsjit/core/objects.lua | 4 +- include/dnsjit/core/producer.c | 2 +- include/dnsjit/core/producer.h | 2 +- include/dnsjit/core/producer.hh | 2 +- include/dnsjit/core/producer.lua | 2 +- include/dnsjit/core/receiver.c | 2 +- include/dnsjit/core/receiver.h | 2 +- include/dnsjit/core/receiver.hh | 2 +- include/dnsjit/core/receiver.lua | 2 +- include/dnsjit/core/thread.c | 2 +- include/dnsjit/core/thread.h | 2 +- include/dnsjit/core/thread.hh | 2 +- include/dnsjit/core/thread.lua | 2 +- include/dnsjit/core/timespec.h | 2 +- include/dnsjit/core/timespec.hh | 2 +- include/dnsjit/core/timespec.lua | 2 +- include/dnsjit/dnsjit.1in | 2 +- include/dnsjit/dnsjit.c | 2 +- include/dnsjit/filter.lua | 2 +- include/dnsjit/filter/copy.c | 5 + include/dnsjit/filter/layer.c | 48 +- include/dnsjit/filter/layer.h | 3 +- include/dnsjit/filter/layer.hh | 34 +- include/dnsjit/filter/layer.lua | 2 +- include/dnsjit/filter/split.c | 2 +- include/dnsjit/filter/split.h | 2 +- include/dnsjit/filter/split.hh | 2 +- include/dnsjit/filter/split.lua | 2 +- include/dnsjit/filter/timing.c | 2 +- include/dnsjit/filter/timing.h | 2 +- include/dnsjit/filter/timing.hh | 2 +- include/dnsjit/filter/timing.lua | 2 +- include/dnsjit/gen-manpage.lua | 2 +- include/dnsjit/globals.c | 2 +- include/dnsjit/globals.h | 2 +- include/dnsjit/input.lua | 2 +- include/dnsjit/input/fpcap.c | 2 +- include/dnsjit/input/fpcap.h | 2 +- include/dnsjit/input/fpcap.hh | 2 +- include/dnsjit/input/fpcap.lua | 2 +- include/dnsjit/input/mmpcap.c | 2 +- include/dnsjit/input/mmpcap.h | 2 +- include/dnsjit/input/mmpcap.hh | 2 +- include/dnsjit/input/mmpcap.lua | 2 +- include/dnsjit/input/pcap.c | 2 +- include/dnsjit/input/pcap.h | 2 +- include/dnsjit/input/pcap.hh | 2 +- include/dnsjit/input/pcap.lua | 2 +- include/dnsjit/input/zero.lua | 2 +- include/dnsjit/input/zmmpcap.c | 2 +- include/dnsjit/input/zmmpcap.h | 2 +- include/dnsjit/input/zmmpcap.hh | 2 +- include/dnsjit/input/zmmpcap.lua | 2 +- include/dnsjit/input/zpcap.c | 2 +- include/dnsjit/input/zpcap.h | 2 +- include/dnsjit/input/zpcap.hh | 2 +- include/dnsjit/input/zpcap.lua | 2 +- include/dnsjit/lib.lua | 2 +- include/dnsjit/lib/clock.c | 2 +- include/dnsjit/lib/clock.h | 2 +- include/dnsjit/lib/clock.hh | 2 +- include/dnsjit/lib/clock.lua | 2 +- include/dnsjit/lib/getopt.lua | 2 +- include/dnsjit/lib/ip.lua | 2 +- include/dnsjit/lib/parseconf.lua | 2 +- include/dnsjit/output.lua | 2 +- include/dnsjit/output/dnscli.c | 2 +- include/dnsjit/output/dnscli.h | 2 +- include/dnsjit/output/dnscli.hh | 2 +- include/dnsjit/output/dnscli.lua | 2 +- include/dnsjit/output/null.lua | 2 +- include/dnsjit/output/pcap.c | 2 +- include/dnsjit/output/pcap.h | 2 +- include/dnsjit/output/pcap.hh | 2 +- include/dnsjit/output/pcap.lua | 2 +- include/dnsjit/output/respdiff.c | 2 +- include/dnsjit/output/respdiff.h | 2 +- include/dnsjit/output/respdiff.hh | 2 +- include/dnsjit/output/respdiff.lua | 2 +- include/dnsjit/output/tcpcli.c | 2 +- include/dnsjit/output/tcpcli.h | 2 +- include/dnsjit/output/tcpcli.hh | 2 +- include/dnsjit/output/tcpcli.lua | 2 +- include/dnsjit/output/tlscli.c | 2 +- include/dnsjit/output/tlscli.h | 2 +- include/dnsjit/output/tlscli.hh | 2 +- include/dnsjit/output/tlscli.lua | 2 +- include/dnsjit/output/udpcli.c | 2 +- include/dnsjit/output/udpcli.h | 2 +- include/dnsjit/output/udpcli.hh | 2 +- include/dnsjit/output/udpcli.lua | 2 +- include/dnsjit/test/46vs45.pcap | Bin 0 -> 86 bytes include/dnsjit/test/Makefile.am | 14 +- include/dnsjit/test/Makefile.in | 29 +- include/dnsjit/test/ip6-tcp-padd.pcap | Bin 0 -> 1738 bytes include/dnsjit/test/ip6-udp-padd.pcap | Bin 0 -> 106 bytes include/dnsjit/test/sll2.pcap | Bin 0 -> 927 bytes .../test/tcp-response-with-trailing-junk.pcap | Bin 0 -> 9641 bytes .../dnsjit/test/test-padding.sh | 11 +- include/dnsjit/test/test-sll2.gold | 33 + .../dnsjit/test/test-sll2.sh | 8 +- include/dnsjit/test/test1.sh | 2 +- include/dnsjit/test/test2.sh | 2 +- include/dnsjit/test/test3.sh | 2 +- include/dnsjit/test/test4.sh | 2 +- include/dnsjit/test/test6.sh | 2 +- include/dnsjit/test/test_ipsplit.lua | 24 +- include/dnsjit/test/test_padding.gold | 288 ++++++ include/dnsjit/test/test_padding.lua | 70 ++ include/dnsjit/version.h | 4 +- ltmain.sh | 855 +++++++++++------- m4/dl.sh | 2 +- m4/libtool.m4 | 229 +++-- m4/ltoptions.m4 | 4 +- m4/ltsugar.m4 | 2 +- m4/ltversion.m4 | 13 +- m4/lt~obsolete.m4 | 4 +- src/Makefile.am | 19 +- src/Makefile.in | 196 ++-- src/core.lua | 2 +- src/core/assert.h | 2 +- src/core/channel.c | 2 +- src/core/channel.h | 2 +- src/core/channel.hh | 2 +- src/core/channel.lua | 2 +- src/core/compat.c | 2 +- src/core/compat.h | 2 +- src/core/compat.lua | 2 +- src/core/file.c | 2 +- src/core/file.h | 2 +- src/core/file.hh | 2 +- src/core/file.lua | 2 +- src/core/loader.lua | 2 +- src/core/log.c | 2 +- src/core/log.h | 2 +- src/core/log.hh | 2 +- src/core/log.lua | 2 +- src/core/object.c | 8 +- src/core/object.h | 3 +- src/core/object.hh | 2 +- src/core/object.lua | 7 +- src/core/object/dns.c | 32 +- src/core/object/dns.h | 2 +- src/core/object/dns.hh | 4 +- src/core/object/dns.lua | 2 +- src/core/object/dns/label.lua | 55 +- src/core/object/dns/q.lua | 2 +- src/core/object/dns/rr.lua | 2 +- src/core/object/ether.c | 2 +- src/core/object/ether.h | 2 +- src/core/object/ether.hh | 2 +- src/core/object/ether.lua | 2 +- src/core/object/gre.c | 2 +- src/core/object/gre.h | 2 +- src/core/object/gre.hh | 2 +- src/core/object/gre.lua | 2 +- src/core/object/icmp.c | 2 +- src/core/object/icmp.h | 2 +- src/core/object/icmp.hh | 2 +- src/core/object/icmp.lua | 2 +- src/core/object/icmp6.c | 2 +- src/core/object/icmp6.h | 2 +- src/core/object/icmp6.hh | 2 +- src/core/object/icmp6.lua | 2 +- src/core/object/ieee802.c | 2 +- src/core/object/ieee802.h | 2 +- src/core/object/ieee802.hh | 2 +- src/core/object/ieee802.lua | 2 +- src/core/object/ip.c | 2 +- src/core/object/ip.h | 2 +- src/core/object/ip.hh | 2 +- src/core/object/ip.lua | 2 +- src/core/object/ip6.c | 2 +- src/core/object/ip6.h | 3 +- src/core/object/ip6.hh | 4 +- src/core/object/ip6.lua | 5 +- src/core/object/linuxsll.c | 2 +- src/core/object/linuxsll.h | 2 +- src/core/object/linuxsll.hh | 2 +- src/core/object/linuxsll.lua | 2 +- .../icmp6.c => src/core/object/linuxsll2.c | 14 +- .../gre.h => src/core/object/linuxsll2.h | 18 +- .../core/object/linuxsll2.hh | 20 +- .../object/{linuxsll.lua => linuxsll2.lua} | 56 +- src/core/object/loop.c | 2 +- src/core/object/loop.h | 2 +- src/core/object/loop.hh | 2 +- src/core/object/loop.lua | 2 +- src/core/object/null.c | 2 +- src/core/object/null.h | 2 +- src/core/object/null.hh | 2 +- src/core/object/null.lua | 2 +- src/core/object/payload.c | 2 +- src/core/object/payload.h | 2 +- src/core/object/payload.hh | 2 +- src/core/object/payload.lua | 2 +- src/core/object/pcap.c | 2 +- src/core/object/pcap.h | 2 +- src/core/object/pcap.hh | 2 +- src/core/object/pcap.lua | 2 +- src/core/object/tcp.c | 2 +- src/core/object/tcp.h | 2 +- src/core/object/tcp.hh | 2 +- src/core/object/tcp.lua | 2 +- src/core/object/udp.c | 2 +- src/core/object/udp.h | 2 +- src/core/object/udp.hh | 2 +- src/core/object/udp.lua | 2 +- src/core/objects.lua | 4 +- src/core/producer.c | 2 +- src/core/producer.h | 2 +- src/core/producer.hh | 2 +- src/core/producer.lua | 2 +- src/core/receiver.c | 2 +- src/core/receiver.h | 2 +- src/core/receiver.hh | 2 +- src/core/receiver.lua | 2 +- src/core/thread.c | 2 +- src/core/thread.h | 2 +- src/core/thread.hh | 2 +- src/core/thread.lua | 2 +- src/core/timespec.h | 2 +- src/core/timespec.hh | 2 +- src/core/timespec.lua | 2 +- src/dnsjit.1in | 2 +- src/dnsjit.c | 2 +- src/filter.lua | 2 +- src/filter/copy.c | 5 + src/filter/layer.c | 48 +- src/filter/layer.h | 3 +- src/filter/layer.hh | 34 +- src/filter/layer.lua | 2 +- src/filter/split.c | 2 +- src/filter/split.h | 2 +- src/filter/split.hh | 2 +- src/filter/split.lua | 2 +- src/filter/timing.c | 2 +- src/filter/timing.h | 2 +- src/filter/timing.hh | 2 +- src/filter/timing.lua | 2 +- src/gen-manpage.lua | 2 +- src/globals.c | 2 +- src/globals.h | 2 +- src/input.lua | 2 +- src/input/fpcap.c | 2 +- src/input/fpcap.h | 2 +- src/input/fpcap.hh | 2 +- src/input/fpcap.lua | 2 +- src/input/mmpcap.c | 2 +- src/input/mmpcap.h | 2 +- src/input/mmpcap.hh | 2 +- src/input/mmpcap.lua | 2 +- src/input/pcap.c | 2 +- src/input/pcap.h | 2 +- src/input/pcap.hh | 2 +- src/input/pcap.lua | 2 +- src/input/zero.lua | 2 +- src/input/zmmpcap.c | 2 +- src/input/zmmpcap.h | 2 +- src/input/zmmpcap.hh | 2 +- src/input/zmmpcap.lua | 2 +- src/input/zpcap.c | 2 +- src/input/zpcap.h | 2 +- src/input/zpcap.hh | 2 +- src/input/zpcap.lua | 2 +- src/lib.lua | 2 +- src/lib/clock.c | 2 +- src/lib/clock.h | 2 +- src/lib/clock.hh | 2 +- src/lib/clock.lua | 2 +- src/lib/getopt.lua | 2 +- src/lib/ip.lua | 2 +- src/lib/parseconf.lua | 2 +- src/output.lua | 2 +- src/output/dnscli.c | 2 +- src/output/dnscli.h | 2 +- src/output/dnscli.hh | 2 +- src/output/dnscli.lua | 2 +- src/output/null.lua | 2 +- src/output/pcap.c | 2 +- src/output/pcap.h | 2 +- src/output/pcap.hh | 2 +- src/output/pcap.lua | 2 +- src/output/respdiff.c | 2 +- src/output/respdiff.h | 2 +- src/output/respdiff.hh | 2 +- src/output/respdiff.lua | 2 +- src/output/tcpcli.c | 2 +- src/output/tcpcli.h | 2 +- src/output/tcpcli.hh | 2 +- src/output/tcpcli.lua | 2 +- src/output/tlscli.c | 2 +- src/output/tlscli.h | 2 +- src/output/tlscli.hh | 2 +- src/output/tlscli.lua | 2 +- src/output/udpcli.c | 2 +- src/output/udpcli.h | 2 +- src/output/udpcli.hh | 2 +- src/output/udpcli.lua | 2 +- src/test/46vs45.pcap | Bin 0 -> 86 bytes src/test/Makefile.am | 14 +- src/test/Makefile.in | 29 +- src/test/ip6-tcp-padd.pcap | Bin 0 -> 1738 bytes src/test/ip6-udp-padd.pcap | Bin 0 -> 106 bytes src/test/sll2.pcap | Bin 0 -> 927 bytes src/test/tcp-response-with-trailing-junk.pcap | Bin 0 -> 9641 bytes .../Makefile.am => src/test/test-padding.sh | 11 +- src/test/test-sll2.gold | 33 + src/test/{test4.sh => test-sll2.sh} | 8 +- src/test/test1.sh | 2 +- src/test/test2.sh | 2 +- src/test/test3.sh | 2 +- src/test/test4.sh | 2 +- src/test/test6.sh | 2 +- src/test/test_ipsplit.lua | 24 +- src/test/test_padding.gold | 288 ++++++ src/test/test_padding.lua | 70 ++ src/version.h | 4 +- 419 files changed, 3061 insertions(+), 1380 deletions(-) copy include/dnsjit/core/object/{icmp6.c => linuxsll2.c} (70%) copy include/dnsjit/core/object/{gre.h => linuxsll2.h} (63%) copy include/dnsjit/core/object/{linuxsll.hh => linuxsll2.hh} (65%) copy src/core/object/linuxsll.lua => include/dnsjit/core/object/linuxsll2.lua (62%) create mode 100644 include/dnsjit/test/46vs45.pcap create mode 100644 include/dnsjit/test/ip6-tcp-padd.pcap create mode 100644 include/dnsjit/test/ip6-udp-padd.pcap create mode 100644 include/dnsjit/test/sll2.pcap create mode 100644 include/dnsjit/test/tcp-response-with-trailing-junk.pcap copy examples/Makefile.am => include/dnsjit/test/test-padding.sh (60%) mode change 100644 => 100755 create mode 100644 include/dnsjit/test/test-sll2.gold copy src/test/test4.sh => include/dnsjit/test/test-sll2.sh (79%) create mode 100644 include/dnsjit/test/test_padding.gold create mode 100644 include/dnsjit/test/test_padding.lua copy include/dnsjit/core/object/icmp6.c => src/core/object/linuxsll2.c (70%) copy include/dnsjit/core/object/gre.h => src/core/object/linuxsll2.h (63%) copy include/dnsjit/core/object/linuxsll.hh => src/core/object/linuxsll2.hh (65%) copy src/core/object/{linuxsll.lua => linuxsll2.lua} (62%) create mode 100644 src/test/46vs45.pcap create mode 100644 src/test/ip6-tcp-padd.pcap create mode 100644 src/test/ip6-udp-padd.pcap create mode 100644 src/test/sll2.pcap create mode 100644 src/test/tcp-response-with-trailing-junk.pcap copy examples/Makefile.am => src/test/test-padding.sh (60%) mode change 100644 => 100755 create mode 100644 src/test/test-sll2.gold copy src/test/{test4.sh => test-sll2.sh} (79%) create mode 100644 src/test/test_padding.gold create mode 100644 src/test/test_padding.lua diff --git a/CHANGES b/CHANGES index 8a39b24..c3cd304 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,44 @@ +2025-04-16 Jerry Lundström + + Release v1.5.0 + + This releases adds a new function to return a label quoted as described + in RFC 1035, adds support for link-type Linux cooked v2 and fixes + padding calculations for UDP, IPv4 and IPv6 packets. + + New: + - `core.object.dns.label`: Add `torfc1035()` + - `core.object`: Add `linuxsll2` object + - `filter.layer`: Add support for DLT_LINUX_SLL2 + - `filter.copy`: Add support for DLT_LINUX_SLL2 + + Fixes: + - Fix #250: handle endian in tests + - Fix #252 + - `core.object.ip6`: Add `hlen` for total length of header with all extensions + - `filter.layer`: + - correct UDP padding calculation + - Fix padding calculation for IPv4 packet when options exists + - Fix padding calculation for IPv6 packets + - Store `hlen` for IPv6 packets + - Add test for padding + + Other changes: + - Simplify and speedup pcap2tcpdns example + + d03a184 DLT_LINUX_SLL2 + 1cd3836 torfc1035 + 8d8746f Fix IPv6 hlen + 75b634b Padding + b8bfcf8 Simplify and speedup pcap2tcpdns example + e37bb92 Fix log name in examples/pcap2tcpdns.lua + 80b7c34 UDP padding + 9a28aee ipsplit endian + 375e9e8 SPEC + c82c0ca RPM + 74fbda2 COPR tweaks + 3691bd8 RPM spec + 2024-08-28 Jerry Lundström Release 1.4.0 diff --git a/Makefile.am b/Makefile.am index 168e36c..8a5872c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/Makefile.in b/Makefile.in index 5d4ae9f..e7c2248 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -288,6 +288,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/README.md b/README.md index 2c26e2a..fe59c4b 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ See more examples in the [examples](https://github.com/DNS-OARC/dnsjit/tree/deve ## Copyright -Copyright (c) 2018-2024 OARC, Inc. +Copyright (c) 2018-2025 OARC, Inc. All rights reserved. diff --git a/aclocal.m4 b/aclocal.m4 index e2c2a1f..de5b59b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . @@ -108,7 +108,7 @@ dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place +dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], @@ -177,14 +177,14 @@ if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - m4_default([$4], [AC_MSG_ERROR( + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -196,7 +196,7 @@ _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -206,10 +206,10 @@ _PKG_TEXT To get pkg-config, see .])[]dnl ]) else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - $3 + $3 fi[]dnl ])dnl PKG_CHECK_MODULES @@ -296,6 +296,74 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff --git a/configure b/configure index 460a3e3..6656c3c 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.4.0. +# Generated by GNU Autoconf 2.71 for dnsjit 1.5.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dnsjit' PACKAGE_TARNAME='dnsjit' -PACKAGE_VERSION='1.4.0' -PACKAGE_STRING='dnsjit 1.4.0' +PACKAGE_VERSION='1.5.0' +PACKAGE_STRING='dnsjit 1.5.0' PACKAGE_BUGREPORT='admin@dns-oarc.net' PACKAGE_URL='https://github.com/DNS-OARC/dnsjit/issues' @@ -700,6 +700,7 @@ MANIFEST_TOOL RANLIB DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -1400,7 +1401,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.4.0 to adapt to many kinds of systems. +\`configure' configures dnsjit 1.5.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1471,7 +1472,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dnsjit 1.4.0:";; + short | recursive ) echo "Configuration of dnsjit 1.5.0:";; esac cat <<\_ACEOF @@ -1618,7 +1619,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dnsjit configure 1.4.0 +dnsjit configure 1.5.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2106,7 +2107,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.4.0, which was +It was created by dnsjit $as_me 1.5.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2866,7 +2867,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 4" >>confdefs.h +printf "%s\n" "#define PACKAGE_MINOR_VERSION 5" >>confdefs.h printf "%s\n" "#define PACKAGE_PATCH_VERSION 0" >>confdefs.h @@ -3385,7 +3386,7 @@ fi # Define the identity of the package. PACKAGE='dnsjit' - VERSION='1.4.0' + VERSION='1.5.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -5012,8 +5013,8 @@ esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -5566,13 +5567,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5710,7 +5711,7 @@ esac fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5814,7 +5815,7 @@ else $as_nop lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5857,7 +5858,7 @@ else $as_nop sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -6062,6 +6063,114 @@ esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 @@ -6205,7 +6314,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -6239,14 +6348,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -6260,7 +6369,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -6307,7 +6416,7 @@ netbsd* | netbsdelf*-gnu) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -6680,13 +6789,29 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cr} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -7103,7 +7228,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -7121,20 +7246,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -7158,7 +7283,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -7176,9 +7301,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7378,7 +7503,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -7503,7 +7628,7 @@ ia64-*-hpux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -7524,7 +7649,7 @@ ia64-*-hpux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -7536,7 +7661,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -7562,7 +7687,7 @@ mips64*-*linux*) printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -7570,7 +7695,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -7578,7 +7703,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -7602,14 +7727,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -7717,7 +7842,7 @@ printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -8500,8 +8625,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cr libconftest.a conftest.o" >&5 - $AR cr libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -8528,17 +8653,12 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[912]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*|11.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -8925,8 +9045,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9444,7 +9564,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9867,15 +9987,15 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -9930,7 +10050,7 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10042,6 +10162,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -10056,7 +10177,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -10099,7 +10220,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -10111,13 +10232,14 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -10127,7 +10249,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10259,7 +10381,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10530,12 +10652,12 @@ fi cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10576,7 +10698,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10617,8 +10739,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10652,7 +10774,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10833,6 +10955,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; @@ -10904,6 +11027,7 @@ printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11596,7 +11720,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -11606,14 +11730,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11632,7 +11756,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11669,7 +11793,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11702,7 +11826,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -12867,30 +12991,41 @@ striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -15259,12 +15394,12 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libpcap_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcap" 2>&1` + libpcap_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcap" 2>&1` else - libpcap_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcap" 2>&1` + libpcap_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcap" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libpcap_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libpcap_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pcap_open_live in -lpcap" >&5 @@ -15364,8 +15499,8 @@ fi else - libpcap_CFLAGS=$pkg_cv_libpcap_CFLAGS - libpcap_LIBS=$pkg_cv_libpcap_LIBS + libpcap_CFLAGS=$pkg_cv_libpcap_CFLAGS + libpcap_LIBS=$pkg_cv_libpcap_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -15539,21 +15674,21 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - luajit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "luajit >= 2" 2>&1` + luajit_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "luajit >= 2" 2>&1` else - luajit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "luajit >= 2" 2>&1` + luajit_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "luajit >= 2" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$luajit_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$luajit_PKG_ERRORS" >&5 - as_fn_error $? "luajit v2+ not found" "$LINENO" 5 + as_fn_error $? "luajit v2+ not found" "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "luajit v2+ not found" "$LINENO" 5 + as_fn_error $? "luajit v2+ not found" "$LINENO" 5 else - luajit_CFLAGS=$pkg_cv_luajit_CFLAGS - luajit_LIBS=$pkg_cv_luajit_LIBS + luajit_CFLAGS=$pkg_cv_luajit_CFLAGS + luajit_LIBS=$pkg_cv_luajit_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -15713,12 +15848,12 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - ck_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ck >= 0" 2>&1` + ck_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "ck >= 0" 2>&1` else - ck_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ck >= 0" 2>&1` + ck_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "ck >= 0" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$ck_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$ck_PKG_ERRORS" >&5 for ac_header in ck_ring.h ck_pr.h @@ -15848,8 +15983,8 @@ fi else - ck_CFLAGS=$pkg_cv_ck_CFLAGS - ck_LIBS=$pkg_cv_ck_LIBS + ck_CFLAGS=$pkg_cv_ck_CFLAGS + ck_LIBS=$pkg_cv_ck_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -15909,12 +16044,12 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - gnutls_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls" 2>&1` + gnutls_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls" 2>&1` else - gnutls_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls" 2>&1` + gnutls_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$gnutls_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$gnutls_PKG_ERRORS" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gnutls_init in -lgnutls" >&5 @@ -16014,8 +16149,8 @@ fi else - gnutls_CFLAGS=$pkg_cv_gnutls_CFLAGS - gnutls_LIBS=$pkg_cv_gnutls_LIBS + gnutls_CFLAGS=$pkg_cv_gnutls_CFLAGS + gnutls_LIBS=$pkg_cv_gnutls_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -16072,21 +16207,21 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - liblz4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblz4 >= 1.8.0 liblz4 != 131" 2>&1` + liblz4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblz4 >= 1.8.0 liblz4 != 131" 2>&1` else - liblz4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblz4 >= 1.8.0 liblz4 != 131" 2>&1` + liblz4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblz4 >= 1.8.0 liblz4 != 131" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$liblz4_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$liblz4_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 - liblz4_CFLAGS=$pkg_cv_liblz4_CFLAGS - liblz4_LIBS=$pkg_cv_liblz4_LIBS + liblz4_CFLAGS=$pkg_cv_liblz4_CFLAGS + liblz4_LIBS=$pkg_cv_liblz4_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -16145,21 +16280,21 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libzstd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd >= 1.3.0" 2>&1` + libzstd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd >= 1.3.0" 2>&1` else - libzstd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd >= 1.3.0" 2>&1` + libzstd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd >= 1.3.0" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$libzstd_PKG_ERRORS" >&5 + # Put the nasty error message in config.log where it belongs + echo "$libzstd_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 - libzstd_CFLAGS=$pkg_cv_libzstd_CFLAGS - libzstd_LIBS=$pkg_cv_libzstd_LIBS + libzstd_CFLAGS=$pkg_cv_libzstd_CFLAGS + libzstd_LIBS=$pkg_cv_libzstd_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -16263,21 +16398,21 @@ 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` + 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` + 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 + # 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 + 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; } @@ -17171,7 +17306,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.4.0, which was +This file was extended by dnsjit $as_me 1.5.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17240,7 +17375,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.4.0 +dnsjit config.status 1.5.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -17403,6 +17538,7 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' @@ -17411,6 +17547,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -17531,6 +17668,7 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ @@ -17539,7 +17677,6 @@ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -18484,6 +18621,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -18508,8 +18648,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -18885,7 +19028,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || diff --git a/configure.ac b/configure.ac index 8a5344c..cb944ea 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -17,9 +17,9 @@ # along with dnsjit. If not, see . AC_PREREQ(2.64) -AC_INIT([dnsjit], [1.4.0], [admin@dns-oarc.net], [dnsjit], [https://github.com/DNS-OARC/dnsjit/issues]) +AC_INIT([dnsjit], [1.5.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], [4], [Define to the minor version of this package.]) +AC_DEFINE([PACKAGE_MINOR_VERSION], [5], [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]) diff --git a/examples/Makefile.am b/examples/Makefile.am index a184589..559f558 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/examples/Makefile.in b/examples/Makefile.in index ac0905a..d2a1941 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -209,6 +209,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/examples/pcap2tcpdns.lua b/examples/pcap2tcpdns.lua index 6cb829a..da1a38f 100755 --- a/examples/pcap2tcpdns.lua +++ b/examples/pcap2tcpdns.lua @@ -3,18 +3,20 @@ -- Convert PCAP with IPv[46] & UDP payloads into TCP-stream binary format as -- specified by RFC 1035 section "4.2.2. TCP usage". Each packet is preceded by --- 2-byte pre‐ambule which specifies length of the following DNS packet in --- network byte order, immediately followed by raw bytes of the packet. +-- 2-byte pre‐ambule which specifies length of the following DNS message in +-- network byte order, immediately followed by raw bytes of the DNS message. +-- +-- Outputs raw binary to stdout! -- -- This script does not do any filtering or input sanitation. --- Outputs raw binary to stdout! +-- For filtering capabilities look at dnscap -o dump_format=tcpdns local bit = require("bit") local ffi = require("ffi") local input = require("dnsjit.input.pcap").new() local layer = require("dnsjit.filter.layer").new() local object = require("dnsjit.core.objects") -local log = require("dnsjit.core.log").new("extract-clients.lua") +local log = require("dnsjit.core.log").new("pcap2tcpdns") local getopt = require("dnsjit.lib.getopt").new({ { "r", "read", "-", "input file to read, use - for stdin", "?" }, }) @@ -54,27 +56,23 @@ local produce, pctx = layer:produce() -- set up output io.stdout:setvbuf("full") -local obj, obj_pcap_in, obj_ip, obj_udp, obj_pl -local npacketsin = 0 +local obj, obj_udp, obj_pl +local npacketsout = 0 +local npacketsskip = 0 +local UDP_ID = object.UDP while true do obj = produce(pctx) if obj == nil then break end - npacketsin = npacketsin + 1 - obj_ip = obj:cast_to(object.IP) - if obj_ip == nil then - obj_ip = obj:cast_to(object.IP6) - end - - obj_udp = obj:cast_to(object.UDP) obj_pl = obj:cast_to(object.PAYLOAD) - obj_pcap_in = obj:cast_to(object.PCAP) - if obj_ip ~= nil and obj_udp ~= nil and obj_pl ~= nil and obj_pcap_in ~= nil then - -- UDP header length is 8 bytes and is included in the ulen field below. + if obj_pl ~= nil and obj_pl.len <= 65535 and obj_pl:prev().obj_type == UDP_ID then -- RFC 1035 framing has just the DNS message size as two bytes (big-endian). - put_uint16_be(tmpbuf, 0, obj_udp.ulen - 8) + put_uint16_be(tmpbuf, 0, obj_pl.len) io.stdout:write(ffi.string(tmpbuf, 2)) io.stdout:write(ffi.string(obj_pl.payload, obj_pl.len)) + npacketsout = npacketsout + 1 + else + npacketsskip = npacketsskip + 1 end end -log:info(string.format("processed %d packets", npacketsin)) +log:info(string.format("%d packets copied, %d skipped", npacketsout, npacketsskip)) diff --git a/include/dnsjit/Makefile.am b/include/dnsjit/Makefile.am index 90fd511..e97a68c 100644 --- a/include/dnsjit/Makefile.am +++ b/include/dnsjit/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -48,16 +48,16 @@ dnsjit_LDADD = $(PTHREAD_LIBS) $(luajit_LIBS) $(liblz4_LIBS) $(libzstd_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/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 +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/linuxsll2.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/linuxsll2.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/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 +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/linuxsll2.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/linuxsll2.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/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 +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/linuxsll2.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/linuxsll2.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) @@ -67,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.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 +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.linuxsll2.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: @@ -175,6 +175,9 @@ dnsjit.core.object.ip6.3in: core/object/ip6.lua gen-manpage.lua dnsjit.core.object.ip.3in: core/object/ip.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/ip.lua" > "$@" +dnsjit.core.object.linuxsll2.3in: core/object/linuxsll2.lua gen-manpage.lua + $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll2.lua" > "$@" + dnsjit.core.object.linuxsll.3in: core/object/linuxsll.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll.lua" > "$@" diff --git a/include/dnsjit/Makefile.in b/include/dnsjit/Makefile.in index 16dd15f..16dcb23 100644 --- a/include/dnsjit/Makefile.in +++ b/include/dnsjit/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -141,20 +141,21 @@ am_dnsjit_OBJECTS = dnsjit.$(OBJEXT) globals.$(OBJEXT) \ core/object/gre.$(OBJEXT) core/object/icmp6.$(OBJEXT) \ core/object/icmp.$(OBJEXT) core/object/ieee802.$(OBJEXT) \ core/object/ip6.$(OBJEXT) core/object/ip.$(OBJEXT) \ - core/object/linuxsll.$(OBJEXT) core/object/loop.$(OBJEXT) \ - core/object/null.$(OBJEXT) core/object/payload.$(OBJEXT) \ - core/object/pcap.$(OBJEXT) core/object/tcp.$(OBJEXT) \ - core/object/udp.$(OBJEXT) core/producer.$(OBJEXT) \ - core/receiver.$(OBJEXT) core/thread.$(OBJEXT) \ - filter/copy.$(OBJEXT) filter/ipsplit.$(OBJEXT) \ - filter/layer.$(OBJEXT) filter/split.$(OBJEXT) \ - filter/timing.$(OBJEXT) input/fpcap.$(OBJEXT) \ - input/mmpcap.$(OBJEXT) input/pcap.$(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) + core/object/linuxsll2.$(OBJEXT) core/object/linuxsll.$(OBJEXT) \ + core/object/loop.$(OBJEXT) core/object/null.$(OBJEXT) \ + core/object/payload.$(OBJEXT) core/object/pcap.$(OBJEXT) \ + core/object/tcp.$(OBJEXT) core/object/udp.$(OBJEXT) \ + core/producer.$(OBJEXT) core/receiver.$(OBJEXT) \ + core/thread.$(OBJEXT) filter/copy.$(OBJEXT) \ + filter/ipsplit.$(OBJEXT) filter/layer.$(OBJEXT) \ + filter/split.$(OBJEXT) filter/timing.$(OBJEXT) \ + input/fpcap.$(OBJEXT) input/mmpcap.$(OBJEXT) \ + input/pcap.$(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 = @@ -194,6 +195,7 @@ am__depfiles_remade = ./$(DEPDIR)/dnsjit.Po ./$(DEPDIR)/globals.Po \ core/object/$(DEPDIR)/icmp6.Po \ core/object/$(DEPDIR)/ieee802.Po core/object/$(DEPDIR)/ip.Po \ core/object/$(DEPDIR)/ip6.Po core/object/$(DEPDIR)/linuxsll.Po \ + core/object/$(DEPDIR)/linuxsll2.Po \ core/object/$(DEPDIR)/loop.Po core/object/$(DEPDIR)/null.Po \ core/object/$(DEPDIR)/payload.Po core/object/$(DEPDIR)/pcap.Po \ core/object/$(DEPDIR)/tcp.Po core/object/$(DEPDIR)/udp.Po \ @@ -358,6 +360,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -495,15 +498,16 @@ dnsjit_SOURCES = dnsjit.c globals.c 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 + core/object/ip.c core/object/linuxsll2.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 # Lua sources dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.lua \ @@ -513,19 +517,20 @@ dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.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 + core/object/linuxsll2.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 dnsjitincludedir = $(includedir)/dnsjit # Lua headers @@ -534,45 +539,46 @@ nobase_dnsjitinclude_HEADERS = globals.h version.h core/assert.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 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 + core/object/linuxsll2.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 \ + 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/linuxsll2.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/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 \ 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 + core/object/linuxsll2.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_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 \ @@ -581,8 +587,8 @@ lua_objects = core.luao lib.luao input.luao filter.luao output.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/linuxsll2.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 \ @@ -609,24 +615,24 @@ man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.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 + dnsjit.core.object.linuxsll2.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 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -763,6 +769,8 @@ core/object/ip6.$(OBJEXT): core/object/$(am__dirstamp) \ core/object/$(DEPDIR)/$(am__dirstamp) core/object/ip.$(OBJEXT): core/object/$(am__dirstamp) \ core/object/$(DEPDIR)/$(am__dirstamp) +core/object/linuxsll2.$(OBJEXT): core/object/$(am__dirstamp) \ + core/object/$(DEPDIR)/$(am__dirstamp) core/object/linuxsll.$(OBJEXT): core/object/$(am__dirstamp) \ core/object/$(DEPDIR)/$(am__dirstamp) core/object/loop.$(OBJEXT): core/object/$(am__dirstamp) \ @@ -879,6 +887,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/ip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/ip6.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/linuxsll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/linuxsll2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/null.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/payload.Po@am__quote@ # am--include-marker @@ -1285,6 +1294,7 @@ distclean: distclean-recursive -rm -f core/object/$(DEPDIR)/ip.Po -rm -f core/object/$(DEPDIR)/ip6.Po -rm -f core/object/$(DEPDIR)/linuxsll.Po + -rm -f core/object/$(DEPDIR)/linuxsll2.Po -rm -f core/object/$(DEPDIR)/loop.Po -rm -f core/object/$(DEPDIR)/null.Po -rm -f core/object/$(DEPDIR)/payload.Po @@ -1378,6 +1388,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f core/object/$(DEPDIR)/ip.Po -rm -f core/object/$(DEPDIR)/ip6.Po -rm -f core/object/$(DEPDIR)/linuxsll.Po + -rm -f core/object/$(DEPDIR)/linuxsll2.Po -rm -f core/object/$(DEPDIR)/loop.Po -rm -f core/object/$(DEPDIR)/null.Po -rm -f core/object/$(DEPDIR)/payload.Po @@ -1551,6 +1562,9 @@ dnsjit.core.object.ip6.3in: core/object/ip6.lua gen-manpage.lua dnsjit.core.object.ip.3in: core/object/ip.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/ip.lua" > "$@" +dnsjit.core.object.linuxsll2.3in: core/object/linuxsll2.lua gen-manpage.lua + $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll2.lua" > "$@" + dnsjit.core.object.linuxsll.3in: core/object/linuxsll.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll.lua" > "$@" diff --git a/include/dnsjit/core.lua b/include/dnsjit/core.lua index bff4223..08b9900 100644 --- a/include/dnsjit/core.lua +++ b/include/dnsjit/core.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 36083be..cb269b7 100644 --- a/include/dnsjit/core/assert.h +++ b/include/dnsjit/core/assert.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 6c6d1b4..e57bb4e 100644 --- a/include/dnsjit/core/channel.c +++ b/include/dnsjit/core/channel.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 15b3e0a..ecdac73 100644 --- a/include/dnsjit/core/channel.h +++ b/include/dnsjit/core/channel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 0f3bc81..f3da955 100644 --- a/include/dnsjit/core/channel.hh +++ b/include/dnsjit/core/channel.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/channel.lua b/include/dnsjit/core/channel.lua index 10edfde..89d5974 100644 --- a/include/dnsjit/core/channel.lua +++ b/include/dnsjit/core/channel.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 3138829..94a3f43 100644 --- a/include/dnsjit/core/compat.c +++ b/include/dnsjit/core/compat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 1f4f8b9..799464a 100644 --- a/include/dnsjit/core/compat.h +++ b/include/dnsjit/core/compat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 98c6611..f7d038e 100644 --- a/include/dnsjit/core/compat.lua +++ b/include/dnsjit/core/compat.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 8d2eddb..665df01 100644 --- a/include/dnsjit/core/file.c +++ b/include/dnsjit/core/file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 280d320..fb7102e 100644 --- a/include/dnsjit/core/file.h +++ b/include/dnsjit/core/file.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 eb87f3b..9578963 100644 --- a/include/dnsjit/core/file.hh +++ b/include/dnsjit/core/file.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 33e180c..b3d618f 100644 --- a/include/dnsjit/core/file.lua +++ b/include/dnsjit/core/file.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 1c5f9e2..4b602bd 100644 --- a/include/dnsjit/core/loader.lua +++ b/include/dnsjit/core/loader.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 03b7b2e..4ff9b45 100644 --- a/include/dnsjit/core/log.c +++ b/include/dnsjit/core/log.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 7e012c6..a2d2453 100644 --- a/include/dnsjit/core/log.h +++ b/include/dnsjit/core/log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 9921d4c..c59a78b 100644 --- a/include/dnsjit/core/log.hh +++ b/include/dnsjit/core/log.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 b08cc59..a7bd36c 100644 --- a/include/dnsjit/core/log.lua +++ b/include/dnsjit/core/log.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 33190dd..fb8eb7d 100644 --- a/include/dnsjit/core/object.c +++ b/include/dnsjit/core/object.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -27,6 +27,7 @@ #include "core/object/null.h" #include "core/object/loop.h" #include "core/object/linuxsll.h" +#include "core/object/linuxsll2.h" #include "core/object/ieee802.h" #include "core/object/gre.h" #include "core/object/ip.h" @@ -57,6 +58,8 @@ core_object_t* core_object_copy(const core_object_t* self) return (core_object_t*)core_object_ieee802_copy((core_object_ieee802_t*)self); case CORE_OBJECT_GRE: return (core_object_t*)core_object_gre_copy((core_object_gre_t*)self); + case CORE_OBJECT_LINUXSLL2: + return (core_object_t*)core_object_linuxsll2_copy((core_object_linuxsll2_t*)self); case CORE_OBJECT_IP: return (core_object_t*)core_object_ip_copy((core_object_ip_t*)self); case CORE_OBJECT_IP6: @@ -105,6 +108,9 @@ void core_object_free(core_object_t* self) case CORE_OBJECT_GRE: core_object_gre_free((core_object_gre_t*)self); break; + case CORE_OBJECT_LINUXSLL2: + core_object_linuxsll2_free((core_object_linuxsll2_t*)self); + break; case CORE_OBJECT_IP: core_object_ip_free((core_object_ip_t*)self); break; diff --git a/include/dnsjit/core/object.h b/include/dnsjit/core/object.h index 3a0c0cb..8745a86 100644 --- a/include/dnsjit/core/object.h +++ b/include/dnsjit/core/object.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -30,6 +30,7 @@ #define CORE_OBJECT_LINUXSLL 13 #define CORE_OBJECT_IEEE802 14 #define CORE_OBJECT_GRE 15 +#define CORE_OBJECT_LINUXSLL2 16 /* protocol objects */ #define CORE_OBJECT_IP 20 #define CORE_OBJECT_IP6 21 diff --git a/include/dnsjit/core/object.hh b/include/dnsjit/core/object.hh index 5e125c4..3a6cabf 100644 --- a/include/dnsjit/core/object.hh +++ b/include/dnsjit/core/object.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 f950ce1..15e9d7b 100644 --- a/include/dnsjit/core/object.lua +++ b/include/dnsjit/core/object.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -41,6 +41,7 @@ require("dnsjit.core.object.ether_h") require("dnsjit.core.object.null_h") require("dnsjit.core.object.loop_h") require("dnsjit.core.object.linuxsll_h") +require("dnsjit.core.object.linuxsll2_h") require("dnsjit.core.object.ieee802_h") require("dnsjit.core.object.gre_h") require("dnsjit.core.object.ip_h") @@ -65,6 +66,7 @@ local Object = { LINUXSLL = 13, IEEE802 = 14, GRE = 15, + LINUXSLL2 = 16, IP = 20, IP6 = 21, ICMP = 22, @@ -83,6 +85,7 @@ _type[Object.LOOP] = "loop" _type[Object.LINUXSLL] = "linuxsll" _type[Object.IEEE802] = "ieee802" _type[Object.GRE] = "gre" +_type[Object.LINUXSLL2] = "linuxsll2" _type[Object.IP] = "ip" _type[Object.IP6] = "ip6" _type[Object.ICMP] = "icmp" @@ -112,6 +115,7 @@ _cast[Object.LOOP] = "core_object_loop_t*" _cast[Object.LINUXSLL] = "core_object_linuxsll_t*" _cast[Object.IEEE802] = "core_object_ieee802_t*" _cast[Object.GRE] = "core_object_gre_t*" +_cast[Object.LINUXSLL2] = "core_object_linuxsll2_t*" _cast[Object.IP] = "core_object_ip_t*" _cast[Object.IP6] = "core_object_ip6_t*" _cast[Object.ICMP] = "core_object_icmp_t*" @@ -164,6 +168,7 @@ core_object_t = ffi.metatype(t_name, { __index = Object }) -- dnsjit.core.object.null (3), -- dnsjit.core.object.loop (3), -- dnsjit.core.object.linuxsll (3), +-- dnsjit.core.object.linuxsll2 (3), -- dnsjit.core.object.ieee802 (3), -- dnsjit.core.object.gre (3), -- dnsjit.core.object.ip (3), diff --git a/include/dnsjit/core/object/dns.c b/include/dnsjit/core/object/dns.c index 85eb9a7..8f1a26f 100644 --- a/include/dnsjit/core/object/dns.c +++ b/include/dnsjit/core/object/dns.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -51,6 +51,7 @@ #define bswap_64(x) bswap64(x) #endif #endif +#include #define _ERR_MALFORMED -2 #define _ERR_NEEDLABELS -3 @@ -475,3 +476,32 @@ int core_object_dns_parse_rr(core_object_dns_t* self, core_object_dns_rr_t* rr, // TODO: error here on malformed/truncated? could be quite spammy return _ERR_MALFORMED; } + +const char* core_object_dns_torfc1035(const char* str, size_t len) +{ + mlassert(str, "str is nil"); + static char res[512]; + + size_t i, j = 0; + for (i = 0; i < len; i++) { + if (j + 4 >= sizeof(res) - 1) { + return 0; + } + + if (isalnum(str[i]) || str[i] == '-' || str[i] == '_') { + res[j++] = str[i]; + } else if (isprint(str[i])) { + res[j++] = '\\'; + res[j++] = str[i]; + } else { + res[j++] = '\\'; + res[j++] = '0' + (((unsigned char)str[i] >> 6) & 0x07); + res[j++] = '0' + (((unsigned char)str[i] >> 3) & 0x07); + res[j++] = '0' + ((unsigned char)str[i] & 0x07); + } + } + + res[j] = 0; + + return res; +} \ No newline at end of file diff --git a/include/dnsjit/core/object/dns.h b/include/dnsjit/core/object/dns.h index a2b3d56..683c63d 100644 --- a/include/dnsjit/core/object/dns.h +++ b/include/dnsjit/core/object/dns.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4efd148..4e3c31f 100644 --- a/include/dnsjit/core/object/dns.hh +++ b/include/dnsjit/core/object/dns.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -117,3 +117,5 @@ void core_object_dns_reset(core_object_dns_t* self); int core_object_dns_parse_header(core_object_dns_t* self); int core_object_dns_parse_q(core_object_dns_t* self, core_object_dns_q_t* q, core_object_dns_label_t* label, size_t labels); int core_object_dns_parse_rr(core_object_dns_t* self, core_object_dns_rr_t* rr, core_object_dns_label_t* label, size_t labels); + +const char* core_object_dns_torfc1035(const char* str, size_t len); diff --git a/include/dnsjit/core/object/dns.lua b/include/dnsjit/core/object/dns.lua index 6cb3477..c296e3f 100644 --- a/include/dnsjit/core/object/dns.lua +++ b/include/dnsjit/core/object/dns.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 34e77d8..15569f5 100644 --- a/include/dnsjit/core/object/dns/label.lua +++ b/include/dnsjit/core/object/dns/label.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -67,8 +67,16 @@ function Label.new(size) end -- Returns labels as a string and an offset to the next label. --- The string may be nil if the first label was an offset. --- The offset may be nil if the last label was an extension bits or end marker. +-- Takes argument +-- .IR labels , +-- an array of labels returned by any of the parse functions, and +-- .IR num_labels , +-- number of labels in the array. +-- Optional +-- .I offset_labels +-- can be used to skip labels at the start. +-- The return string may be nil if the first label was an offset. +-- The return offset may be nil if the last label was an extension bits or end marker. function Label.tostring(dns, labels, num_labels, offset_labels) if offset_labels == nil then offset_labels = 0 @@ -91,9 +99,50 @@ function Label.tostring(dns, labels, num_labels, offset_labels) return dn, nil end +-- Returns a RFC1035 domain name of the labels and an offset to the next label. +-- Takes argument +-- .IR labels , +-- an array of labels returned by any of the parse functions, and +-- .IR num_labels , +-- number of labels in the array. +-- Optional +-- .I offset_labels +-- can be used to skip labels at the start. +-- The return string may be nil if the first label was an offset. +-- The return offset may be nil if the last label was an extension bits or end marker. +function Label.torfc1035(dns, labels, num_labels, offset_labels) + if offset_labels == nil then + offset_labels = 0 + end + local dn + for n = 1, tonumber(num_labels) do + local label = labels[n - 1 + offset_labels] + + if label.have_dn == 1 then + if dn == nil then + dn = "" + end + dn = dn .. ffi.string(ffi.C.core_object_dns_torfc1035(dns.payload + label.offset + 1, label.length)) .. "." + elseif label.have_offset == 1 then + return dn, label.offset + else + return dn, nil + end + end + return dn, nil +end + -- Returns labels as a string which also includes a textual notation of the -- offset in the form of -- .IR "label" . +-- Takes argument +-- .IR labels , +-- an array of labels returned by any of the parse functions, and +-- .IR num_labels , +-- number of labels in the array. +-- Optional +-- .I offset_labels +-- can be used to skip labels at the start. function Label.tooffstr(dns, labels, num_labels, offset_labels) if offset_labels == nil then offset_labels = 0 diff --git a/include/dnsjit/core/object/dns/q.lua b/include/dnsjit/core/object/dns/q.lua index 5b90d6c..b6b8681 100644 --- a/include/dnsjit/core/object/dns/q.lua +++ b/include/dnsjit/core/object/dns/q.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 5689b5f..e03d92b 100644 --- a/include/dnsjit/core/object/dns/rr.lua +++ b/include/dnsjit/core/object/dns/rr.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 0d8b160..67adc26 100644 --- a/include/dnsjit/core/object/ether.c +++ b/include/dnsjit/core/object/ether.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 7f7f948..a674aa7 100644 --- a/include/dnsjit/core/object/ether.h +++ b/include/dnsjit/core/object/ether.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 9e5fc4f..9291980 100644 --- a/include/dnsjit/core/object/ether.hh +++ b/include/dnsjit/core/object/ether.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/ether.lua b/include/dnsjit/core/object/ether.lua index 00400d0..3a4bc60 100644 --- a/include/dnsjit/core/object/ether.lua +++ b/include/dnsjit/core/object/ether.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 9b5187e..1961721 100644 --- a/include/dnsjit/core/object/gre.c +++ b/include/dnsjit/core/object/gre.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 6c6142c..89bf41f 100644 --- a/include/dnsjit/core/object/gre.h +++ b/include/dnsjit/core/object/gre.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 18ab7c8..bf7b3b0 100644 --- a/include/dnsjit/core/object/gre.hh +++ b/include/dnsjit/core/object/gre.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/gre.lua b/include/dnsjit/core/object/gre.lua index e518888..82f16cf 100644 --- a/include/dnsjit/core/object/gre.lua +++ b/include/dnsjit/core/object/gre.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 609b4e2..b02a6ec 100644 --- a/include/dnsjit/core/object/icmp.c +++ b/include/dnsjit/core/object/icmp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 e923b16..501251b 100644 --- a/include/dnsjit/core/object/icmp.h +++ b/include/dnsjit/core/object/icmp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 faf528d..4f189e6 100644 --- a/include/dnsjit/core/object/icmp.hh +++ b/include/dnsjit/core/object/icmp.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/icmp.lua b/include/dnsjit/core/object/icmp.lua index dd916d4..c3e9555 100644 --- a/include/dnsjit/core/object/icmp.lua +++ b/include/dnsjit/core/object/icmp.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 250d5a5..1dfcae2 100644 --- a/include/dnsjit/core/object/icmp6.c +++ b/include/dnsjit/core/object/icmp6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 62ad056..a81bc0a 100644 --- a/include/dnsjit/core/object/icmp6.h +++ b/include/dnsjit/core/object/icmp6.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 250af69..7a9a768 100644 --- a/include/dnsjit/core/object/icmp6.hh +++ b/include/dnsjit/core/object/icmp6.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/icmp6.lua b/include/dnsjit/core/object/icmp6.lua index 8ac6c8f..aba05e5 100644 --- a/include/dnsjit/core/object/icmp6.lua +++ b/include/dnsjit/core/object/icmp6.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 e81fbab..b33031f 100644 --- a/include/dnsjit/core/object/ieee802.c +++ b/include/dnsjit/core/object/ieee802.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 487acb3..c4cefc1 100644 --- a/include/dnsjit/core/object/ieee802.h +++ b/include/dnsjit/core/object/ieee802.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 3abb71d..e67e2db 100644 --- a/include/dnsjit/core/object/ieee802.hh +++ b/include/dnsjit/core/object/ieee802.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/ieee802.lua b/include/dnsjit/core/object/ieee802.lua index e0d5e23..97870b0 100644 --- a/include/dnsjit/core/object/ieee802.lua +++ b/include/dnsjit/core/object/ieee802.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 ff58810..155da89 100644 --- a/include/dnsjit/core/object/ip.c +++ b/include/dnsjit/core/object/ip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 1fdcdb8..ebd2d66 100644 --- a/include/dnsjit/core/object/ip.h +++ b/include/dnsjit/core/object/ip.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 8bdb288..98c3b59 100644 --- a/include/dnsjit/core/object/ip.hh +++ b/include/dnsjit/core/object/ip.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/ip.lua b/include/dnsjit/core/object/ip.lua index 787acb8..9193bd5 100644 --- a/include/dnsjit/core/object/ip.lua +++ b/include/dnsjit/core/object/ip.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 8117226..7efe385 100644 --- a/include/dnsjit/core/object/ip6.c +++ b/include/dnsjit/core/object/ip6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 35f31df..5df5158 100644 --- a/include/dnsjit/core/object/ip6.h +++ b/include/dnsjit/core/object/ip6.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -37,6 +37,7 @@ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \ 0, 0, 0, 0, \ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \ + 0, \ } #endif diff --git a/include/dnsjit/core/object/ip6.hh b/include/dnsjit/core/object/ip6.hh index 5b4823e..a9b3478 100644 --- a/include/dnsjit/core/object/ip6.hh +++ b/include/dnsjit/core/object/ip6.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -36,6 +36,8 @@ typedef struct core_object_ip6 { uint16_t frag_offlg; uint16_t frag_ident; uint8_t rtdst[16]; + + uint16_t hlen; } core_object_ip6_t; core_object_ip6_t* core_object_ip6_copy(const core_object_ip6_t* self); diff --git a/include/dnsjit/core/object/ip6.lua b/include/dnsjit/core/object/ip6.lua index 459e7dd..948d3e9 100644 --- a/include/dnsjit/core/object/ip6.lua +++ b/include/dnsjit/core/object/ip6.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -58,6 +58,9 @@ -- rtdst -- Destination address found in the routing extension header. -- .TP +-- hlen +-- The length of extension headers, in bytes. +-- .TP -- payload -- A pointer to the payload. -- .TP diff --git a/include/dnsjit/core/object/linuxsll.c b/include/dnsjit/core/object/linuxsll.c index f96d55a..d71a34d 100644 --- a/include/dnsjit/core/object/linuxsll.c +++ b/include/dnsjit/core/object/linuxsll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 c9c2c3f..dea18ee 100644 --- a/include/dnsjit/core/object/linuxsll.h +++ b/include/dnsjit/core/object/linuxsll.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 d9dc99b..7df2d00 100644 --- a/include/dnsjit/core/object/linuxsll.hh +++ b/include/dnsjit/core/object/linuxsll.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/linuxsll.lua b/include/dnsjit/core/object/linuxsll.lua index 8436ce0..29506d5 100644 --- a/include/dnsjit/core/object/linuxsll.lua +++ b/include/dnsjit/core/object/linuxsll.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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/linuxsll2.c similarity index 70% copy from include/dnsjit/core/object/icmp6.c copy to include/dnsjit/core/object/linuxsll2.c index 250d5a5..e5b8b48 100644 --- a/include/dnsjit/core/object/icmp6.c +++ b/include/dnsjit/core/object/linuxsll2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -20,25 +20,25 @@ #include "config.h" -#include "core/object/icmp6.h" +#include "core/object/linuxsll2.h" #include "core/assert.h" #include #include -core_object_icmp6_t* core_object_icmp6_copy(const core_object_icmp6_t* self) +core_object_linuxsll2_t* core_object_linuxsll2_copy(const core_object_linuxsll2_t* self) { - core_object_icmp6_t* copy; + core_object_linuxsll2_t* copy; glassert_self(); - glfatal_oom(copy = malloc(sizeof(core_object_icmp6_t))); - memcpy(copy, self, sizeof(core_object_icmp6_t)); + glfatal_oom(copy = malloc(sizeof(core_object_linuxsll2_t))); + memcpy(copy, self, sizeof(core_object_linuxsll2_t)); copy->obj_prev = 0; return copy; } -void core_object_icmp6_free(core_object_icmp6_t* self) +void core_object_linuxsll2_free(core_object_linuxsll2_t* self) { glassert_self(); free(self); diff --git a/include/dnsjit/core/object/gre.h b/include/dnsjit/core/object/linuxsll2.h similarity index 63% copy from include/dnsjit/core/object/gre.h copy to include/dnsjit/core/object/linuxsll2.h index 6c6142c..b0b77e0 100644 --- a/include/dnsjit/core/object/gre.h +++ b/include/dnsjit/core/object/linuxsll2.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -21,18 +21,18 @@ #include #include -#ifndef __dnsjit_core_object_gre_h -#define __dnsjit_core_object_gre_h +#ifndef __dnsjit_core_object_linuxsll2_h +#define __dnsjit_core_object_linuxsll2_h #include -#include +#include -#define CORE_OBJECT_GRE_INIT(prev) \ - { \ - CORE_OBJECT_INIT(CORE_OBJECT_GRE, prev) \ - , \ - 0, 0, 0, 0, 0 \ +#define CORE_OBJECT_LINUXSLL2_INIT(prev) \ + { \ + CORE_OBJECT_INIT(CORE_OBJECT_LINUXSLL2, prev) \ + , \ + 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } \ } #endif diff --git a/include/dnsjit/core/object/linuxsll.hh b/include/dnsjit/core/object/linuxsll2.hh similarity index 65% copy from include/dnsjit/core/object/linuxsll.hh copy to include/dnsjit/core/object/linuxsll2.hh index d9dc99b..3716dab 100644 --- a/include/dnsjit/core/object/linuxsll.hh +++ b/include/dnsjit/core/object/linuxsll2.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -20,16 +20,18 @@ // lua:require("dnsjit.core.object_h") -typedef struct core_object_linuxsll { +typedef struct core_object_linuxsll2 { const core_object_t* obj_prev; int32_t obj_type; - uint16_t packet_type; - uint16_t arp_hardware; - uint16_t link_layer_address_length; + uint16_t protocol_type; + uint16_t reserved; + uint32_t interface_index; + uint16_t arphrd_type; + uint8_t packet_type; + uint8_t link_layer_address_length; uint8_t link_layer_address[8]; - uint16_t ether_type; -} core_object_linuxsll_t; +} core_object_linuxsll2_t; -core_object_linuxsll_t* core_object_linuxsll_copy(const core_object_linuxsll_t* self); -void core_object_linuxsll_free(core_object_linuxsll_t* self); +core_object_linuxsll2_t* core_object_linuxsll2_copy(const core_object_linuxsll2_t* self); +void core_object_linuxsll2_free(core_object_linuxsll2_t* self); diff --git a/src/core/object/linuxsll.lua b/include/dnsjit/core/object/linuxsll2.lua similarity index 62% copy from src/core/object/linuxsll.lua copy to include/dnsjit/core/object/linuxsll2.lua index 8436ce0..3300196 100644 --- a/src/core/object/linuxsll.lua +++ b/include/dnsjit/core/object/linuxsll2.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -16,69 +16,75 @@ -- You should have received a copy of the GNU General Public License -- along with dnsjit. If not, see . --- dnsjit.core.object.linuxsll --- Linux cooked-mode capture (SLL) part of a packet +-- dnsjit.core.object.linuxsll2 +-- Linux cooked-mode v2 capture (SLL2) part of a packet -- --- The SLL part of a packet that usually can be found in the object chain +-- The SLL2 part of a packet that usually can be found in the object chain -- after parsing with, for example, Layer filter. -- .SS Attributes -- .TP +-- protocol_type +-- The protocol type. +-- .TP +-- reserved +-- Reserved (MBZ). +-- .TP +-- interface_index +-- The interface index, on the machine on which the capture is done, of the interface on which the packet was sent or received. +-- .TP +-- arphrd_type +-- The link-layer device type. +-- .TP -- packet_type -- The packet type. -- .TP --- arp_hardware --- The link-layer device type. --- .TP -- link_layer_address_length -- The length of the link-layer address. -- .TP -- link_layer_address -- The link-layer address. --- .TP --- ether_type --- An Ethernet protocol type. module(...,package.seeall) -require("dnsjit.core.object.linuxsll_h") +require("dnsjit.core.object.linuxsll2_h") local ffi = require("ffi") local C = ffi.C -local t_name = "core_object_linuxsll_t" -local core_object_linuxsll_t -local Linuxsll = {} +local t_name = "core_object_linuxsll2_t" +local core_object_linuxsll2_t +local Linuxsll2 = {} -- Return the textual type of the object. -function Linuxsll:type() - return "linuxsll" +function Linuxsll2:type() + return "linuxsll2" end -- Return the previous object. -function Linuxsll:prev() +function Linuxsll2:prev() return self.obj_prev end -- Cast the object to the underlining object module and return it. -function Linuxsll:cast() +function Linuxsll2:cast() return self end -- Cast the object to the generic object module and return it. -function Linuxsll:uncast() +function Linuxsll2:uncast() return ffi.cast("core_object_t*", self) end -- Make a copy of the object and return it. -function Linuxsll:copy() - return C.core_object_linuxsll_copy(self) +function Linuxsll2:copy() + return C.core_object_linuxsll2_copy(self) end -- Free the object, should only be used on copies or otherwise allocated. -function Linuxsll:free() - C.core_object_linuxsll_free(self) +function Linuxsll2:free() + C.core_object_linuxsll2_free(self) end -core_object_linuxsll_t = ffi.metatype(t_name, { __index = Linuxsll }) +core_object_linuxsll2_t = ffi.metatype(t_name, { __index = Linuxsll2 }) -- dnsjit.core.object (3). -- dnsjit.filter.layer (3) -return Linuxsll +return Linuxsll2 diff --git a/include/dnsjit/core/object/loop.c b/include/dnsjit/core/object/loop.c index 6ab171b..3df638a 100644 --- a/include/dnsjit/core/object/loop.c +++ b/include/dnsjit/core/object/loop.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 911ba45..c1c107c 100644 --- a/include/dnsjit/core/object/loop.h +++ b/include/dnsjit/core/object/loop.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 b1e4991..3e2c8e9 100644 --- a/include/dnsjit/core/object/loop.hh +++ b/include/dnsjit/core/object/loop.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/loop.lua b/include/dnsjit/core/object/loop.lua index f38b70d..c9acbdb 100644 --- a/include/dnsjit/core/object/loop.lua +++ b/include/dnsjit/core/object/loop.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 8e0b9fd..85ba83f 100644 --- a/include/dnsjit/core/object/null.c +++ b/include/dnsjit/core/object/null.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 d807541..071c6c2 100644 --- a/include/dnsjit/core/object/null.h +++ b/include/dnsjit/core/object/null.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 95293a3..7d6ea1d 100644 --- a/include/dnsjit/core/object/null.hh +++ b/include/dnsjit/core/object/null.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/null.lua b/include/dnsjit/core/object/null.lua index 46939eb..3689342 100644 --- a/include/dnsjit/core/object/null.lua +++ b/include/dnsjit/core/object/null.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 17188d2..8cd37d8 100644 --- a/include/dnsjit/core/object/payload.c +++ b/include/dnsjit/core/object/payload.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 898379a..67f3c1b 100644 --- a/include/dnsjit/core/object/payload.h +++ b/include/dnsjit/core/object/payload.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 e9d86fb..56465dd 100644 --- a/include/dnsjit/core/object/payload.hh +++ b/include/dnsjit/core/object/payload.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/payload.lua b/include/dnsjit/core/object/payload.lua index ac4d2a7..1f627c9 100644 --- a/include/dnsjit/core/object/payload.lua +++ b/include/dnsjit/core/object/payload.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 fc6c7be..fb58568 100644 --- a/include/dnsjit/core/object/pcap.c +++ b/include/dnsjit/core/object/pcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 ed87c26..8f28e20 100644 --- a/include/dnsjit/core/object/pcap.h +++ b/include/dnsjit/core/object/pcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4d2ec48..472400e 100644 --- a/include/dnsjit/core/object/pcap.hh +++ b/include/dnsjit/core/object/pcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/pcap.lua b/include/dnsjit/core/object/pcap.lua index 66b049e..0311e6c 100644 --- a/include/dnsjit/core/object/pcap.lua +++ b/include/dnsjit/core/object/pcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 4a916c6..c1897c9 100644 --- a/include/dnsjit/core/object/tcp.c +++ b/include/dnsjit/core/object/tcp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 490b644..dd54829 100644 --- a/include/dnsjit/core/object/tcp.h +++ b/include/dnsjit/core/object/tcp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 b9a659a..69b9f2b 100644 --- a/include/dnsjit/core/object/tcp.hh +++ b/include/dnsjit/core/object/tcp.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/tcp.lua b/include/dnsjit/core/object/tcp.lua index 5e23a4b..c0bf07d 100644 --- a/include/dnsjit/core/object/tcp.lua +++ b/include/dnsjit/core/object/tcp.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 ff6c7a2..5ed29ae 100644 --- a/include/dnsjit/core/object/udp.c +++ b/include/dnsjit/core/object/udp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 c58b13d..50d4940 100644 --- a/include/dnsjit/core/object/udp.h +++ b/include/dnsjit/core/object/udp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 39748a4..5627b12 100644 --- a/include/dnsjit/core/object/udp.hh +++ b/include/dnsjit/core/object/udp.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/object/udp.lua b/include/dnsjit/core/object/udp.lua index e23408b..0dd5c79 100644 --- a/include/dnsjit/core/object/udp.lua +++ b/include/dnsjit/core/object/udp.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 c4b7639..5fbd499 100644 --- a/include/dnsjit/core/objects.lua +++ b/include/dnsjit/core/objects.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -31,6 +31,7 @@ require("dnsjit.core.object.ether") require("dnsjit.core.object.null") require("dnsjit.core.object.loop") require("dnsjit.core.object.linuxsll") +require("dnsjit.core.object.linuxsll2") require("dnsjit.core.object.ieee802") require("dnsjit.core.object.gre") require("dnsjit.core.object.ip") @@ -48,6 +49,7 @@ require("dnsjit.core.object.dns") -- dnsjit.core.object.null (3), -- dnsjit.core.object.loop (3), -- dnsjit.core.object.linuxsll (3), +-- dnsjit.core.object.linuxsll2 (3), -- dnsjit.core.object.ieee802 (3), -- dnsjit.core.object.gre (3), -- dnsjit.core.object.ip (3), diff --git a/include/dnsjit/core/producer.c b/include/dnsjit/core/producer.c index 61ea255..db3352a 100644 --- a/include/dnsjit/core/producer.c +++ b/include/dnsjit/core/producer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 139782e..3c56797 100644 --- a/include/dnsjit/core/producer.h +++ b/include/dnsjit/core/producer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 ab3a222..fa957e0 100644 --- a/include/dnsjit/core/producer.hh +++ b/include/dnsjit/core/producer.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/producer.lua b/include/dnsjit/core/producer.lua index e457807..f9d91ca 100644 --- a/include/dnsjit/core/producer.lua +++ b/include/dnsjit/core/producer.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 5264549..5e33425 100644 --- a/include/dnsjit/core/receiver.c +++ b/include/dnsjit/core/receiver.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 e109778..9818f44 100644 --- a/include/dnsjit/core/receiver.h +++ b/include/dnsjit/core/receiver.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 3bea05f..fdb0da5 100644 --- a/include/dnsjit/core/receiver.hh +++ b/include/dnsjit/core/receiver.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/receiver.lua b/include/dnsjit/core/receiver.lua index 91c4cee..d4a160c 100644 --- a/include/dnsjit/core/receiver.lua +++ b/include/dnsjit/core/receiver.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 abaa063..0c090bd 100644 --- a/include/dnsjit/core/thread.c +++ b/include/dnsjit/core/thread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/thread.h b/include/dnsjit/core/thread.h index ffae739..8c46cdc 100644 --- a/include/dnsjit/core/thread.h +++ b/include/dnsjit/core/thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 1161f13..e8b4e65 100644 --- a/include/dnsjit/core/thread.hh +++ b/include/dnsjit/core/thread.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/core/thread.lua b/include/dnsjit/core/thread.lua index 577e9bf..1eef11a 100644 --- a/include/dnsjit/core/thread.lua +++ b/include/dnsjit/core/thread.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/core/timespec.h b/include/dnsjit/core/timespec.h index 5d99e24..9f1caa4 100644 --- a/include/dnsjit/core/timespec.h +++ b/include/dnsjit/core/timespec.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 0c40d11..ec02530 100644 --- a/include/dnsjit/core/timespec.hh +++ b/include/dnsjit/core/timespec.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 ab810e0..b371543 100644 --- a/include/dnsjit/core/timespec.lua +++ b/include/dnsjit/core/timespec.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/dnsjit.1in b/include/dnsjit/dnsjit.1in index 3d2262e..bc97a0a 100644 --- a/include/dnsjit/dnsjit.1in +++ b/include/dnsjit/dnsjit.1in @@ -1,4 +1,4 @@ -.\" Copyright (c) 2018-2024 OARC, Inc. +.\" Copyright (c) 2018-2025 OARC, Inc. .\" All rights reserved. .\" .\" This file is part of dnsjit. diff --git a/include/dnsjit/dnsjit.c b/include/dnsjit/dnsjit.c index 20b8d14..5422814 100644 --- a/include/dnsjit/dnsjit.c +++ b/include/dnsjit/dnsjit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/filter.lua b/include/dnsjit/filter.lua index 29f0c77..72d2ca3 100644 --- a/include/dnsjit/filter.lua +++ b/include/dnsjit/filter.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/filter/copy.c b/include/dnsjit/filter/copy.c index 04a90ef..377e22e 100644 --- a/include/dnsjit/filter/copy.c +++ b/include/dnsjit/filter/copy.c @@ -100,6 +100,9 @@ void filter_copy_set(filter_copy_t* self, int32_t obj_type) case CORE_OBJECT_DNS: self->copy |= 0x8000; break; + case CORE_OBJECT_LINUXSLL2: + self->copy |= 0x10000; + break; default: lfatal("unknown type %d", obj_type); } @@ -142,6 +145,8 @@ uint64_t filter_copy_get(filter_copy_t* self, int32_t obj_type) return self->copy & 0x4000; case CORE_OBJECT_DNS: return self->copy & 0x8000; + case CORE_OBJECT_LINUXSLL2: + return self->copy & 0x10000; default: lfatal("unknown type %d", obj_type); } diff --git a/include/dnsjit/filter/layer.c b/include/dnsjit/filter/layer.c index 80f0450..3b88123 100644 --- a/include/dnsjit/filter/layer.c +++ b/include/dnsjit/filter/layer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -74,6 +74,7 @@ static filter_layer_t _defaults = { CORE_OBJECT_ETHER_INIT(0), CORE_OBJECT_LOOP_INIT(0), CORE_OBJECT_LINUXSLL_INIT(0), + CORE_OBJECT_LINUXSLL2_INIT(0), 0, { CORE_OBJECT_IEEE802_INIT(0), CORE_OBJECT_IEEE802_INIT(0), CORE_OBJECT_IEEE802_INIT(0) }, CORE_OBJECT_IP_INIT(0), CORE_OBJECT_IP6_INIT(0), @@ -251,8 +252,8 @@ static inline int _proto(filter_layer_t* self, uint8_t proto, const core_object_ payload->obj_prev = (core_object_t*)udp; /* Check for padding */ - if (len > udp->ulen) { - payload->padding = len - udp->ulen; + if (len > (udp->ulen - 8)) { + payload->padding = len - (udp->ulen - 8); payload->len = len - payload->padding; } else { payload->padding = 0; @@ -287,11 +288,11 @@ static inline int _proto(filter_layer_t* self, uint8_t proto, const core_object_ payload->obj_prev = (core_object_t*)tcp; /* Check for padding */ - if (obj->obj_type == CORE_OBJECT_IP && len > (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4))) { - payload->padding = len - (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4)); + if (obj->obj_type == CORE_OBJECT_IP && len > (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4) - (tcp->off * 4))) { + payload->padding = len - (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4) - (tcp->off * 4)); payload->len = len - payload->padding; - } else if (obj->obj_type == CORE_OBJECT_IP6 && len > ((const core_object_ip6_t*)obj)->plen) { - payload->padding = len - ((const core_object_ip6_t*)obj)->plen; + } else if (obj->obj_type == CORE_OBJECT_IP6 && len > (((const core_object_ip6_t*)obj)->plen - ((const core_object_ip6_t*)obj)->hlen - (tcp->off * 4))) { + payload->padding = len - (((const core_object_ip6_t*)obj)->plen - ((const core_object_ip6_t*)obj)->hlen - (tcp->off * 4)); payload->len = len - payload->padding; } else { payload->padding = 0; @@ -381,6 +382,7 @@ static inline int _ip(filter_layer_t* self, const core_object_t* obj, const unsi need8(ip6->hlim, pkt, len); needxb(&ip6->src, 16, pkt, len); needxb(&ip6->dst, 16, pkt, len); + ip6->hlen = 0; /* Check reported length for missing payload */ if (len < ip6->plen) { @@ -401,6 +403,7 @@ static inline int _ip(filter_layer_t* self, const core_object_t* obj, const unsi */ if (ext.ip6e_len) { advancexb(ext.ip6e_len * 8, pkt, len); + ip6->hlen += ext.ip6e_len * 8; } /* TODO: Store IPv6 headers? */ @@ -454,8 +457,8 @@ static inline int _ip(filter_layer_t* self, const core_object_t* obj, const unsi payload->obj_prev = (core_object_t*)ip6; /* Check for padding */ - if (len > ip6->plen) { - payload->padding = len - ip6->plen; + if (len > (ip6->plen - ip6->hlen)) { + payload->padding = len - (ip6->plen - ip6->hlen); payload->len = len - payload->padding; } else { payload->padding = 0; @@ -629,6 +632,33 @@ static inline int _link(filter_layer_t* self, const core_object_pcap_t* pcap) } break; } + case DLT_LINUX_SLL2: { + core_object_linuxsll2_t* linuxsll2 = &self->linuxsll2; + linuxsll2->obj_prev = (core_object_t*)pcap; + + need16(linuxsll2->protocol_type, pkt, len); + need16(linuxsll2->reserved, pkt, len); + need32(linuxsll2->interface_index, pkt, len); + need16(linuxsll2->arphrd_type, pkt, len); + need8(linuxsll2->packet_type, pkt, len); + need8(linuxsll2->link_layer_address_length, pkt, len); + needxb(linuxsll2->link_layer_address, 8, pkt, len); + + switch (linuxsll2->protocol_type) { + case 0x8100: /* 802.1q */ + case 0x88a8: /* 802.1ad */ + case 0x9100: /* 802.1 QinQ non-standard */ + return _ieee802(self, linuxsll2->protocol_type, (core_object_t*)linuxsll2, pkt, len); + + case ETHERTYPE_IP: + case ETHERTYPE_IPV6: + return _ip(self, (core_object_t*)linuxsll2, pkt, len); + + default: + break; + } + break; + } /* TODO: These might be interesting to implement case DLT_IPNET: case DLT_PKTAP: diff --git a/include/dnsjit/filter/layer.h b/include/dnsjit/filter/layer.h index 6e527d9..6989daa 100644 --- a/include/dnsjit/filter/layer.h +++ b/include/dnsjit/filter/layer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/include/dnsjit/filter/layer.hh b/include/dnsjit/filter/layer.hh index d60d1fc..ec9e5f1 100644 --- a/include/dnsjit/filter/layer.hh +++ b/include/dnsjit/filter/layer.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -26,6 +26,7 @@ // 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.linuxsll2_h") // lua:require("dnsjit.core.object.ieee802_h") // lua:require("dnsjit.core.object.ip_h") // lua:require("dnsjit.core.object.ip6_h") @@ -44,21 +45,22 @@ typedef struct filter_layer { core_producer_t prod; void* prod_ctx; - const core_object_t* produced; - core_object_null_t null; - core_object_ether_t ether; - core_object_loop_t loop; - core_object_linuxsll_t linuxsll; - size_t n_ieee802; - core_object_ieee802_t ieee802[3]; // N_IEEE802 - core_object_ip_t ip; - core_object_ip6_t ip6; - core_object_gre_t gre; - core_object_icmp_t icmp; - core_object_icmp6_t icmp6; - core_object_udp_t udp; - core_object_tcp_t tcp; - core_object_payload_t payload; + const core_object_t* produced; + core_object_null_t null; + core_object_ether_t ether; + core_object_loop_t loop; + core_object_linuxsll_t linuxsll; + core_object_linuxsll2_t linuxsll2; + size_t n_ieee802; + core_object_ieee802_t ieee802[3]; // N_IEEE802 + core_object_ip_t ip; + core_object_ip6_t ip6; + core_object_gre_t gre; + core_object_icmp_t icmp; + core_object_icmp6_t icmp6; + core_object_udp_t udp; + core_object_tcp_t tcp; + core_object_payload_t payload; } filter_layer_t; core_log_t* filter_layer_log(); diff --git a/include/dnsjit/filter/layer.lua b/include/dnsjit/filter/layer.lua index c0e497e..5ed57ea 100644 --- a/include/dnsjit/filter/layer.lua +++ b/include/dnsjit/filter/layer.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 27a6c28..f0a413d 100644 --- a/include/dnsjit/filter/split.c +++ b/include/dnsjit/filter/split.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 24ab39d..d30f03d 100644 --- a/include/dnsjit/filter/split.h +++ b/include/dnsjit/filter/split.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 44c7af9..24183d2 100644 --- a/include/dnsjit/filter/split.hh +++ b/include/dnsjit/filter/split.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/filter/split.lua b/include/dnsjit/filter/split.lua index e16cbee..cd0f906 100644 --- a/include/dnsjit/filter/split.lua +++ b/include/dnsjit/filter/split.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 225d372..8f574a5 100644 --- a/include/dnsjit/filter/timing.c +++ b/include/dnsjit/filter/timing.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 328777e..1f3278c 100644 --- a/include/dnsjit/filter/timing.h +++ b/include/dnsjit/filter/timing.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 2e29d8a..18be050 100644 --- a/include/dnsjit/filter/timing.hh +++ b/include/dnsjit/filter/timing.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/filter/timing.lua b/include/dnsjit/filter/timing.lua index 72d8fed..af03b64 100644 --- a/include/dnsjit/filter/timing.lua +++ b/include/dnsjit/filter/timing.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 d19f4b1..def5c76 100644 --- a/include/dnsjit/gen-manpage.lua +++ b/include/dnsjit/gen-manpage.lua @@ -1,5 +1,5 @@ print[[ -.\" Copyright (c) 2018-2024 OARC, Inc. +.\" Copyright (c) 2018-2025 OARC, Inc. .\" All rights reserved. .\" .\" This file is part of dnsjit. diff --git a/include/dnsjit/globals.c b/include/dnsjit/globals.c index 90f724b..eadf117 100644 --- a/include/dnsjit/globals.c +++ b/include/dnsjit/globals.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/globals.h b/include/dnsjit/globals.h index 8b4346a..3ed57e6 100644 --- a/include/dnsjit/globals.h +++ b/include/dnsjit/globals.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input.lua b/include/dnsjit/input.lua index 268d667..69a95b8 100644 --- a/include/dnsjit/input.lua +++ b/include/dnsjit/input.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 04885c6..d043bc4 100644 --- a/include/dnsjit/input/fpcap.c +++ b/include/dnsjit/input/fpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4f2967e..3c9e1d0 100644 --- a/include/dnsjit/input/fpcap.h +++ b/include/dnsjit/input/fpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 dd8e19d..14bfab0 100644 --- a/include/dnsjit/input/fpcap.hh +++ b/include/dnsjit/input/fpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/fpcap.lua b/include/dnsjit/input/fpcap.lua index e0d9447..0991af4 100644 --- a/include/dnsjit/input/fpcap.lua +++ b/include/dnsjit/input/fpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 2caf5cf..f7bfb35 100644 --- a/include/dnsjit/input/mmpcap.c +++ b/include/dnsjit/input/mmpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 8844cb7..f6be1ba 100644 --- a/include/dnsjit/input/mmpcap.h +++ b/include/dnsjit/input/mmpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 387d5a6..1aaab87 100644 --- a/include/dnsjit/input/mmpcap.hh +++ b/include/dnsjit/input/mmpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/mmpcap.lua b/include/dnsjit/input/mmpcap.lua index 983d693..32fff82 100644 --- a/include/dnsjit/input/mmpcap.lua +++ b/include/dnsjit/input/mmpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 2304109..d2561ea 100644 --- a/include/dnsjit/input/pcap.c +++ b/include/dnsjit/input/pcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 5b091ba..dac2d52 100644 --- a/include/dnsjit/input/pcap.h +++ b/include/dnsjit/input/pcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 de694a7..a9d31f6 100644 --- a/include/dnsjit/input/pcap.hh +++ b/include/dnsjit/input/pcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/pcap.lua b/include/dnsjit/input/pcap.lua index 237a8db..12a4de7 100644 --- a/include/dnsjit/input/pcap.lua +++ b/include/dnsjit/input/pcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 6c50d91..939e33f 100644 --- a/include/dnsjit/input/zero.lua +++ b/include/dnsjit/input/zero.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 index 5c920e1..3f12367 100644 --- a/include/dnsjit/input/zmmpcap.c +++ b/include/dnsjit/input/zmmpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/zmmpcap.h b/include/dnsjit/input/zmmpcap.h index baea3f5..15af7f5 100644 --- a/include/dnsjit/input/zmmpcap.h +++ b/include/dnsjit/input/zmmpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/zmmpcap.hh b/include/dnsjit/input/zmmpcap.hh index 7e930cf..4b5795f 100644 --- a/include/dnsjit/input/zmmpcap.hh +++ b/include/dnsjit/input/zmmpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/zmmpcap.lua b/include/dnsjit/input/zmmpcap.lua index 7646869..0ab9f71 100644 --- a/include/dnsjit/input/zmmpcap.lua +++ b/include/dnsjit/input/zmmpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/input/zpcap.c b/include/dnsjit/input/zpcap.c index dfeb89b..b93d72c 100644 --- a/include/dnsjit/input/zpcap.c +++ b/include/dnsjit/input/zpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/zpcap.h b/include/dnsjit/input/zpcap.h index cab85bb..ab46eec 100644 --- a/include/dnsjit/input/zpcap.h +++ b/include/dnsjit/input/zpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 596fc2b..5dd020b 100644 --- a/include/dnsjit/input/zpcap.hh +++ b/include/dnsjit/input/zpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/input/zpcap.lua b/include/dnsjit/input/zpcap.lua index 5f2869c..42918d1 100644 --- a/include/dnsjit/input/zpcap.lua +++ b/include/dnsjit/input/zpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/lib.lua b/include/dnsjit/lib.lua index c3c7c84..2449cc7 100644 --- a/include/dnsjit/lib.lua +++ b/include/dnsjit/lib.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 9e1c2a3..c4f8cbe 100644 --- a/include/dnsjit/lib/clock.c +++ b/include/dnsjit/lib/clock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 45120d9..9b04507 100644 --- a/include/dnsjit/lib/clock.h +++ b/include/dnsjit/lib/clock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 77e1308..fdca687 100644 --- a/include/dnsjit/lib/clock.hh +++ b/include/dnsjit/lib/clock.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/lib/clock.lua b/include/dnsjit/lib/clock.lua index 74c1857..6b3d5d0 100644 --- a/include/dnsjit/lib/clock.lua +++ b/include/dnsjit/lib/clock.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 0622dda..9a16b27 100644 --- a/include/dnsjit/lib/getopt.lua +++ b/include/dnsjit/lib/getopt.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 839af9b..ee0392c 100644 --- a/include/dnsjit/lib/ip.lua +++ b/include/dnsjit/lib/ip.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 45e04ca..93f1707 100644 --- a/include/dnsjit/lib/parseconf.lua +++ b/include/dnsjit/lib/parseconf.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/output.lua b/include/dnsjit/output.lua index de21a96..28fc7a5 100644 --- a/include/dnsjit/output.lua +++ b/include/dnsjit/output.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 ad25b1c..338aee5 100644 --- a/include/dnsjit/output/dnscli.c +++ b/include/dnsjit/output/dnscli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/dnscli.h b/include/dnsjit/output/dnscli.h index 1cf352e..b7f6129 100644 --- a/include/dnsjit/output/dnscli.h +++ b/include/dnsjit/output/dnscli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 f86bccc..74c0e1c 100644 --- a/include/dnsjit/output/dnscli.hh +++ b/include/dnsjit/output/dnscli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/dnscli.lua b/include/dnsjit/output/dnscli.lua index 7b308c0..78b8a00 100644 --- a/include/dnsjit/output/dnscli.lua +++ b/include/dnsjit/output/dnscli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 4c5c1e0..45d86d3 100644 --- a/include/dnsjit/output/null.lua +++ b/include/dnsjit/output/null.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 3ac6a70..ce9b102 100644 --- a/include/dnsjit/output/pcap.c +++ b/include/dnsjit/output/pcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 b326e48..6156390 100644 --- a/include/dnsjit/output/pcap.h +++ b/include/dnsjit/output/pcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 43e0fb7..55e709b 100644 --- a/include/dnsjit/output/pcap.hh +++ b/include/dnsjit/output/pcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/pcap.lua b/include/dnsjit/output/pcap.lua index 3c62bb2..1b80552 100644 --- a/include/dnsjit/output/pcap.lua +++ b/include/dnsjit/output/pcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 b245e67..a0974e3 100644 --- a/include/dnsjit/output/respdiff.c +++ b/include/dnsjit/output/respdiff.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 2d9fee5..10e3c7c 100644 --- a/include/dnsjit/output/respdiff.h +++ b/include/dnsjit/output/respdiff.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 6edda6e..bc99299 100644 --- a/include/dnsjit/output/respdiff.hh +++ b/include/dnsjit/output/respdiff.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/respdiff.lua b/include/dnsjit/output/respdiff.lua index 78831ff..ecd2b93 100644 --- a/include/dnsjit/output/respdiff.lua +++ b/include/dnsjit/output/respdiff.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 9d76a03..d081ad6 100644 --- a/include/dnsjit/output/tcpcli.c +++ b/include/dnsjit/output/tcpcli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/tcpcli.h b/include/dnsjit/output/tcpcli.h index a44018b..da9736a 100644 --- a/include/dnsjit/output/tcpcli.h +++ b/include/dnsjit/output/tcpcli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 e538100..7d638fd 100644 --- a/include/dnsjit/output/tcpcli.hh +++ b/include/dnsjit/output/tcpcli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/tcpcli.lua b/include/dnsjit/output/tcpcli.lua index 98bcfb5..5f21591 100644 --- a/include/dnsjit/output/tcpcli.lua +++ b/include/dnsjit/output/tcpcli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 d9a85e7..c8908d0 100644 --- a/include/dnsjit/output/tlscli.c +++ b/include/dnsjit/output/tlscli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 83d2449..c0f73f7 100644 --- a/include/dnsjit/output/tlscli.h +++ b/include/dnsjit/output/tlscli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 355e9ae..f676172 100644 --- a/include/dnsjit/output/tlscli.hh +++ b/include/dnsjit/output/tlscli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/tlscli.lua b/include/dnsjit/output/tlscli.lua index ee7fbfe..b26be41 100644 --- a/include/dnsjit/output/tlscli.lua +++ b/include/dnsjit/output/tlscli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 85894cc..1fd3a5a 100644 --- a/include/dnsjit/output/udpcli.c +++ b/include/dnsjit/output/udpcli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/udpcli.h b/include/dnsjit/output/udpcli.h index 0aec60f..be98491 100644 --- a/include/dnsjit/output/udpcli.h +++ b/include/dnsjit/output/udpcli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 c7cbf83..d4227e2 100644 --- a/include/dnsjit/output/udpcli.hh +++ b/include/dnsjit/output/udpcli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/include/dnsjit/output/udpcli.lua b/include/dnsjit/output/udpcli.lua index 575f19d..603d437 100644 --- a/include/dnsjit/output/udpcli.lua +++ b/include/dnsjit/output/udpcli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/test/46vs45.pcap b/include/dnsjit/test/46vs45.pcap new file mode 100644 index 0000000000000000000000000000000000000000..d7ac0976a3be2e4a1a7e55040d35e0deeee7d2ae GIT binary patch literal 86 zcmca|c+)~A1{MYcU}Q)Ia_pJ*r(g8uV$cJ!LD-dnLH9$m1B0y~LgmqS45kc{8bx3c LMwmDo1LI!+VE+tL literal 0 HcmV?d00001 diff --git a/include/dnsjit/test/Makefile.am b/include/dnsjit/test/Makefile.am index a3f343f..8446253 100644 --- a/include/dnsjit/test/Makefile.am +++ b/include/dnsjit/test/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -21,7 +21,7 @@ CLEANFILES = test*.log test*.trs test*.out \ *.pcap-dist *.lz4-dist *.zst-dist TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \ - test-trie.sh test-base64url.sh + test-trie.sh test-base64url.sh test-padding.sh test-sll2.sh test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist \ dns.pcap.xz-dist dns.pcap.gz-dist @@ -38,6 +38,11 @@ test-ipsplit.sh: pellets.pcap-dist dns.pcap-dist test-trie.sh: pellets.pcap-dist dns.pcap-dist +test-padding.sh: 46vs45.pcap-dist tcp-response-with-trailing-junk.pcap-dist \ + ip6-udp-padd.pcap-dist ip6-tcp-padd.pcap-dist + +test-sll2.sh: sll2.pcap-dist + .pcap.pcap-dist: cp "$<" "$@" @@ -56,4 +61,7 @@ test-trie.sh: pellets.pcap-dist dns.pcap-dist 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.xz dns.pcap.gz + dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz \ + 46vs45.pcap tcp-response-with-trailing-junk.pcap test_padding.gold \ + test_padding.lua ip6-udp-padd.pcap ip6-tcp-padd.pcap \ + test-sll2.gold sll2.pcap diff --git a/include/dnsjit/test/Makefile.in b/include/dnsjit/test/Makefile.in index 713d49a..fcada6e 100644 --- a/include/dnsjit/test/Makefile.in +++ b/include/dnsjit/test/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -383,6 +383,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -502,12 +503,15 @@ CLEANFILES = test*.log test*.trs test*.out \ *.pcap-dist *.lz4-dist *.zst-dist TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \ - test-trie.sh test-base64url.sh + test-trie.sh test-base64url.sh test-padding.sh test-sll2.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.xz dns.pcap.gz + dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz \ + 46vs45.pcap tcp-response-with-trailing-junk.pcap test_padding.gold \ + test_padding.lua ip6-udp-padd.pcap ip6-tcp-padd.pcap \ + test-sll2.gold sll2.pcap all: all-am @@ -753,6 +757,20 @@ test-base64url.sh.log: test-base64url.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-padding.sh.log: test-padding.sh + @p='test-padding.sh'; \ + b='test-padding.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sll2.sh.log: test-sll2.sh + @p='test-sll2.sh'; \ + b='test-sll2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ @@ -943,6 +961,11 @@ test-ipsplit.sh: pellets.pcap-dist dns.pcap-dist test-trie.sh: pellets.pcap-dist dns.pcap-dist +test-padding.sh: 46vs45.pcap-dist tcp-response-with-trailing-junk.pcap-dist \ + ip6-udp-padd.pcap-dist ip6-tcp-padd.pcap-dist + +test-sll2.sh: sll2.pcap-dist + .pcap.pcap-dist: cp "$<" "$@" diff --git a/include/dnsjit/test/ip6-tcp-padd.pcap b/include/dnsjit/test/ip6-tcp-padd.pcap new file mode 100644 index 0000000000000000000000000000000000000000..fde5926355a53ae4d37fd7b03309c9fc55cc69fb GIT binary patch literal 1738 zcma)-dr(YK9LIm>?x|h1yS9gCNysP)A$d#?-nJjnqD z*Fd15Vui9*>%S7gBD!WX1wMX*P|q23DI7>B=o($>gs2I#H}7Qk%edc%VLSkb@omh> zytK_XjO;#=NTe)&xG=slb7pViL)4|t#rq3N=o!1pe64Nn@!1*9_$z6A9X*dtTmEsq z&VLs@qtq}E{e&enUu4hSmVan_J_-iAZ+hj}G7Pr?7y#tp1+wn=gP&h*>;Ho}^iD)@ z5rb`}P>0y`{|p=sOQ}N(&A^He@EPo28DLF&zOjrRtE9F992u}Qq#s(rAEnE6+1WV} zdW~+YMyHo-(&W%>PK;3+2@=XwvCI_9^8a4|x6M)%v;J z{=Q?98uj6+))Lj<%=fi>El*>tr#|mleqeH+=Z2~3!15uMJZ`|_Al3GvrmXTg`cYS2 z95*)RW#@+LhANN9E81eZYu=QF$es+EZ?1?wVI)P-)3ZHmn}e1mR`+Whq^gwV9#RY+ zUf1)fr~X-5WJkkD^P}n|Gp~C8j!#{_&)U_I_*JdD8HwI6?V5OhuusOMq9f5W^p*w6 zWp^90in~foo&`x&ZLte|lhqkT?eQni6l^^I))YBHJue|(^%T#5()0(H^Eb6Dy!IjI z=(#u33?Y8W6U%Q^^pLJKow4LJ1UlZhDj0c4s$=O(W`l$AB+kV`5xNd4JEB)_GTp`K zb8NqJ$Vsjni*O=PkU}?hmS;*5=*GtJtS{+sW4=zNP>{=R%>GTW4GAPe$fQ>1Q#Q6+ z$UG$SQ4Y$yuM#rpAHj2o)Cw8(euAg7$bBJG)bRu$iq;xAYK`l|0Mq*N+Wg(j(VFs_ z48yFByl#*tvD)#P+CGXS)`i#gYi~x;TJV~L9QGl*1$vqx zhdykrD( zDPYsqL4*I_zZ`!6%i{gT*xc9)KsMuq+YF`* Sk_eN literal 0 HcmV?d00001 diff --git a/include/dnsjit/test/sll2.pcap b/include/dnsjit/test/sll2.pcap new file mode 100644 index 0000000000000000000000000000000000000000..1766ac8fde821555cee14d512bd576de3aa1bf30 GIT binary patch literal 927 zcmca|c+)~A1{MYwxWmf8Ai~JN;PUEJx>7VVLo`qVggGDzxEL5&*kEd185rCri7+rY z2=es3V_;weVy1~R8B7_ByWR&{GAb|t%>e>NCLKK>3F2w8Twq{mU|`^3;9}sgI62Ar zkr$UJ$SU8-%nUrtKnWm5SjB*371NLV`VK&=Y7T;|0a?djI&mh`lMm{FmW|C|t5}e& zVgn1YGB_|M@)YIgm*^I!7L}zI6*K3hmN2m96_@0s@BsOl#hK}Oy6Hgi`l)<}^fZRpDaN|&kKZY2?4Q(q zZuaYSdjx!Iz3vFD3KBBtyEYviu(z_~s9dY2fs{BgZiCDc|1+i&kLoe5+9~rdB461m z(xY;tL)L#=xwN}N5=I^phL;^?&r3S#)Alkd_)Wp@mNPG$Wki3!x>WGaY(JCx*>jFD zwM(~kW$bqgKXZCozeBD}$*MKge~RxUhJ~*6U;N{d{;s?K-{gPLZ(`r-HfI)#BXa2I zV}y?Q|Ez_^+ah+CPkrj8#55z4@9$b>H!0;48P86f{WbI6&ezL$l%;;%lT!7lN)Jw& z#vYshU7kPv=dG%_IsY1SUp;OV{>qCS{B;u^4u&X>8a@j|6hk* z{&b#UGqdJ=eOQ6V{4|{dVy_>qo-S4R?v>ku)j79j2=iBM6AN*dUC>GO%2 zY7WA87+*^QrZ9j literal 0 HcmV?d00001 diff --git a/include/dnsjit/test/tcp-response-with-trailing-junk.pcap b/include/dnsjit/test/tcp-response-with-trailing-junk.pcap new file mode 100644 index 0000000000000000000000000000000000000000..298c9530e928bd8e067e4917b90b7d881cc40947 GIT binary patch literal 9641 zcmeI$c~DbF90%}yNeD-Y7^n&~SgIq4NV&v=!WaP+!2^&(u@$kz2<4EFp`uX2QERI> zhysH}j%u+gqE^VDLZRRR76YS*wSfwXv4f~RgaAtH?u*Yn5gvcbyq#Gf3G@B!+sx;e z&1hXgAX!KHwqo9IKUtNjV5{MfTaK|b5sDp=X&}k1AxI9bCD06fP?Cs zvkWuGBjEFxJ^X?#g4N%PiT16~7pK%`(ILlIw;5Fc4U)NxxQoa(v$3pc*F)?DBIDsf$Ac|u~3&cPxI!+uJrVk&7 z$At@{ZG`ao&tsy%_H$_s0BGv~z)T0a&JsKUe5{Vbi~t+H0z-v=tnm>xn$-%o07-JZ z%Fp7*filzlwhO|$=MxgU0yB5#t-CL(FX$;W`fX~?UUyM|g>HAR{EnYkIX76E_2t!k zX_xh?B=?@U7YV0iI?HpbzA-3U5i+l-C@*9GE+r$vD)sBRGd5K$T)$%av+bB?>e^?8 z;cK1_J#?0O)!R|(ygv5@6Ha&)DDn2tdeB*96u?@8<JwC;&P$&>P2;z_(emZ?mBA@ZES6jmQ=cypUJ=dU`x~8QnT=izTikpxreo(zk&DumX_K6 z)7x)ET7Ku6_Gv#)HYs9n#**wOhEwx93Mwo6H3)bRfiZyqVG}l<&a9u}?3FhED<_1a z;}EV3uy_1LT7Dbh&r9LIyl{FM^k`#8K<4ZI$E1W%Dhf=AS#;nDCW z2E4x@im{KHCA|p6EiVF|Vo(jw#gGJV-gxkYb(HX?;PAF-;3)~CVAj% zo@admU-O9(Yp#Xqrjp6nkSYhR5mT=hC8M?Of{D>E3Qh9B6E|6(#1oT7O*Dpyb#Equ zIlP&e`Rk*&6MU8OD87gCdb$Qt_2A$UJ7o%Ysuy05intzPm(cYL!9;WTtr|`8K-a_M zb`7D#pu|xVjWHD_R$mX1$dL19lA0iKJ#-VKo8Y_O1oe;?y-SoGr4;x7(+K~)fi|v6 zD6o$Zhb)rGa zRd+o{s}5fGX5VmC!cO#9!X3R6aV}HtY#F`}CB&*5_7fhRkF;PsQw>_iP39u03|z+2xy1+Od;p}2mHfLEKOhSvp1pLmPLgVzje zP{1?6;YDiT)g~c$U4Zn7N7SI<(eNe)yfcj)5C8x^;jh;NzgM=LSB_AGq!RE_q!6B? zs@$&=GbiqdG3@Qeleh932e9GID>TUi6=4kInd0&yH1blUjBad;U#CW%rU*@sruXjC F`yVl04-o(W literal 0 HcmV?d00001 diff --git a/examples/Makefile.am b/include/dnsjit/test/test-padding.sh old mode 100644 new mode 100755 similarity index 60% copy from examples/Makefile.am copy to include/dnsjit/test/test-padding.sh index a184589..519c4a9 --- a/examples/Makefile.am +++ b/include/dnsjit/test/test-padding.sh @@ -1,4 +1,5 @@ -# Copyright (c) 2018-2024 OARC, Inc. +#!/bin/sh -ex +# Copyright (c) 2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -16,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with dnsjit. If not, see . -dist_doc_DATA = capture.lua dumpdns2pcap.lua dumpdns.lua dumpdns-qr.lua \ - filter_rcode.lua qr-multi-pcap-state.lua readme.lua replay.lua \ - replay_multicli.lua respdiff.lua pcap2tcpdns.lua +../dnsjit "$srcdir/test_padding.lua" -r 46vs45.pcap-dist >test_padding.out +../dnsjit "$srcdir/test_padding.lua" -r tcp-response-with-trailing-junk.pcap-dist >>test_padding.out +../dnsjit "$srcdir/test_padding.lua" -r ip6-udp-padd.pcap-dist >>test_padding.out +../dnsjit "$srcdir/test_padding.lua" -r ip6-tcp-padd.pcap-dist >>test_padding.out +diff "$srcdir/test_padding.gold" test_padding.out diff --git a/include/dnsjit/test/test-sll2.gold b/include/dnsjit/test/test-sll2.gold new file mode 100644 index 0000000..6fbbc28 --- /dev/null +++ b/include/dnsjit/test/test-sll2.gold @@ -0,0 +1,33 @@ +udp 238.0.0.1:37273 -> 238.0.0.2:53 +id: 20793 + qr: 0 + opcode: QUERY + flags: RD AD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 1 +questions: class type labels + IN A <12>,.. +additionals: class type ttl labels RR labels + UNKNOWN(1232) OPT 32768 +udp 238.0.0.2:53 -> 238.0.0.1:37273 +id: 20793 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NXDOMAIN + qdcount: 1 + ancount: 0 + nscount: 4 + arcount: 1 +questions: class type labels + IN A <12>,.. +authorities: class type ttl labels RR labels + IN SOA 5 <31>a.<33>root-servers.<46>net. + IN RRSIG 5 + IN RRSIG 5 + IN NSEC 5 <678>aaa. +additionals: class type ttl labels RR labels + UNKNOWN(1220) OPT 32768 diff --git a/src/test/test4.sh b/include/dnsjit/test/test-sll2.sh similarity index 79% copy from src/test/test4.sh copy to include/dnsjit/test/test-sll2.sh index b72c781..fdf80cb 100755 --- a/src/test/test4.sh +++ b/include/dnsjit/test/test-sll2.sh @@ -1,5 +1,5 @@ -#!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +#!/bin/sh -ex +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -17,5 +17,5 @@ # You should have received a copy of the GNU General Public License # along with dnsjit. If not, see . -../dnsjit "$srcdir/../../examples/readme.lua" dns.pcap-dist >test4.out -diff "$srcdir/test4.gold" test4.out +../dnsjit "$srcdir/../../examples/dumpdns.lua" sll2.pcap-dist >test-sll2.out +diff "$srcdir/test-sll2.gold" test-sll2.out diff --git a/include/dnsjit/test/test1.sh b/include/dnsjit/test/test1.sh index 400b92c..6e756e6 100755 --- a/include/dnsjit/test/test1.sh +++ b/include/dnsjit/test/test1.sh @@ -1,5 +1,5 @@ #!/bin/sh -ex -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/include/dnsjit/test/test2.sh b/include/dnsjit/test/test2.sh index 40c0928..0eda4cd 100755 --- a/include/dnsjit/test/test2.sh +++ b/include/dnsjit/test/test2.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 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 e8e6a71..a9139e7 100755 --- a/include/dnsjit/test/test3.sh +++ b/include/dnsjit/test/test3.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 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 b72c781..015f8f4 100755 --- a/include/dnsjit/test/test4.sh +++ b/include/dnsjit/test/test4.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 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 23c3575..76f6562 100755 --- a/include/dnsjit/test/test6.sh +++ b/include/dnsjit/test/test6.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/include/dnsjit/test/test_ipsplit.lua b/include/dnsjit/test/test_ipsplit.lua index 43dc8a0..16b58a2 100755 --- a/include/dnsjit/test/test_ipsplit.lua +++ b/include/dnsjit/test/test_ipsplit.lua @@ -81,17 +81,29 @@ while true do if i == 1 then assert(dns_msgid(obj) == 0x0a31, "pkt 1: client 1, pkt 1 -> out1") assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0003") - assert(ip_pkt(obj):destination() == "0100:0000:0000:0000:0000:0000:0000:0001") + if ffi.abi("be") then + assert(ip_pkt(obj):destination() == "0000:0001:0000:0000:0000:0000:0000:0001") + else + assert(ip_pkt(obj):destination() == "0100:0000:0000:0000:0000:0000:0000:0001") + end end if i == 2 then assert(dns_msgid(obj) == 0xb3e8, "pkt 3: client 3, pkt 1 -> out1") assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0005") - assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + if ffi.abi("be") then + assert(ip_pkt(obj):destination() == "0000:0002:0000:0000:0000:0000:0000:0001") + else + assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + end end if i == 3 then assert(dns_msgid(obj) == 0xb3e9, "pkt 4: client 3, pkt 2 -> out1") assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0005") - assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + if ffi.abi("be") then + assert(ip_pkt(obj):destination() == "0000:0002:0000:0000:0000:0000:0000:0001") + else + assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + end end if i == 13 then assert(dns_msgid(obj) == 0x4a05, "pkt 16: client 7, pkt 1 -> out1") end if i == 14 then assert(dns_msgid(obj) == 0x4a06, "pkt 17: client 7, pkt 2 -> out1") end @@ -288,7 +300,11 @@ while true do i = i + 1 if i == 1 then assert(dns_msgid(obj) == 0xe7af) - assert(ip_pkt(obj):source() == "1.0.0.0") + if ffi.abi("be") then + assert(ip_pkt(obj):source() == "0.0.0.1") + else + assert(ip_pkt(obj):source() == "1.0.0.0") + end assert(ip_pkt(obj):destination() == "8.8.8.8") end end diff --git a/include/dnsjit/test/test_padding.gold b/include/dnsjit/test/test_padding.gold new file mode 100644 index 0000000..077aeb0 --- /dev/null +++ b/include/dnsjit/test/test_padding.gold @@ -0,0 +1,288 @@ + +type length +pcap 46 (len) +pcap 46 (caplen) +ip 45 (len) +udp 25 +payload 17 (len) +payload 1 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 74 (len) +pcap 74 (caplen) +ip 60 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 74 (len) +pcap 74 (caplen) +ip 60 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 110 (len) +pcap 110 (caplen) +ip 96 (len) +tcp +payload 44 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 800 (len) +pcap 800 (caplen) +ip 785 (len) +tcp +payload 733 (len) +payload 1 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 85 (len) +pcap 85 (caplen) +ip 71 (len) +udp 51 +payload 43 (len) +payload 0 (padding) + +type length +pcap 774 (len) +pcap 774 (caplen) +ip 760 (len) +udp 740 +payload 732 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip6 25 (plen) +udp 25 +payload 17 (len) +payload 1 (padding) + +type length +pcap 80 (len) +pcap 80 (caplen) +ip6 40 (plen) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 80 (len) +pcap 80 (caplen) +ip6 40 (plen) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 114 (len) +pcap 114 (caplen) +ip6 74 (plen) +tcp +payload 42 (len) +payload 0 (padding) + +type length +pcap 1200 (len) +pcap 1200 (caplen) +ip6 1159 (plen) +tcp +payload 1127 (len) +payload 1 (padding) + +type length +pcap 72 (len) +pcap 72 (caplen) +ip6 32 (plen) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 72 (len) +pcap 72 (caplen) +ip6 32 (plen) +tcp +payload 0 (len) +payload 0 (padding) diff --git a/include/dnsjit/test/test_padding.lua b/include/dnsjit/test/test_padding.lua new file mode 100644 index 0000000..1d06dca --- /dev/null +++ b/include/dnsjit/test/test_padding.lua @@ -0,0 +1,70 @@ +#!/usr/bin/env dnsjit +local bit = require("bit") +local ffi = require("ffi") +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local object = require("dnsjit.core.objects") +local log = require("dnsjit.core.log").new("pcap2tcpdns") +local getopt = require("dnsjit.lib.getopt").new({ + { "r", "read", "-", "input file to read, use - for stdin", "?" }, +}) + +log:enable("all") + +-- Parse arguments +local args = {} +getopt:parse() +args.read = getopt:val("r") + +-- Set up input +if args.read ~= "" then + log:notice("using input PCAP "..args.read) + if input:open_offline(args.read) ~= 0 then + log:fatal("failed to open input PCAP "..args.read) + end +else + getopt:usage() + log:fatal("input must be specified, use -r") +end +layer:producer(input) +local produce, pctx = layer:produce() + +-- set up output +io.stdout:setvbuf("no") +io.stderr:setvbuf("no") + +local obj, obj_pcap_in, obj_ip, obj_udp, obj_pl +local npacketsin = 0 +while true do + obj = produce(pctx) + if obj == nil then break end + npacketsin = npacketsin + 1 + print("\ntype", "length") + + obj_pcap_in = obj:cast_to(object.PCAP) + print(obj_pcap_in:type(), tonumber(obj_pcap_in.len), "(len)") + print(obj_pcap_in:type(), tonumber(obj_pcap_in.caplen), "(caplen)") + + obj_ip = obj:cast_to(object.IP) + if obj_ip then + print(obj_ip:type(), tonumber(obj_ip.len), "(len)") + else + obj_ip = obj:cast_to(object.IP6) + print(obj_ip:type(), tonumber(obj_ip.plen), "(plen)") + end + + obj_udp = obj:cast_to(object.UDP) + if obj_udp then + print(obj_udp:type(), tonumber(obj_udp.ulen)) + else + obj_tcp = obj:cast_to(object.TCP) + if obj_tcp then + print(obj_tcp:type()) + end + end + + obj_pl = obj:cast_to(object.PAYLOAD) + print(obj_pl:type(), tonumber(obj_pl.len), "(len)") + print(obj_pl:type(), tonumber(obj_pl.padding), "(padding)") +end +log:info(string.format("processed %d packets", npacketsin)) diff --git a/include/dnsjit/version.h b/include/dnsjit/version.h index 94fffa0..5194558 100644 --- a/include/dnsjit/version.h +++ b/include/dnsjit/version.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4 +#define DNSJIT_MINOR_VERSION 5 #define DNSJIT_PATCH_VERSION 0 #endif diff --git a/ltmain.sh b/ltmain.sh index 540a92a..977e523 100755 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-15build2" -package_revision=2.4.6 +VERSION="2.4.7 Debian-2.4.7-7build1" +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# This program 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. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES 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 this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -529,27 +572,15 @@ func_require_term_colors () # --------------------- # Append VALUE onto the existing contents of VAR. - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes + if test -z "$_G_HAVE_PLUSEQ_OP" && \ + __PLUSEQ_TEST="a" && \ + __PLUSEQ_TEST+=" b" 2>/dev/null && \ + test "a b" = "$__PLUSEQ_TEST"; then + _G_HAVE_PLUSEQ_OP=yes + fi if test yes = "$_G_HAVE_PLUSEQ_OP" then @@ -580,16 +611,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1122,203 @@ func_relative_path () } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () { - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: ;; esac - func_quote_for_expand_result=$_G_arg + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1364,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1390,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1518,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2015-10-07.11; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# This program 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. +# Please report bugs or propose patches to: +# -# This program 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 this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1560,7 @@ scriptversion=2015-10-07.11; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1572,7 @@ scriptversion=2015-10-07.11; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1621,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1655,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1665,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1534,22 +1698,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - if eval $_G_hook '"$@"'; then - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - _G_rc_run_hooks=: + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift fi done - - $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } @@ -1559,14 +1720,16 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, you may remove/edit -# any options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. In this case you also must return $EXIT_SUCCESS to let the -# hook's caller know that it should pay attention to -# '_result'. Returning $EXIT_FAILURE signalizes that -# arguments are left untouched by the hook and therefore caller will ignore the -# result variable. +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). # # Like this: # @@ -1578,11 +1741,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# # No change in '$@' (ignored completely by this hook). There is -# # no need to do the equivalent (but slower) action: -# # func_quote_for_eval ${1+"$@"} -# # my_options_prep_result=$func_quote_for_eval_result -# false +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1593,7 +1753,7 @@ func_run_hooks () # # args_changed=false # -# # Note that for efficiency, we parse as many options as we can +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do @@ -1610,18 +1770,17 @@ func_run_hooks () # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" -# # is added back to "$@", we could need that later -# # if $args_changed is true. +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # +# # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result # fi -# -# $args_changed # } # func_add_hook func_parse_options my_silent_option # @@ -1632,8 +1791,6 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# false # } # func_add_hook func_validate_options my_option_validation # @@ -1649,13 +1806,8 @@ func_options_finish () { $debug_cmd - _G_func_options_finish_exit=false - if func_run_hooks func_options ${1+"$@"}; then - func_options_finish_result=$func_run_hooks_result - _G_func_options_finish_exit=: - fi - - $_G_func_options_finish_exit + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish } @@ -1668,28 +1820,27 @@ func_options () { $debug_cmd - _G_rc_options=false + _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do - if eval func_$my_func '${1+"$@"}'; then - eval _G_res_var='$'"func_${my_func}_result" - eval set dummy "$_G_res_var" ; shift - _G_rc_options=: + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: fi done - # Save modified positional parameters for caller. As a top-level - # options-parser function we always need to set the 'func_options_result' - # variable (regardless the $_G_rc_options value). - if $_G_rc_options; then - func_options_result=$_G_res_var - else - func_quote_for_eval ${1+"$@"} - func_options_result=$func_quote_for_eval_result - fi - - $_G_rc_options + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1699,8 +1850,7 @@ func_options () # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1710,14 +1860,8 @@ func_options_prep () opt_verbose=false opt_warning_types= - _G_rc_options_prep=false - if func_run_hooks func_options_prep ${1+"$@"}; then - _G_rc_options_prep=: - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result - fi - - $_G_rc_options_prep + func_run_hooks func_options_prep ${1+"$@"} + func_propagate_result func_run_hooks func_options_prep } @@ -1729,27 +1873,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - - _G_rc_parse_options=false + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. - if func_run_hooks func_parse_options ${1+"$@"}; then - eval set dummy "$func_run_hooks_result"; shift - _G_rc_parse_options=: + func_run_hooks func_parse_options ${1+"$@"} + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1760,7 +1909,7 @@ func_parse_options () --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then - _G_rc_parse_options=: + _G_parse_options_requote=: break fi case " $warning_categories $1" in @@ -1815,7 +1964,7 @@ func_parse_options () shift ;; - --) _G_rc_parse_options=: ; break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false @@ -1823,17 +1972,16 @@ func_parse_options () ;; esac - $_G_match_parse_options && _G_rc_parse_options=: + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - - if $_G_rc_parse_options; then + if $_G_parse_options_requote; then # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result fi - - $_G_rc_parse_options } @@ -1846,21 +1994,14 @@ func_validate_options () { $debug_cmd - _G_rc_validate_options=false - # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - if func_run_hooks func_validate_options ${1+"$@"}; then - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result - _G_rc_validate_options=: - fi + func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - $_G_rc_validate_options } @@ -1916,8 +2057,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1932,8 +2073,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1943,7 +2085,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1969,7 +2111,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -2011,31 +2153,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -2045,12 +2200,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2141,7 +2296,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-15build2 + version: $progname $scriptversion Debian-2.4.7-7build1 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2197,7 +2352,7 @@ fi # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2345,6 +2500,8 @@ libtool_options_prep () _G_rc_lt_options_prep=: + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2375,11 +2532,9 @@ libtool_options_prep () if $_G_rc_lt_options_prep; then # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result fi - - $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep @@ -2482,11 +2637,9 @@ libtool_parse_options () if $_G_rc_lt_parse_options; then # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result fi - - $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options @@ -2543,8 +2696,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3510,8 +3663,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3584,8 +3737,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3740,7 +3893,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3846,6 +4000,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4188,8 +4344,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4199,8 +4355,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4257,12 +4413,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4273,8 +4429,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4570,8 +4726,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5350,7 +5506,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5360,7 +5517,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6703,9 +6860,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6941,6 +7098,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7111,7 +7275,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7131,7 +7295,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7161,8 +7325,20 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7303,9 +7479,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7319,16 +7495,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7346,8 +7527,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7370,12 +7551,13 @@ func_mode_link () # -fuse-ld=* Linker select flags for GCC # -static-* direct GCC to link specific libraries statically # -fcilkplus Cilk Plus language extension features for C/C++ + # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7396,15 +7578,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7524,8 +7706,8 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8733,7 +8915,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8906,7 +9088,7 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -9000,7 +9182,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9226,7 +9408,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -10037,8 +10219,8 @@ EOF for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10131,8 +10313,8 @@ EOF eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10606,12 +10788,13 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10851,13 +11034,15 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/m4/dl.sh b/m4/dl.sh index 5577b79..cbb4e50 100755 --- a/m4/dl.sh +++ b/m4/dl.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/m4/libtool.m4 b/m4/libtool.m4 index c4c0294..e7b6833 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see . ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -777,7 +779,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1041,8 +1043,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1066,17 +1068,12 @@ _LT_EOF _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*|11.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1125,12 +1122,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1244,7 +1241,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1261,7 +1259,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1291,7 +1289,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1308,7 +1306,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1320,7 +1318,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1342,7 +1340,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1350,7 +1348,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1358,7 +1356,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1378,14 +1376,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1453,7 +1451,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1492,9 +1490,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cr} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1713,7 +1724,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1756,7 +1767,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2206,26 +2217,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2548,7 +2568,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2558,14 +2578,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2584,7 +2604,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2621,7 +2641,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2654,7 +2674,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3465,7 +3485,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3499,14 +3519,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3520,7 +3540,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3567,7 +3587,7 @@ netbsd* | netbsdelf*-gnu) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3694,13 +3714,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3726,7 +3746,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3966,7 +3986,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3984,20 +4004,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4021,7 +4041,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4039,9 +4059,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4329,7 +4349,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4412,7 +4432,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4754,7 +4774,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4937,7 +4957,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4945,7 +4965,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -5005,15 +5025,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5068,7 +5088,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5180,6 +5200,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5194,7 +5215,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5237,7 +5258,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5249,13 +5270,14 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) @@ -5265,7 +5287,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5397,7 +5419,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5580,12 +5602,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5626,7 +5648,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5674,7 +5696,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5815,6 +5837,7 @@ _LT_EOF # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; @@ -5886,6 +5909,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6656,8 +6680,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6755,6 +6779,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6785,7 +6810,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6922,7 +6947,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7062,13 +7087,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8214,6 +8239,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 94b0829..b0b5e9c 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 index 48bc934..902508b 100644 --- a/m4/ltsugar.m4 +++ b/m4/ltsugar.m4 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index fa04b52..b155d0a 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index c6b26f8..0f7a875 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives diff --git a/src/Makefile.am b/src/Makefile.am index 90fd511..e97a68c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -48,16 +48,16 @@ dnsjit_LDADD = $(PTHREAD_LIBS) $(luajit_LIBS) $(liblz4_LIBS) $(libzstd_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/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 +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/linuxsll2.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/linuxsll2.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/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 +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/linuxsll2.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/linuxsll2.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/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 +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/linuxsll2.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/linuxsll2.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) @@ -67,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.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 +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.linuxsll2.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: @@ -175,6 +175,9 @@ dnsjit.core.object.ip6.3in: core/object/ip6.lua gen-manpage.lua dnsjit.core.object.ip.3in: core/object/ip.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/ip.lua" > "$@" +dnsjit.core.object.linuxsll2.3in: core/object/linuxsll2.lua gen-manpage.lua + $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll2.lua" > "$@" + dnsjit.core.object.linuxsll.3in: core/object/linuxsll.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll.lua" > "$@" diff --git a/src/Makefile.in b/src/Makefile.in index 16dd15f..16dcb23 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -141,20 +141,21 @@ am_dnsjit_OBJECTS = dnsjit.$(OBJEXT) globals.$(OBJEXT) \ core/object/gre.$(OBJEXT) core/object/icmp6.$(OBJEXT) \ core/object/icmp.$(OBJEXT) core/object/ieee802.$(OBJEXT) \ core/object/ip6.$(OBJEXT) core/object/ip.$(OBJEXT) \ - core/object/linuxsll.$(OBJEXT) core/object/loop.$(OBJEXT) \ - core/object/null.$(OBJEXT) core/object/payload.$(OBJEXT) \ - core/object/pcap.$(OBJEXT) core/object/tcp.$(OBJEXT) \ - core/object/udp.$(OBJEXT) core/producer.$(OBJEXT) \ - core/receiver.$(OBJEXT) core/thread.$(OBJEXT) \ - filter/copy.$(OBJEXT) filter/ipsplit.$(OBJEXT) \ - filter/layer.$(OBJEXT) filter/split.$(OBJEXT) \ - filter/timing.$(OBJEXT) input/fpcap.$(OBJEXT) \ - input/mmpcap.$(OBJEXT) input/pcap.$(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) + core/object/linuxsll2.$(OBJEXT) core/object/linuxsll.$(OBJEXT) \ + core/object/loop.$(OBJEXT) core/object/null.$(OBJEXT) \ + core/object/payload.$(OBJEXT) core/object/pcap.$(OBJEXT) \ + core/object/tcp.$(OBJEXT) core/object/udp.$(OBJEXT) \ + core/producer.$(OBJEXT) core/receiver.$(OBJEXT) \ + core/thread.$(OBJEXT) filter/copy.$(OBJEXT) \ + filter/ipsplit.$(OBJEXT) filter/layer.$(OBJEXT) \ + filter/split.$(OBJEXT) filter/timing.$(OBJEXT) \ + input/fpcap.$(OBJEXT) input/mmpcap.$(OBJEXT) \ + input/pcap.$(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 = @@ -194,6 +195,7 @@ am__depfiles_remade = ./$(DEPDIR)/dnsjit.Po ./$(DEPDIR)/globals.Po \ core/object/$(DEPDIR)/icmp6.Po \ core/object/$(DEPDIR)/ieee802.Po core/object/$(DEPDIR)/ip.Po \ core/object/$(DEPDIR)/ip6.Po core/object/$(DEPDIR)/linuxsll.Po \ + core/object/$(DEPDIR)/linuxsll2.Po \ core/object/$(DEPDIR)/loop.Po core/object/$(DEPDIR)/null.Po \ core/object/$(DEPDIR)/payload.Po core/object/$(DEPDIR)/pcap.Po \ core/object/$(DEPDIR)/tcp.Po core/object/$(DEPDIR)/udp.Po \ @@ -358,6 +360,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -495,15 +498,16 @@ dnsjit_SOURCES = dnsjit.c globals.c 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 + core/object/ip.c core/object/linuxsll2.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 # Lua sources dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.lua \ @@ -513,19 +517,20 @@ dist_dnsjit_SOURCES = core.lua lib.lua input.lua filter.lua output.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 + core/object/linuxsll2.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 dnsjitincludedir = $(includedir)/dnsjit # Lua headers @@ -534,45 +539,46 @@ nobase_dnsjitinclude_HEADERS = globals.h version.h core/assert.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 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 + core/object/linuxsll2.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 \ + 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/linuxsll2.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/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 \ 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 + core/object/linuxsll2.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_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 \ @@ -581,8 +587,8 @@ lua_objects = core.luao lib.luao input.luao filter.luao output.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/linuxsll2.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 \ @@ -609,24 +615,24 @@ man3_MANS = dnsjit.core.3 dnsjit.lib.3 dnsjit.input.3 dnsjit.filter.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 + dnsjit.core.object.linuxsll2.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 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -763,6 +769,8 @@ core/object/ip6.$(OBJEXT): core/object/$(am__dirstamp) \ core/object/$(DEPDIR)/$(am__dirstamp) core/object/ip.$(OBJEXT): core/object/$(am__dirstamp) \ core/object/$(DEPDIR)/$(am__dirstamp) +core/object/linuxsll2.$(OBJEXT): core/object/$(am__dirstamp) \ + core/object/$(DEPDIR)/$(am__dirstamp) core/object/linuxsll.$(OBJEXT): core/object/$(am__dirstamp) \ core/object/$(DEPDIR)/$(am__dirstamp) core/object/loop.$(OBJEXT): core/object/$(am__dirstamp) \ @@ -879,6 +887,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/ip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/ip6.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/linuxsll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/linuxsll2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/null.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@core/object/$(DEPDIR)/payload.Po@am__quote@ # am--include-marker @@ -1285,6 +1294,7 @@ distclean: distclean-recursive -rm -f core/object/$(DEPDIR)/ip.Po -rm -f core/object/$(DEPDIR)/ip6.Po -rm -f core/object/$(DEPDIR)/linuxsll.Po + -rm -f core/object/$(DEPDIR)/linuxsll2.Po -rm -f core/object/$(DEPDIR)/loop.Po -rm -f core/object/$(DEPDIR)/null.Po -rm -f core/object/$(DEPDIR)/payload.Po @@ -1378,6 +1388,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f core/object/$(DEPDIR)/ip.Po -rm -f core/object/$(DEPDIR)/ip6.Po -rm -f core/object/$(DEPDIR)/linuxsll.Po + -rm -f core/object/$(DEPDIR)/linuxsll2.Po -rm -f core/object/$(DEPDIR)/loop.Po -rm -f core/object/$(DEPDIR)/null.Po -rm -f core/object/$(DEPDIR)/payload.Po @@ -1551,6 +1562,9 @@ dnsjit.core.object.ip6.3in: core/object/ip6.lua gen-manpage.lua dnsjit.core.object.ip.3in: core/object/ip.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/ip.lua" > "$@" +dnsjit.core.object.linuxsll2.3in: core/object/linuxsll2.lua gen-manpage.lua + $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll2.lua" > "$@" + dnsjit.core.object.linuxsll.3in: core/object/linuxsll.lua gen-manpage.lua $(LUAJIT) "$(srcdir)/gen-manpage.lua" "$(srcdir)/core/object/linuxsll.lua" > "$@" diff --git a/src/core.lua b/src/core.lua index bff4223..08b9900 100644 --- a/src/core.lua +++ b/src/core.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/assert.h b/src/core/assert.h index 36083be..cb269b7 100644 --- a/src/core/assert.h +++ b/src/core/assert.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/channel.c b/src/core/channel.c index 6c6d1b4..e57bb4e 100644 --- a/src/core/channel.c +++ b/src/core/channel.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/channel.h b/src/core/channel.h index 15b3e0a..ecdac73 100644 --- a/src/core/channel.h +++ b/src/core/channel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/channel.hh b/src/core/channel.hh index 0f3bc81..f3da955 100644 --- a/src/core/channel.hh +++ b/src/core/channel.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/channel.lua b/src/core/channel.lua index 10edfde..89d5974 100644 --- a/src/core/channel.lua +++ b/src/core/channel.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/compat.c b/src/core/compat.c index 3138829..94a3f43 100644 --- a/src/core/compat.c +++ b/src/core/compat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/compat.h b/src/core/compat.h index 1f4f8b9..799464a 100644 --- a/src/core/compat.h +++ b/src/core/compat.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/compat.lua b/src/core/compat.lua index 98c6611..f7d038e 100644 --- a/src/core/compat.lua +++ b/src/core/compat.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/file.c b/src/core/file.c index 8d2eddb..665df01 100644 --- a/src/core/file.c +++ b/src/core/file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/file.h b/src/core/file.h index 280d320..fb7102e 100644 --- a/src/core/file.h +++ b/src/core/file.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/file.hh b/src/core/file.hh index eb87f3b..9578963 100644 --- a/src/core/file.hh +++ b/src/core/file.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/file.lua b/src/core/file.lua index 33e180c..b3d618f 100644 --- a/src/core/file.lua +++ b/src/core/file.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/loader.lua b/src/core/loader.lua index 1c5f9e2..4b602bd 100644 --- a/src/core/loader.lua +++ b/src/core/loader.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/log.c b/src/core/log.c index 03b7b2e..4ff9b45 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/log.h b/src/core/log.h index 7e012c6..a2d2453 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/log.hh b/src/core/log.hh index 9921d4c..c59a78b 100644 --- a/src/core/log.hh +++ b/src/core/log.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/log.lua b/src/core/log.lua index b08cc59..a7bd36c 100644 --- a/src/core/log.lua +++ b/src/core/log.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/object.c b/src/core/object.c index 33190dd..fb8eb7d 100644 --- a/src/core/object.c +++ b/src/core/object.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -27,6 +27,7 @@ #include "core/object/null.h" #include "core/object/loop.h" #include "core/object/linuxsll.h" +#include "core/object/linuxsll2.h" #include "core/object/ieee802.h" #include "core/object/gre.h" #include "core/object/ip.h" @@ -57,6 +58,8 @@ core_object_t* core_object_copy(const core_object_t* self) return (core_object_t*)core_object_ieee802_copy((core_object_ieee802_t*)self); case CORE_OBJECT_GRE: return (core_object_t*)core_object_gre_copy((core_object_gre_t*)self); + case CORE_OBJECT_LINUXSLL2: + return (core_object_t*)core_object_linuxsll2_copy((core_object_linuxsll2_t*)self); case CORE_OBJECT_IP: return (core_object_t*)core_object_ip_copy((core_object_ip_t*)self); case CORE_OBJECT_IP6: @@ -105,6 +108,9 @@ void core_object_free(core_object_t* self) case CORE_OBJECT_GRE: core_object_gre_free((core_object_gre_t*)self); break; + case CORE_OBJECT_LINUXSLL2: + core_object_linuxsll2_free((core_object_linuxsll2_t*)self); + break; case CORE_OBJECT_IP: core_object_ip_free((core_object_ip_t*)self); break; diff --git a/src/core/object.h b/src/core/object.h index 3a0c0cb..8745a86 100644 --- a/src/core/object.h +++ b/src/core/object.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -30,6 +30,7 @@ #define CORE_OBJECT_LINUXSLL 13 #define CORE_OBJECT_IEEE802 14 #define CORE_OBJECT_GRE 15 +#define CORE_OBJECT_LINUXSLL2 16 /* protocol objects */ #define CORE_OBJECT_IP 20 #define CORE_OBJECT_IP6 21 diff --git a/src/core/object.hh b/src/core/object.hh index 5e125c4..3a6cabf 100644 --- a/src/core/object.hh +++ b/src/core/object.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object.lua b/src/core/object.lua index f950ce1..15e9d7b 100644 --- a/src/core/object.lua +++ b/src/core/object.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -41,6 +41,7 @@ require("dnsjit.core.object.ether_h") require("dnsjit.core.object.null_h") require("dnsjit.core.object.loop_h") require("dnsjit.core.object.linuxsll_h") +require("dnsjit.core.object.linuxsll2_h") require("dnsjit.core.object.ieee802_h") require("dnsjit.core.object.gre_h") require("dnsjit.core.object.ip_h") @@ -65,6 +66,7 @@ local Object = { LINUXSLL = 13, IEEE802 = 14, GRE = 15, + LINUXSLL2 = 16, IP = 20, IP6 = 21, ICMP = 22, @@ -83,6 +85,7 @@ _type[Object.LOOP] = "loop" _type[Object.LINUXSLL] = "linuxsll" _type[Object.IEEE802] = "ieee802" _type[Object.GRE] = "gre" +_type[Object.LINUXSLL2] = "linuxsll2" _type[Object.IP] = "ip" _type[Object.IP6] = "ip6" _type[Object.ICMP] = "icmp" @@ -112,6 +115,7 @@ _cast[Object.LOOP] = "core_object_loop_t*" _cast[Object.LINUXSLL] = "core_object_linuxsll_t*" _cast[Object.IEEE802] = "core_object_ieee802_t*" _cast[Object.GRE] = "core_object_gre_t*" +_cast[Object.LINUXSLL2] = "core_object_linuxsll2_t*" _cast[Object.IP] = "core_object_ip_t*" _cast[Object.IP6] = "core_object_ip6_t*" _cast[Object.ICMP] = "core_object_icmp_t*" @@ -164,6 +168,7 @@ core_object_t = ffi.metatype(t_name, { __index = Object }) -- dnsjit.core.object.null (3), -- dnsjit.core.object.loop (3), -- dnsjit.core.object.linuxsll (3), +-- dnsjit.core.object.linuxsll2 (3), -- dnsjit.core.object.ieee802 (3), -- dnsjit.core.object.gre (3), -- dnsjit.core.object.ip (3), diff --git a/src/core/object/dns.c b/src/core/object/dns.c index 85eb9a7..8f1a26f 100644 --- a/src/core/object/dns.c +++ b/src/core/object/dns.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -51,6 +51,7 @@ #define bswap_64(x) bswap64(x) #endif #endif +#include #define _ERR_MALFORMED -2 #define _ERR_NEEDLABELS -3 @@ -475,3 +476,32 @@ int core_object_dns_parse_rr(core_object_dns_t* self, core_object_dns_rr_t* rr, // TODO: error here on malformed/truncated? could be quite spammy return _ERR_MALFORMED; } + +const char* core_object_dns_torfc1035(const char* str, size_t len) +{ + mlassert(str, "str is nil"); + static char res[512]; + + size_t i, j = 0; + for (i = 0; i < len; i++) { + if (j + 4 >= sizeof(res) - 1) { + return 0; + } + + if (isalnum(str[i]) || str[i] == '-' || str[i] == '_') { + res[j++] = str[i]; + } else if (isprint(str[i])) { + res[j++] = '\\'; + res[j++] = str[i]; + } else { + res[j++] = '\\'; + res[j++] = '0' + (((unsigned char)str[i] >> 6) & 0x07); + res[j++] = '0' + (((unsigned char)str[i] >> 3) & 0x07); + res[j++] = '0' + ((unsigned char)str[i] & 0x07); + } + } + + res[j] = 0; + + return res; +} \ No newline at end of file diff --git a/src/core/object/dns.h b/src/core/object/dns.h index a2b3d56..683c63d 100644 --- a/src/core/object/dns.h +++ b/src/core/object/dns.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4efd148..4e3c31f 100644 --- a/src/core/object/dns.hh +++ b/src/core/object/dns.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -117,3 +117,5 @@ void core_object_dns_reset(core_object_dns_t* self); int core_object_dns_parse_header(core_object_dns_t* self); int core_object_dns_parse_q(core_object_dns_t* self, core_object_dns_q_t* q, core_object_dns_label_t* label, size_t labels); int core_object_dns_parse_rr(core_object_dns_t* self, core_object_dns_rr_t* rr, core_object_dns_label_t* label, size_t labels); + +const char* core_object_dns_torfc1035(const char* str, size_t len); diff --git a/src/core/object/dns.lua b/src/core/object/dns.lua index 6cb3477..c296e3f 100644 --- a/src/core/object/dns.lua +++ b/src/core/object/dns.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 34e77d8..15569f5 100644 --- a/src/core/object/dns/label.lua +++ b/src/core/object/dns/label.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -67,8 +67,16 @@ function Label.new(size) end -- Returns labels as a string and an offset to the next label. --- The string may be nil if the first label was an offset. --- The offset may be nil if the last label was an extension bits or end marker. +-- Takes argument +-- .IR labels , +-- an array of labels returned by any of the parse functions, and +-- .IR num_labels , +-- number of labels in the array. +-- Optional +-- .I offset_labels +-- can be used to skip labels at the start. +-- The return string may be nil if the first label was an offset. +-- The return offset may be nil if the last label was an extension bits or end marker. function Label.tostring(dns, labels, num_labels, offset_labels) if offset_labels == nil then offset_labels = 0 @@ -91,9 +99,50 @@ function Label.tostring(dns, labels, num_labels, offset_labels) return dn, nil end +-- Returns a RFC1035 domain name of the labels and an offset to the next label. +-- Takes argument +-- .IR labels , +-- an array of labels returned by any of the parse functions, and +-- .IR num_labels , +-- number of labels in the array. +-- Optional +-- .I offset_labels +-- can be used to skip labels at the start. +-- The return string may be nil if the first label was an offset. +-- The return offset may be nil if the last label was an extension bits or end marker. +function Label.torfc1035(dns, labels, num_labels, offset_labels) + if offset_labels == nil then + offset_labels = 0 + end + local dn + for n = 1, tonumber(num_labels) do + local label = labels[n - 1 + offset_labels] + + if label.have_dn == 1 then + if dn == nil then + dn = "" + end + dn = dn .. ffi.string(ffi.C.core_object_dns_torfc1035(dns.payload + label.offset + 1, label.length)) .. "." + elseif label.have_offset == 1 then + return dn, label.offset + else + return dn, nil + end + end + return dn, nil +end + -- Returns labels as a string which also includes a textual notation of the -- offset in the form of -- .IR "label" . +-- Takes argument +-- .IR labels , +-- an array of labels returned by any of the parse functions, and +-- .IR num_labels , +-- number of labels in the array. +-- Optional +-- .I offset_labels +-- can be used to skip labels at the start. function Label.tooffstr(dns, labels, num_labels, offset_labels) if offset_labels == nil then offset_labels = 0 diff --git a/src/core/object/dns/q.lua b/src/core/object/dns/q.lua index 5b90d6c..b6b8681 100644 --- a/src/core/object/dns/q.lua +++ b/src/core/object/dns/q.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 5689b5f..e03d92b 100644 --- a/src/core/object/dns/rr.lua +++ b/src/core/object/dns/rr.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 0d8b160..67adc26 100644 --- a/src/core/object/ether.c +++ b/src/core/object/ether.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 7f7f948..a674aa7 100644 --- a/src/core/object/ether.h +++ b/src/core/object/ether.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 9e5fc4f..9291980 100644 --- a/src/core/object/ether.hh +++ b/src/core/object/ether.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/ether.lua b/src/core/object/ether.lua index 00400d0..3a4bc60 100644 --- a/src/core/object/ether.lua +++ b/src/core/object/ether.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 9b5187e..1961721 100644 --- a/src/core/object/gre.c +++ b/src/core/object/gre.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 6c6142c..89bf41f 100644 --- a/src/core/object/gre.h +++ b/src/core/object/gre.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 18ab7c8..bf7b3b0 100644 --- a/src/core/object/gre.hh +++ b/src/core/object/gre.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/gre.lua b/src/core/object/gre.lua index e518888..82f16cf 100644 --- a/src/core/object/gre.lua +++ b/src/core/object/gre.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 609b4e2..b02a6ec 100644 --- a/src/core/object/icmp.c +++ b/src/core/object/icmp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 e923b16..501251b 100644 --- a/src/core/object/icmp.h +++ b/src/core/object/icmp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 faf528d..4f189e6 100644 --- a/src/core/object/icmp.hh +++ b/src/core/object/icmp.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/icmp.lua b/src/core/object/icmp.lua index dd916d4..c3e9555 100644 --- a/src/core/object/icmp.lua +++ b/src/core/object/icmp.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 250d5a5..1dfcae2 100644 --- a/src/core/object/icmp6.c +++ b/src/core/object/icmp6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 62ad056..a81bc0a 100644 --- a/src/core/object/icmp6.h +++ b/src/core/object/icmp6.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 250af69..7a9a768 100644 --- a/src/core/object/icmp6.hh +++ b/src/core/object/icmp6.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/icmp6.lua b/src/core/object/icmp6.lua index 8ac6c8f..aba05e5 100644 --- a/src/core/object/icmp6.lua +++ b/src/core/object/icmp6.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 e81fbab..b33031f 100644 --- a/src/core/object/ieee802.c +++ b/src/core/object/ieee802.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 487acb3..c4cefc1 100644 --- a/src/core/object/ieee802.h +++ b/src/core/object/ieee802.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 3abb71d..e67e2db 100644 --- a/src/core/object/ieee802.hh +++ b/src/core/object/ieee802.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/ieee802.lua b/src/core/object/ieee802.lua index e0d5e23..97870b0 100644 --- a/src/core/object/ieee802.lua +++ b/src/core/object/ieee802.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 ff58810..155da89 100644 --- a/src/core/object/ip.c +++ b/src/core/object/ip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 1fdcdb8..ebd2d66 100644 --- a/src/core/object/ip.h +++ b/src/core/object/ip.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 8bdb288..98c3b59 100644 --- a/src/core/object/ip.hh +++ b/src/core/object/ip.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/ip.lua b/src/core/object/ip.lua index 787acb8..9193bd5 100644 --- a/src/core/object/ip.lua +++ b/src/core/object/ip.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 8117226..7efe385 100644 --- a/src/core/object/ip6.c +++ b/src/core/object/ip6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 35f31df..5df5158 100644 --- a/src/core/object/ip6.h +++ b/src/core/object/ip6.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -37,6 +37,7 @@ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \ 0, 0, 0, 0, \ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \ + 0, \ } #endif diff --git a/src/core/object/ip6.hh b/src/core/object/ip6.hh index 5b4823e..a9b3478 100644 --- a/src/core/object/ip6.hh +++ b/src/core/object/ip6.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -36,6 +36,8 @@ typedef struct core_object_ip6 { uint16_t frag_offlg; uint16_t frag_ident; uint8_t rtdst[16]; + + uint16_t hlen; } core_object_ip6_t; core_object_ip6_t* core_object_ip6_copy(const core_object_ip6_t* self); diff --git a/src/core/object/ip6.lua b/src/core/object/ip6.lua index 459e7dd..948d3e9 100644 --- a/src/core/object/ip6.lua +++ b/src/core/object/ip6.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -58,6 +58,9 @@ -- rtdst -- Destination address found in the routing extension header. -- .TP +-- hlen +-- The length of extension headers, in bytes. +-- .TP -- payload -- A pointer to the payload. -- .TP diff --git a/src/core/object/linuxsll.c b/src/core/object/linuxsll.c index f96d55a..d71a34d 100644 --- a/src/core/object/linuxsll.c +++ b/src/core/object/linuxsll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 c9c2c3f..dea18ee 100644 --- a/src/core/object/linuxsll.h +++ b/src/core/object/linuxsll.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 d9dc99b..7df2d00 100644 --- a/src/core/object/linuxsll.hh +++ b/src/core/object/linuxsll.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/linuxsll.lua b/src/core/object/linuxsll.lua index 8436ce0..29506d5 100644 --- a/src/core/object/linuxsll.lua +++ b/src/core/object/linuxsll.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/include/dnsjit/core/object/icmp6.c b/src/core/object/linuxsll2.c similarity index 70% copy from include/dnsjit/core/object/icmp6.c copy to src/core/object/linuxsll2.c index 250d5a5..e5b8b48 100644 --- a/include/dnsjit/core/object/icmp6.c +++ b/src/core/object/linuxsll2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -20,25 +20,25 @@ #include "config.h" -#include "core/object/icmp6.h" +#include "core/object/linuxsll2.h" #include "core/assert.h" #include #include -core_object_icmp6_t* core_object_icmp6_copy(const core_object_icmp6_t* self) +core_object_linuxsll2_t* core_object_linuxsll2_copy(const core_object_linuxsll2_t* self) { - core_object_icmp6_t* copy; + core_object_linuxsll2_t* copy; glassert_self(); - glfatal_oom(copy = malloc(sizeof(core_object_icmp6_t))); - memcpy(copy, self, sizeof(core_object_icmp6_t)); + glfatal_oom(copy = malloc(sizeof(core_object_linuxsll2_t))); + memcpy(copy, self, sizeof(core_object_linuxsll2_t)); copy->obj_prev = 0; return copy; } -void core_object_icmp6_free(core_object_icmp6_t* self) +void core_object_linuxsll2_free(core_object_linuxsll2_t* self) { glassert_self(); free(self); diff --git a/include/dnsjit/core/object/gre.h b/src/core/object/linuxsll2.h similarity index 63% copy from include/dnsjit/core/object/gre.h copy to src/core/object/linuxsll2.h index 6c6142c..b0b77e0 100644 --- a/include/dnsjit/core/object/gre.h +++ b/src/core/object/linuxsll2.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -21,18 +21,18 @@ #include #include -#ifndef __dnsjit_core_object_gre_h -#define __dnsjit_core_object_gre_h +#ifndef __dnsjit_core_object_linuxsll2_h +#define __dnsjit_core_object_linuxsll2_h #include -#include +#include -#define CORE_OBJECT_GRE_INIT(prev) \ - { \ - CORE_OBJECT_INIT(CORE_OBJECT_GRE, prev) \ - , \ - 0, 0, 0, 0, 0 \ +#define CORE_OBJECT_LINUXSLL2_INIT(prev) \ + { \ + CORE_OBJECT_INIT(CORE_OBJECT_LINUXSLL2, prev) \ + , \ + 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } \ } #endif diff --git a/include/dnsjit/core/object/linuxsll.hh b/src/core/object/linuxsll2.hh similarity index 65% copy from include/dnsjit/core/object/linuxsll.hh copy to src/core/object/linuxsll2.hh index d9dc99b..3716dab 100644 --- a/include/dnsjit/core/object/linuxsll.hh +++ b/src/core/object/linuxsll2.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -20,16 +20,18 @@ // lua:require("dnsjit.core.object_h") -typedef struct core_object_linuxsll { +typedef struct core_object_linuxsll2 { const core_object_t* obj_prev; int32_t obj_type; - uint16_t packet_type; - uint16_t arp_hardware; - uint16_t link_layer_address_length; + uint16_t protocol_type; + uint16_t reserved; + uint32_t interface_index; + uint16_t arphrd_type; + uint8_t packet_type; + uint8_t link_layer_address_length; uint8_t link_layer_address[8]; - uint16_t ether_type; -} core_object_linuxsll_t; +} core_object_linuxsll2_t; -core_object_linuxsll_t* core_object_linuxsll_copy(const core_object_linuxsll_t* self); -void core_object_linuxsll_free(core_object_linuxsll_t* self); +core_object_linuxsll2_t* core_object_linuxsll2_copy(const core_object_linuxsll2_t* self); +void core_object_linuxsll2_free(core_object_linuxsll2_t* self); diff --git a/src/core/object/linuxsll.lua b/src/core/object/linuxsll2.lua similarity index 62% copy from src/core/object/linuxsll.lua copy to src/core/object/linuxsll2.lua index 8436ce0..3300196 100644 --- a/src/core/object/linuxsll.lua +++ b/src/core/object/linuxsll2.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -16,69 +16,75 @@ -- You should have received a copy of the GNU General Public License -- along with dnsjit. If not, see . --- dnsjit.core.object.linuxsll --- Linux cooked-mode capture (SLL) part of a packet +-- dnsjit.core.object.linuxsll2 +-- Linux cooked-mode v2 capture (SLL2) part of a packet -- --- The SLL part of a packet that usually can be found in the object chain +-- The SLL2 part of a packet that usually can be found in the object chain -- after parsing with, for example, Layer filter. -- .SS Attributes -- .TP +-- protocol_type +-- The protocol type. +-- .TP +-- reserved +-- Reserved (MBZ). +-- .TP +-- interface_index +-- The interface index, on the machine on which the capture is done, of the interface on which the packet was sent or received. +-- .TP +-- arphrd_type +-- The link-layer device type. +-- .TP -- packet_type -- The packet type. -- .TP --- arp_hardware --- The link-layer device type. --- .TP -- link_layer_address_length -- The length of the link-layer address. -- .TP -- link_layer_address -- The link-layer address. --- .TP --- ether_type --- An Ethernet protocol type. module(...,package.seeall) -require("dnsjit.core.object.linuxsll_h") +require("dnsjit.core.object.linuxsll2_h") local ffi = require("ffi") local C = ffi.C -local t_name = "core_object_linuxsll_t" -local core_object_linuxsll_t -local Linuxsll = {} +local t_name = "core_object_linuxsll2_t" +local core_object_linuxsll2_t +local Linuxsll2 = {} -- Return the textual type of the object. -function Linuxsll:type() - return "linuxsll" +function Linuxsll2:type() + return "linuxsll2" end -- Return the previous object. -function Linuxsll:prev() +function Linuxsll2:prev() return self.obj_prev end -- Cast the object to the underlining object module and return it. -function Linuxsll:cast() +function Linuxsll2:cast() return self end -- Cast the object to the generic object module and return it. -function Linuxsll:uncast() +function Linuxsll2:uncast() return ffi.cast("core_object_t*", self) end -- Make a copy of the object and return it. -function Linuxsll:copy() - return C.core_object_linuxsll_copy(self) +function Linuxsll2:copy() + return C.core_object_linuxsll2_copy(self) end -- Free the object, should only be used on copies or otherwise allocated. -function Linuxsll:free() - C.core_object_linuxsll_free(self) +function Linuxsll2:free() + C.core_object_linuxsll2_free(self) end -core_object_linuxsll_t = ffi.metatype(t_name, { __index = Linuxsll }) +core_object_linuxsll2_t = ffi.metatype(t_name, { __index = Linuxsll2 }) -- dnsjit.core.object (3). -- dnsjit.filter.layer (3) -return Linuxsll +return Linuxsll2 diff --git a/src/core/object/loop.c b/src/core/object/loop.c index 6ab171b..3df638a 100644 --- a/src/core/object/loop.c +++ b/src/core/object/loop.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 911ba45..c1c107c 100644 --- a/src/core/object/loop.h +++ b/src/core/object/loop.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 b1e4991..3e2c8e9 100644 --- a/src/core/object/loop.hh +++ b/src/core/object/loop.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/loop.lua b/src/core/object/loop.lua index f38b70d..c9acbdb 100644 --- a/src/core/object/loop.lua +++ b/src/core/object/loop.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 8e0b9fd..85ba83f 100644 --- a/src/core/object/null.c +++ b/src/core/object/null.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 d807541..071c6c2 100644 --- a/src/core/object/null.h +++ b/src/core/object/null.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 95293a3..7d6ea1d 100644 --- a/src/core/object/null.hh +++ b/src/core/object/null.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/null.lua b/src/core/object/null.lua index 46939eb..3689342 100644 --- a/src/core/object/null.lua +++ b/src/core/object/null.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 17188d2..8cd37d8 100644 --- a/src/core/object/payload.c +++ b/src/core/object/payload.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 898379a..67f3c1b 100644 --- a/src/core/object/payload.h +++ b/src/core/object/payload.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 e9d86fb..56465dd 100644 --- a/src/core/object/payload.hh +++ b/src/core/object/payload.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/payload.lua b/src/core/object/payload.lua index ac4d2a7..1f627c9 100644 --- a/src/core/object/payload.lua +++ b/src/core/object/payload.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 fc6c7be..fb58568 100644 --- a/src/core/object/pcap.c +++ b/src/core/object/pcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 ed87c26..8f28e20 100644 --- a/src/core/object/pcap.h +++ b/src/core/object/pcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4d2ec48..472400e 100644 --- a/src/core/object/pcap.hh +++ b/src/core/object/pcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/pcap.lua b/src/core/object/pcap.lua index 66b049e..0311e6c 100644 --- a/src/core/object/pcap.lua +++ b/src/core/object/pcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 4a916c6..c1897c9 100644 --- a/src/core/object/tcp.c +++ b/src/core/object/tcp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 490b644..dd54829 100644 --- a/src/core/object/tcp.h +++ b/src/core/object/tcp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 b9a659a..69b9f2b 100644 --- a/src/core/object/tcp.hh +++ b/src/core/object/tcp.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/tcp.lua b/src/core/object/tcp.lua index 5e23a4b..c0bf07d 100644 --- a/src/core/object/tcp.lua +++ b/src/core/object/tcp.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 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 ff6c7a2..5ed29ae 100644 --- a/src/core/object/udp.c +++ b/src/core/object/udp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 c58b13d..50d4940 100644 --- a/src/core/object/udp.h +++ b/src/core/object/udp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 39748a4..5627b12 100644 --- a/src/core/object/udp.hh +++ b/src/core/object/udp.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/object/udp.lua b/src/core/object/udp.lua index e23408b..0dd5c79 100644 --- a/src/core/object/udp.lua +++ b/src/core/object/udp.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/objects.lua b/src/core/objects.lua index c4b7639..5fbd499 100644 --- a/src/core/objects.lua +++ b/src/core/objects.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. @@ -31,6 +31,7 @@ require("dnsjit.core.object.ether") require("dnsjit.core.object.null") require("dnsjit.core.object.loop") require("dnsjit.core.object.linuxsll") +require("dnsjit.core.object.linuxsll2") require("dnsjit.core.object.ieee802") require("dnsjit.core.object.gre") require("dnsjit.core.object.ip") @@ -48,6 +49,7 @@ require("dnsjit.core.object.dns") -- dnsjit.core.object.null (3), -- dnsjit.core.object.loop (3), -- dnsjit.core.object.linuxsll (3), +-- dnsjit.core.object.linuxsll2 (3), -- dnsjit.core.object.ieee802 (3), -- dnsjit.core.object.gre (3), -- dnsjit.core.object.ip (3), diff --git a/src/core/producer.c b/src/core/producer.c index 61ea255..db3352a 100644 --- a/src/core/producer.c +++ b/src/core/producer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/producer.h b/src/core/producer.h index 139782e..3c56797 100644 --- a/src/core/producer.h +++ b/src/core/producer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/producer.hh b/src/core/producer.hh index ab3a222..fa957e0 100644 --- a/src/core/producer.hh +++ b/src/core/producer.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/producer.lua b/src/core/producer.lua index e457807..f9d91ca 100644 --- a/src/core/producer.lua +++ b/src/core/producer.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/receiver.c b/src/core/receiver.c index 5264549..5e33425 100644 --- a/src/core/receiver.c +++ b/src/core/receiver.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/receiver.h b/src/core/receiver.h index e109778..9818f44 100644 --- a/src/core/receiver.h +++ b/src/core/receiver.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/receiver.hh b/src/core/receiver.hh index 3bea05f..fdb0da5 100644 --- a/src/core/receiver.hh +++ b/src/core/receiver.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/receiver.lua b/src/core/receiver.lua index 91c4cee..d4a160c 100644 --- a/src/core/receiver.lua +++ b/src/core/receiver.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/thread.c b/src/core/thread.c index abaa063..0c090bd 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/thread.h b/src/core/thread.h index ffae739..8c46cdc 100644 --- a/src/core/thread.h +++ b/src/core/thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/thread.hh b/src/core/thread.hh index 1161f13..e8b4e65 100644 --- a/src/core/thread.hh +++ b/src/core/thread.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/thread.lua b/src/core/thread.lua index 577e9bf..1eef11a 100644 --- a/src/core/thread.lua +++ b/src/core/thread.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/core/timespec.h b/src/core/timespec.h index 5d99e24..9f1caa4 100644 --- a/src/core/timespec.h +++ b/src/core/timespec.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/timespec.hh b/src/core/timespec.hh index 0c40d11..ec02530 100644 --- a/src/core/timespec.hh +++ b/src/core/timespec.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/core/timespec.lua b/src/core/timespec.lua index ab810e0..b371543 100644 --- a/src/core/timespec.lua +++ b/src/core/timespec.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/dnsjit.1in b/src/dnsjit.1in index 3d2262e..bc97a0a 100644 --- a/src/dnsjit.1in +++ b/src/dnsjit.1in @@ -1,4 +1,4 @@ -.\" Copyright (c) 2018-2024 OARC, Inc. +.\" Copyright (c) 2018-2025 OARC, Inc. .\" All rights reserved. .\" .\" This file is part of dnsjit. diff --git a/src/dnsjit.c b/src/dnsjit.c index 20b8d14..5422814 100644 --- a/src/dnsjit.c +++ b/src/dnsjit.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter.lua b/src/filter.lua index 29f0c77..72d2ca3 100644 --- a/src/filter.lua +++ b/src/filter.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/filter/copy.c b/src/filter/copy.c index 04a90ef..377e22e 100644 --- a/src/filter/copy.c +++ b/src/filter/copy.c @@ -100,6 +100,9 @@ void filter_copy_set(filter_copy_t* self, int32_t obj_type) case CORE_OBJECT_DNS: self->copy |= 0x8000; break; + case CORE_OBJECT_LINUXSLL2: + self->copy |= 0x10000; + break; default: lfatal("unknown type %d", obj_type); } @@ -142,6 +145,8 @@ uint64_t filter_copy_get(filter_copy_t* self, int32_t obj_type) return self->copy & 0x4000; case CORE_OBJECT_DNS: return self->copy & 0x8000; + case CORE_OBJECT_LINUXSLL2: + return self->copy & 0x10000; default: lfatal("unknown type %d", obj_type); } diff --git a/src/filter/layer.c b/src/filter/layer.c index 80f0450..3b88123 100644 --- a/src/filter/layer.c +++ b/src/filter/layer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -74,6 +74,7 @@ static filter_layer_t _defaults = { CORE_OBJECT_ETHER_INIT(0), CORE_OBJECT_LOOP_INIT(0), CORE_OBJECT_LINUXSLL_INIT(0), + CORE_OBJECT_LINUXSLL2_INIT(0), 0, { CORE_OBJECT_IEEE802_INIT(0), CORE_OBJECT_IEEE802_INIT(0), CORE_OBJECT_IEEE802_INIT(0) }, CORE_OBJECT_IP_INIT(0), CORE_OBJECT_IP6_INIT(0), @@ -251,8 +252,8 @@ static inline int _proto(filter_layer_t* self, uint8_t proto, const core_object_ payload->obj_prev = (core_object_t*)udp; /* Check for padding */ - if (len > udp->ulen) { - payload->padding = len - udp->ulen; + if (len > (udp->ulen - 8)) { + payload->padding = len - (udp->ulen - 8); payload->len = len - payload->padding; } else { payload->padding = 0; @@ -287,11 +288,11 @@ static inline int _proto(filter_layer_t* self, uint8_t proto, const core_object_ payload->obj_prev = (core_object_t*)tcp; /* Check for padding */ - if (obj->obj_type == CORE_OBJECT_IP && len > (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4))) { - payload->padding = len - (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4)); + if (obj->obj_type == CORE_OBJECT_IP && len > (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4) - (tcp->off * 4))) { + payload->padding = len - (((const core_object_ip_t*)obj)->len - (((const core_object_ip_t*)obj)->hl * 4) - (tcp->off * 4)); payload->len = len - payload->padding; - } else if (obj->obj_type == CORE_OBJECT_IP6 && len > ((const core_object_ip6_t*)obj)->plen) { - payload->padding = len - ((const core_object_ip6_t*)obj)->plen; + } else if (obj->obj_type == CORE_OBJECT_IP6 && len > (((const core_object_ip6_t*)obj)->plen - ((const core_object_ip6_t*)obj)->hlen - (tcp->off * 4))) { + payload->padding = len - (((const core_object_ip6_t*)obj)->plen - ((const core_object_ip6_t*)obj)->hlen - (tcp->off * 4)); payload->len = len - payload->padding; } else { payload->padding = 0; @@ -381,6 +382,7 @@ static inline int _ip(filter_layer_t* self, const core_object_t* obj, const unsi need8(ip6->hlim, pkt, len); needxb(&ip6->src, 16, pkt, len); needxb(&ip6->dst, 16, pkt, len); + ip6->hlen = 0; /* Check reported length for missing payload */ if (len < ip6->plen) { @@ -401,6 +403,7 @@ static inline int _ip(filter_layer_t* self, const core_object_t* obj, const unsi */ if (ext.ip6e_len) { advancexb(ext.ip6e_len * 8, pkt, len); + ip6->hlen += ext.ip6e_len * 8; } /* TODO: Store IPv6 headers? */ @@ -454,8 +457,8 @@ static inline int _ip(filter_layer_t* self, const core_object_t* obj, const unsi payload->obj_prev = (core_object_t*)ip6; /* Check for padding */ - if (len > ip6->plen) { - payload->padding = len - ip6->plen; + if (len > (ip6->plen - ip6->hlen)) { + payload->padding = len - (ip6->plen - ip6->hlen); payload->len = len - payload->padding; } else { payload->padding = 0; @@ -629,6 +632,33 @@ static inline int _link(filter_layer_t* self, const core_object_pcap_t* pcap) } break; } + case DLT_LINUX_SLL2: { + core_object_linuxsll2_t* linuxsll2 = &self->linuxsll2; + linuxsll2->obj_prev = (core_object_t*)pcap; + + need16(linuxsll2->protocol_type, pkt, len); + need16(linuxsll2->reserved, pkt, len); + need32(linuxsll2->interface_index, pkt, len); + need16(linuxsll2->arphrd_type, pkt, len); + need8(linuxsll2->packet_type, pkt, len); + need8(linuxsll2->link_layer_address_length, pkt, len); + needxb(linuxsll2->link_layer_address, 8, pkt, len); + + switch (linuxsll2->protocol_type) { + case 0x8100: /* 802.1q */ + case 0x88a8: /* 802.1ad */ + case 0x9100: /* 802.1 QinQ non-standard */ + return _ieee802(self, linuxsll2->protocol_type, (core_object_t*)linuxsll2, pkt, len); + + case ETHERTYPE_IP: + case ETHERTYPE_IPV6: + return _ip(self, (core_object_t*)linuxsll2, pkt, len); + + default: + break; + } + break; + } /* TODO: These might be interesting to implement case DLT_IPNET: case DLT_PKTAP: diff --git a/src/filter/layer.h b/src/filter/layer.h index 6e527d9..6989daa 100644 --- a/src/filter/layer.h +++ b/src/filter/layer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/src/filter/layer.hh b/src/filter/layer.hh index d60d1fc..ec9e5f1 100644 --- a/src/filter/layer.hh +++ b/src/filter/layer.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. @@ -26,6 +26,7 @@ // 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.linuxsll2_h") // lua:require("dnsjit.core.object.ieee802_h") // lua:require("dnsjit.core.object.ip_h") // lua:require("dnsjit.core.object.ip6_h") @@ -44,21 +45,22 @@ typedef struct filter_layer { core_producer_t prod; void* prod_ctx; - const core_object_t* produced; - core_object_null_t null; - core_object_ether_t ether; - core_object_loop_t loop; - core_object_linuxsll_t linuxsll; - size_t n_ieee802; - core_object_ieee802_t ieee802[3]; // N_IEEE802 - core_object_ip_t ip; - core_object_ip6_t ip6; - core_object_gre_t gre; - core_object_icmp_t icmp; - core_object_icmp6_t icmp6; - core_object_udp_t udp; - core_object_tcp_t tcp; - core_object_payload_t payload; + const core_object_t* produced; + core_object_null_t null; + core_object_ether_t ether; + core_object_loop_t loop; + core_object_linuxsll_t linuxsll; + core_object_linuxsll2_t linuxsll2; + size_t n_ieee802; + core_object_ieee802_t ieee802[3]; // N_IEEE802 + core_object_ip_t ip; + core_object_ip6_t ip6; + core_object_gre_t gre; + core_object_icmp_t icmp; + core_object_icmp6_t icmp6; + core_object_udp_t udp; + core_object_tcp_t tcp; + core_object_payload_t payload; } filter_layer_t; core_log_t* filter_layer_log(); diff --git a/src/filter/layer.lua b/src/filter/layer.lua index c0e497e..5ed57ea 100644 --- a/src/filter/layer.lua +++ b/src/filter/layer.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/filter/split.c b/src/filter/split.c index 27a6c28..f0a413d 100644 --- a/src/filter/split.c +++ b/src/filter/split.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter/split.h b/src/filter/split.h index 24ab39d..d30f03d 100644 --- a/src/filter/split.h +++ b/src/filter/split.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter/split.hh b/src/filter/split.hh index 44c7af9..24183d2 100644 --- a/src/filter/split.hh +++ b/src/filter/split.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter/split.lua b/src/filter/split.lua index e16cbee..cd0f906 100644 --- a/src/filter/split.lua +++ b/src/filter/split.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/filter/timing.c b/src/filter/timing.c index 225d372..8f574a5 100644 --- a/src/filter/timing.c +++ b/src/filter/timing.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter/timing.h b/src/filter/timing.h index 328777e..1f3278c 100644 --- a/src/filter/timing.h +++ b/src/filter/timing.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter/timing.hh b/src/filter/timing.hh index 2e29d8a..18be050 100644 --- a/src/filter/timing.hh +++ b/src/filter/timing.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/filter/timing.lua b/src/filter/timing.lua index 72d8fed..af03b64 100644 --- a/src/filter/timing.lua +++ b/src/filter/timing.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/gen-manpage.lua b/src/gen-manpage.lua index d19f4b1..def5c76 100644 --- a/src/gen-manpage.lua +++ b/src/gen-manpage.lua @@ -1,5 +1,5 @@ print[[ -.\" Copyright (c) 2018-2024 OARC, Inc. +.\" Copyright (c) 2018-2025 OARC, Inc. .\" All rights reserved. .\" .\" This file is part of dnsjit. diff --git a/src/globals.c b/src/globals.c index 90f724b..eadf117 100644 --- a/src/globals.c +++ b/src/globals.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/globals.h b/src/globals.h index 8b4346a..3ed57e6 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input.lua b/src/input.lua index 268d667..69a95b8 100644 --- a/src/input.lua +++ b/src/input.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/input/fpcap.c b/src/input/fpcap.c index 04885c6..d043bc4 100644 --- a/src/input/fpcap.c +++ b/src/input/fpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/fpcap.h b/src/input/fpcap.h index 4f2967e..3c9e1d0 100644 --- a/src/input/fpcap.h +++ b/src/input/fpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/fpcap.hh b/src/input/fpcap.hh index dd8e19d..14bfab0 100644 --- a/src/input/fpcap.hh +++ b/src/input/fpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/fpcap.lua b/src/input/fpcap.lua index e0d9447..0991af4 100644 --- a/src/input/fpcap.lua +++ b/src/input/fpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/input/mmpcap.c b/src/input/mmpcap.c index 2caf5cf..f7bfb35 100644 --- a/src/input/mmpcap.c +++ b/src/input/mmpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/mmpcap.h b/src/input/mmpcap.h index 8844cb7..f6be1ba 100644 --- a/src/input/mmpcap.h +++ b/src/input/mmpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/mmpcap.hh b/src/input/mmpcap.hh index 387d5a6..1aaab87 100644 --- a/src/input/mmpcap.hh +++ b/src/input/mmpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/mmpcap.lua b/src/input/mmpcap.lua index 983d693..32fff82 100644 --- a/src/input/mmpcap.lua +++ b/src/input/mmpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/input/pcap.c b/src/input/pcap.c index 2304109..d2561ea 100644 --- a/src/input/pcap.c +++ b/src/input/pcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/pcap.h b/src/input/pcap.h index 5b091ba..dac2d52 100644 --- a/src/input/pcap.h +++ b/src/input/pcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/pcap.hh b/src/input/pcap.hh index de694a7..a9d31f6 100644 --- a/src/input/pcap.hh +++ b/src/input/pcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/pcap.lua b/src/input/pcap.lua index 237a8db..12a4de7 100644 --- a/src/input/pcap.lua +++ b/src/input/pcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/input/zero.lua b/src/input/zero.lua index 6c50d91..939e33f 100644 --- a/src/input/zero.lua +++ b/src/input/zero.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/input/zmmpcap.c b/src/input/zmmpcap.c index 5c920e1..3f12367 100644 --- a/src/input/zmmpcap.c +++ b/src/input/zmmpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/zmmpcap.h b/src/input/zmmpcap.h index baea3f5..15af7f5 100644 --- a/src/input/zmmpcap.h +++ b/src/input/zmmpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/zmmpcap.hh b/src/input/zmmpcap.hh index 7e930cf..4b5795f 100644 --- a/src/input/zmmpcap.hh +++ b/src/input/zmmpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/zmmpcap.lua b/src/input/zmmpcap.lua index 7646869..0ab9f71 100644 --- a/src/input/zmmpcap.lua +++ b/src/input/zmmpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/input/zpcap.c b/src/input/zpcap.c index dfeb89b..b93d72c 100644 --- a/src/input/zpcap.c +++ b/src/input/zpcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/zpcap.h b/src/input/zpcap.h index cab85bb..ab46eec 100644 --- a/src/input/zpcap.h +++ b/src/input/zpcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/zpcap.hh b/src/input/zpcap.hh index 596fc2b..5dd020b 100644 --- a/src/input/zpcap.hh +++ b/src/input/zpcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/input/zpcap.lua b/src/input/zpcap.lua index 5f2869c..42918d1 100644 --- a/src/input/zpcap.lua +++ b/src/input/zpcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/lib.lua b/src/lib.lua index c3c7c84..2449cc7 100644 --- a/src/lib.lua +++ b/src/lib.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/lib/clock.c b/src/lib/clock.c index 9e1c2a3..c4f8cbe 100644 --- a/src/lib/clock.c +++ b/src/lib/clock.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/lib/clock.h b/src/lib/clock.h index 45120d9..9b04507 100644 --- a/src/lib/clock.h +++ b/src/lib/clock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/lib/clock.hh b/src/lib/clock.hh index 77e1308..fdca687 100644 --- a/src/lib/clock.hh +++ b/src/lib/clock.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/lib/clock.lua b/src/lib/clock.lua index 74c1857..6b3d5d0 100644 --- a/src/lib/clock.lua +++ b/src/lib/clock.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/lib/getopt.lua b/src/lib/getopt.lua index 0622dda..9a16b27 100644 --- a/src/lib/getopt.lua +++ b/src/lib/getopt.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/lib/ip.lua b/src/lib/ip.lua index 839af9b..ee0392c 100644 --- a/src/lib/ip.lua +++ b/src/lib/ip.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/lib/parseconf.lua b/src/lib/parseconf.lua index 45e04ca..93f1707 100644 --- a/src/lib/parseconf.lua +++ b/src/lib/parseconf.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output.lua b/src/output.lua index de21a96..28fc7a5 100644 --- a/src/output.lua +++ b/src/output.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/dnscli.c b/src/output/dnscli.c index ad25b1c..338aee5 100644 --- a/src/output/dnscli.c +++ b/src/output/dnscli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/dnscli.h b/src/output/dnscli.h index 1cf352e..b7f6129 100644 --- a/src/output/dnscli.h +++ b/src/output/dnscli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/dnscli.hh b/src/output/dnscli.hh index f86bccc..74c0e1c 100644 --- a/src/output/dnscli.hh +++ b/src/output/dnscli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/dnscli.lua b/src/output/dnscli.lua index 7b308c0..78b8a00 100644 --- a/src/output/dnscli.lua +++ b/src/output/dnscli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/null.lua b/src/output/null.lua index 4c5c1e0..45d86d3 100644 --- a/src/output/null.lua +++ b/src/output/null.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/pcap.c b/src/output/pcap.c index 3ac6a70..ce9b102 100644 --- a/src/output/pcap.c +++ b/src/output/pcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/pcap.h b/src/output/pcap.h index b326e48..6156390 100644 --- a/src/output/pcap.h +++ b/src/output/pcap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/pcap.hh b/src/output/pcap.hh index 43e0fb7..55e709b 100644 --- a/src/output/pcap.hh +++ b/src/output/pcap.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/pcap.lua b/src/output/pcap.lua index 3c62bb2..1b80552 100644 --- a/src/output/pcap.lua +++ b/src/output/pcap.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/respdiff.c b/src/output/respdiff.c index b245e67..a0974e3 100644 --- a/src/output/respdiff.c +++ b/src/output/respdiff.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/respdiff.h b/src/output/respdiff.h index 2d9fee5..10e3c7c 100644 --- a/src/output/respdiff.h +++ b/src/output/respdiff.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/respdiff.hh b/src/output/respdiff.hh index 6edda6e..bc99299 100644 --- a/src/output/respdiff.hh +++ b/src/output/respdiff.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/respdiff.lua b/src/output/respdiff.lua index 78831ff..ecd2b93 100644 --- a/src/output/respdiff.lua +++ b/src/output/respdiff.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/tcpcli.c b/src/output/tcpcli.c index 9d76a03..d081ad6 100644 --- a/src/output/tcpcli.c +++ b/src/output/tcpcli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/tcpcli.h b/src/output/tcpcli.h index a44018b..da9736a 100644 --- a/src/output/tcpcli.h +++ b/src/output/tcpcli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/tcpcli.hh b/src/output/tcpcli.hh index e538100..7d638fd 100644 --- a/src/output/tcpcli.hh +++ b/src/output/tcpcli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/tcpcli.lua b/src/output/tcpcli.lua index 98bcfb5..5f21591 100644 --- a/src/output/tcpcli.lua +++ b/src/output/tcpcli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/tlscli.c b/src/output/tlscli.c index d9a85e7..c8908d0 100644 --- a/src/output/tlscli.c +++ b/src/output/tlscli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/tlscli.h b/src/output/tlscli.h index 83d2449..c0f73f7 100644 --- a/src/output/tlscli.h +++ b/src/output/tlscli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/tlscli.hh b/src/output/tlscli.hh index 355e9ae..f676172 100644 --- a/src/output/tlscli.hh +++ b/src/output/tlscli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/tlscli.lua b/src/output/tlscli.lua index ee7fbfe..b26be41 100644 --- a/src/output/tlscli.lua +++ b/src/output/tlscli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/output/udpcli.c b/src/output/udpcli.c index 85894cc..1fd3a5a 100644 --- a/src/output/udpcli.c +++ b/src/output/udpcli.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/udpcli.h b/src/output/udpcli.h index 0aec60f..be98491 100644 --- a/src/output/udpcli.h +++ b/src/output/udpcli.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/udpcli.hh b/src/output/udpcli.hh index c7cbf83..d4227e2 100644 --- a/src/output/udpcli.hh +++ b/src/output/udpcli.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 OARC, Inc. * All rights reserved. * * This file is part of dnsjit. diff --git a/src/output/udpcli.lua b/src/output/udpcli.lua index 575f19d..603d437 100644 --- a/src/output/udpcli.lua +++ b/src/output/udpcli.lua @@ -1,4 +1,4 @@ --- Copyright (c) 2018-2024 OARC, Inc. +-- Copyright (c) 2018-2025 OARC, Inc. -- All rights reserved. -- -- This file is part of dnsjit. diff --git a/src/test/46vs45.pcap b/src/test/46vs45.pcap new file mode 100644 index 0000000000000000000000000000000000000000..d7ac0976a3be2e4a1a7e55040d35e0deeee7d2ae GIT binary patch literal 86 zcmca|c+)~A1{MYcU}Q)Ia_pJ*r(g8uV$cJ!LD-dnLH9$m1B0y~LgmqS45kc{8bx3c LMwmDo1LI!+VE+tL literal 0 HcmV?d00001 diff --git a/src/test/Makefile.am b/src/test/Makefile.am index a3f343f..8446253 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -21,7 +21,7 @@ CLEANFILES = test*.log test*.trs test*.out \ *.pcap-dist *.lz4-dist *.zst-dist TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \ - test-trie.sh test-base64url.sh + test-trie.sh test-base64url.sh test-padding.sh test-sll2.sh test1.sh: dns.pcap-dist dns.pcap.lz4-dist dns.pcap.zst-dist \ dns.pcap.xz-dist dns.pcap.gz-dist @@ -38,6 +38,11 @@ test-ipsplit.sh: pellets.pcap-dist dns.pcap-dist test-trie.sh: pellets.pcap-dist dns.pcap-dist +test-padding.sh: 46vs45.pcap-dist tcp-response-with-trailing-junk.pcap-dist \ + ip6-udp-padd.pcap-dist ip6-tcp-padd.pcap-dist + +test-sll2.sh: sll2.pcap-dist + .pcap.pcap-dist: cp "$<" "$@" @@ -56,4 +61,7 @@ test-trie.sh: pellets.pcap-dist dns.pcap-dist 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.xz dns.pcap.gz + dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz \ + 46vs45.pcap tcp-response-with-trailing-junk.pcap test_padding.gold \ + test_padding.lua ip6-udp-padd.pcap ip6-tcp-padd.pcap \ + test-sll2.gold sll2.pcap diff --git a/src/test/Makefile.in b/src/test/Makefile.in index 713d49a..fcada6e 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -383,6 +383,7 @@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -502,12 +503,15 @@ CLEANFILES = test*.log test*.trs test*.out \ *.pcap-dist *.lz4-dist *.zst-dist TESTS = test1.sh test2.sh test3.sh test4.sh test6.sh test-ipsplit.sh \ - test-trie.sh test-base64url.sh + test-trie.sh test-base64url.sh test-padding.sh test-sll2.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.xz dns.pcap.gz + dns.pcap.lz4 dns.pcap.zst dns.pcap.xz dns.pcap.gz \ + 46vs45.pcap tcp-response-with-trailing-junk.pcap test_padding.gold \ + test_padding.lua ip6-udp-padd.pcap ip6-tcp-padd.pcap \ + test-sll2.gold sll2.pcap all: all-am @@ -753,6 +757,20 @@ test-base64url.sh.log: test-base64url.sh --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +test-padding.sh.log: test-padding.sh + @p='test-padding.sh'; \ + b='test-padding.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test-sll2.sh.log: test-sll2.sh + @p='test-sll2.sh'; \ + b='test-sll2.sh'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ @@ -943,6 +961,11 @@ test-ipsplit.sh: pellets.pcap-dist dns.pcap-dist test-trie.sh: pellets.pcap-dist dns.pcap-dist +test-padding.sh: 46vs45.pcap-dist tcp-response-with-trailing-junk.pcap-dist \ + ip6-udp-padd.pcap-dist ip6-tcp-padd.pcap-dist + +test-sll2.sh: sll2.pcap-dist + .pcap.pcap-dist: cp "$<" "$@" diff --git a/src/test/ip6-tcp-padd.pcap b/src/test/ip6-tcp-padd.pcap new file mode 100644 index 0000000000000000000000000000000000000000..fde5926355a53ae4d37fd7b03309c9fc55cc69fb GIT binary patch literal 1738 zcma)-dr(YK9LIm>?x|h1yS9gCNysP)A$d#?-nJjnqD z*Fd15Vui9*>%S7gBD!WX1wMX*P|q23DI7>B=o($>gs2I#H}7Qk%edc%VLSkb@omh> zytK_XjO;#=NTe)&xG=slb7pViL)4|t#rq3N=o!1pe64Nn@!1*9_$z6A9X*dtTmEsq z&VLs@qtq}E{e&enUu4hSmVan_J_-iAZ+hj}G7Pr?7y#tp1+wn=gP&h*>;Ho}^iD)@ z5rb`}P>0y`{|p=sOQ}N(&A^He@EPo28DLF&zOjrRtE9F992u}Qq#s(rAEnE6+1WV} zdW~+YMyHo-(&W%>PK;3+2@=XwvCI_9^8a4|x6M)%v;J z{=Q?98uj6+))Lj<%=fi>El*>tr#|mleqeH+=Z2~3!15uMJZ`|_Al3GvrmXTg`cYS2 z95*)RW#@+LhANN9E81eZYu=QF$es+EZ?1?wVI)P-)3ZHmn}e1mR`+Whq^gwV9#RY+ zUf1)fr~X-5WJkkD^P}n|Gp~C8j!#{_&)U_I_*JdD8HwI6?V5OhuusOMq9f5W^p*w6 zWp^90in~foo&`x&ZLte|lhqkT?eQni6l^^I))YBHJue|(^%T#5()0(H^Eb6Dy!IjI z=(#u33?Y8W6U%Q^^pLJKow4LJ1UlZhDj0c4s$=O(W`l$AB+kV`5xNd4JEB)_GTp`K zb8NqJ$Vsjni*O=PkU}?hmS;*5=*GtJtS{+sW4=zNP>{=R%>GTW4GAPe$fQ>1Q#Q6+ z$UG$SQ4Y$yuM#rpAHj2o)Cw8(euAg7$bBJG)bRu$iq;xAYK`l|0Mq*N+Wg(j(VFs_ z48yFByl#*tvD)#P+CGXS)`i#gYi~x;TJV~L9QGl*1$vqx zhdykrD( zDPYsqL4*I_zZ`!6%i{gT*xc9)KsMuq+YF`* Sk_eN literal 0 HcmV?d00001 diff --git a/src/test/sll2.pcap b/src/test/sll2.pcap new file mode 100644 index 0000000000000000000000000000000000000000..1766ac8fde821555cee14d512bd576de3aa1bf30 GIT binary patch literal 927 zcmca|c+)~A1{MYwxWmf8Ai~JN;PUEJx>7VVLo`qVggGDzxEL5&*kEd185rCri7+rY z2=es3V_;weVy1~R8B7_ByWR&{GAb|t%>e>NCLKK>3F2w8Twq{mU|`^3;9}sgI62Ar zkr$UJ$SU8-%nUrtKnWm5SjB*371NLV`VK&=Y7T;|0a?djI&mh`lMm{FmW|C|t5}e& zVgn1YGB_|M@)YIgm*^I!7L}zI6*K3hmN2m96_@0s@BsOl#hK}Oy6Hgi`l)<}^fZRpDaN|&kKZY2?4Q(q zZuaYSdjx!Iz3vFD3KBBtyEYviu(z_~s9dY2fs{BgZiCDc|1+i&kLoe5+9~rdB461m z(xY;tL)L#=xwN}N5=I^phL;^?&r3S#)Alkd_)Wp@mNPG$Wki3!x>WGaY(JCx*>jFD zwM(~kW$bqgKXZCozeBD}$*MKge~RxUhJ~*6U;N{d{;s?K-{gPLZ(`r-HfI)#BXa2I zV}y?Q|Ez_^+ah+CPkrj8#55z4@9$b>H!0;48P86f{WbI6&ezL$l%;;%lT!7lN)Jw& z#vYshU7kPv=dG%_IsY1SUp;OV{>qCS{B;u^4u&X>8a@j|6hk* z{&b#UGqdJ=eOQ6V{4|{dVy_>qo-S4R?v>ku)j79j2=iBM6AN*dUC>GO%2 zY7WA87+*^QrZ9j literal 0 HcmV?d00001 diff --git a/src/test/tcp-response-with-trailing-junk.pcap b/src/test/tcp-response-with-trailing-junk.pcap new file mode 100644 index 0000000000000000000000000000000000000000..298c9530e928bd8e067e4917b90b7d881cc40947 GIT binary patch literal 9641 zcmeI$c~DbF90%}yNeD-Y7^n&~SgIq4NV&v=!WaP+!2^&(u@$kz2<4EFp`uX2QERI> zhysH}j%u+gqE^VDLZRRR76YS*wSfwXv4f~RgaAtH?u*Yn5gvcbyq#Gf3G@B!+sx;e z&1hXgAX!KHwqo9IKUtNjV5{MfTaK|b5sDp=X&}k1AxI9bCD06fP?Cs zvkWuGBjEFxJ^X?#g4N%PiT16~7pK%`(ILlIw;5Fc4U)NxxQoa(v$3pc*F)?DBIDsf$Ac|u~3&cPxI!+uJrVk&7 z$At@{ZG`ao&tsy%_H$_s0BGv~z)T0a&JsKUe5{Vbi~t+H0z-v=tnm>xn$-%o07-JZ z%Fp7*filzlwhO|$=MxgU0yB5#t-CL(FX$;W`fX~?UUyM|g>HAR{EnYkIX76E_2t!k zX_xh?B=?@U7YV0iI?HpbzA-3U5i+l-C@*9GE+r$vD)sBRGd5K$T)$%av+bB?>e^?8 z;cK1_J#?0O)!R|(ygv5@6Ha&)DDn2tdeB*96u?@8<JwC;&P$&>P2;z_(emZ?mBA@ZES6jmQ=cypUJ=dU`x~8QnT=izTikpxreo(zk&DumX_K6 z)7x)ET7Ku6_Gv#)HYs9n#**wOhEwx93Mwo6H3)bRfiZyqVG}l<&a9u}?3FhED<_1a z;}EV3uy_1LT7Dbh&r9LIyl{FM^k`#8K<4ZI$E1W%Dhf=AS#;nDCW z2E4x@im{KHCA|p6EiVF|Vo(jw#gGJV-gxkYb(HX?;PAF-;3)~CVAj% zo@admU-O9(Yp#Xqrjp6nkSYhR5mT=hC8M?Of{D>E3Qh9B6E|6(#1oT7O*Dpyb#Equ zIlP&e`Rk*&6MU8OD87gCdb$Qt_2A$UJ7o%Ysuy05intzPm(cYL!9;WTtr|`8K-a_M zb`7D#pu|xVjWHD_R$mX1$dL19lA0iKJ#-VKo8Y_O1oe;?y-SoGr4;x7(+K~)fi|v6 zD6o$Zhb)rGa zRd+o{s}5fGX5VmC!cO#9!X3R6aV}HtY#F`}CB&*5_7fhRkF;PsQw>_iP39u03|z+2xy1+Od;p}2mHfLEKOhSvp1pLmPLgVzje zP{1?6;YDiT)g~c$U4Zn7N7SI<(eNe)yfcj)5C8x^;jh;NzgM=LSB_AGq!RE_q!6B? zs@$&=GbiqdG3@Qeleh932e9GID>TUi6=4kInd0&yH1blUjBad;U#CW%rU*@sruXjC F`yVl04-o(W literal 0 HcmV?d00001 diff --git a/examples/Makefile.am b/src/test/test-padding.sh old mode 100644 new mode 100755 similarity index 60% copy from examples/Makefile.am copy to src/test/test-padding.sh index a184589..519c4a9 --- a/examples/Makefile.am +++ b/src/test/test-padding.sh @@ -1,4 +1,5 @@ -# Copyright (c) 2018-2024 OARC, Inc. +#!/bin/sh -ex +# Copyright (c) 2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -16,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with dnsjit. If not, see . -dist_doc_DATA = capture.lua dumpdns2pcap.lua dumpdns.lua dumpdns-qr.lua \ - filter_rcode.lua qr-multi-pcap-state.lua readme.lua replay.lua \ - replay_multicli.lua respdiff.lua pcap2tcpdns.lua +../dnsjit "$srcdir/test_padding.lua" -r 46vs45.pcap-dist >test_padding.out +../dnsjit "$srcdir/test_padding.lua" -r tcp-response-with-trailing-junk.pcap-dist >>test_padding.out +../dnsjit "$srcdir/test_padding.lua" -r ip6-udp-padd.pcap-dist >>test_padding.out +../dnsjit "$srcdir/test_padding.lua" -r ip6-tcp-padd.pcap-dist >>test_padding.out +diff "$srcdir/test_padding.gold" test_padding.out diff --git a/src/test/test-sll2.gold b/src/test/test-sll2.gold new file mode 100644 index 0000000..6fbbc28 --- /dev/null +++ b/src/test/test-sll2.gold @@ -0,0 +1,33 @@ +udp 238.0.0.1:37273 -> 238.0.0.2:53 +id: 20793 + qr: 0 + opcode: QUERY + flags: RD AD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 1 +questions: class type labels + IN A <12>,.. +additionals: class type ttl labels RR labels + UNKNOWN(1232) OPT 32768 +udp 238.0.0.2:53 -> 238.0.0.1:37273 +id: 20793 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NXDOMAIN + qdcount: 1 + ancount: 0 + nscount: 4 + arcount: 1 +questions: class type labels + IN A <12>,.. +authorities: class type ttl labels RR labels + IN SOA 5 <31>a.<33>root-servers.<46>net. + IN RRSIG 5 + IN RRSIG 5 + IN NSEC 5 <678>aaa. +additionals: class type ttl labels RR labels + UNKNOWN(1220) OPT 32768 diff --git a/src/test/test4.sh b/src/test/test-sll2.sh similarity index 79% copy from src/test/test4.sh copy to src/test/test-sll2.sh index b72c781..fdf80cb 100755 --- a/src/test/test4.sh +++ b/src/test/test-sll2.sh @@ -1,5 +1,5 @@ -#!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +#!/bin/sh -ex +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. @@ -17,5 +17,5 @@ # You should have received a copy of the GNU General Public License # along with dnsjit. If not, see . -../dnsjit "$srcdir/../../examples/readme.lua" dns.pcap-dist >test4.out -diff "$srcdir/test4.gold" test4.out +../dnsjit "$srcdir/../../examples/dumpdns.lua" sll2.pcap-dist >test-sll2.out +diff "$srcdir/test-sll2.gold" test-sll2.out diff --git a/src/test/test1.sh b/src/test/test1.sh index 400b92c..6e756e6 100755 --- a/src/test/test1.sh +++ b/src/test/test1.sh @@ -1,5 +1,5 @@ #!/bin/sh -ex -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/src/test/test2.sh b/src/test/test2.sh index 40c0928..0eda4cd 100755 --- a/src/test/test2.sh +++ b/src/test/test2.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/src/test/test3.sh b/src/test/test3.sh index e8e6a71..a9139e7 100755 --- a/src/test/test3.sh +++ b/src/test/test3.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/src/test/test4.sh b/src/test/test4.sh index b72c781..015f8f4 100755 --- a/src/test/test4.sh +++ b/src/test/test4.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/src/test/test6.sh b/src/test/test6.sh index 23c3575..76f6562 100755 --- a/src/test/test6.sh +++ b/src/test/test6.sh @@ -1,5 +1,5 @@ #!/bin/sh -e -# Copyright (c) 2018-2024 OARC, Inc. +# Copyright (c) 2018-2025 OARC, Inc. # All rights reserved. # # This file is part of dnsjit. diff --git a/src/test/test_ipsplit.lua b/src/test/test_ipsplit.lua index 43dc8a0..16b58a2 100755 --- a/src/test/test_ipsplit.lua +++ b/src/test/test_ipsplit.lua @@ -81,17 +81,29 @@ while true do if i == 1 then assert(dns_msgid(obj) == 0x0a31, "pkt 1: client 1, pkt 1 -> out1") assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0003") - assert(ip_pkt(obj):destination() == "0100:0000:0000:0000:0000:0000:0000:0001") + if ffi.abi("be") then + assert(ip_pkt(obj):destination() == "0000:0001:0000:0000:0000:0000:0000:0001") + else + assert(ip_pkt(obj):destination() == "0100:0000:0000:0000:0000:0000:0000:0001") + end end if i == 2 then assert(dns_msgid(obj) == 0xb3e8, "pkt 3: client 3, pkt 1 -> out1") assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0005") - assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + if ffi.abi("be") then + assert(ip_pkt(obj):destination() == "0000:0002:0000:0000:0000:0000:0000:0001") + else + assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + end end if i == 3 then assert(dns_msgid(obj) == 0xb3e9, "pkt 4: client 3, pkt 2 -> out1") assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0005") - assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + if ffi.abi("be") then + assert(ip_pkt(obj):destination() == "0000:0002:0000:0000:0000:0000:0000:0001") + else + assert(ip_pkt(obj):destination() == "0200:0000:0000:0000:0000:0000:0000:0001") + end end if i == 13 then assert(dns_msgid(obj) == 0x4a05, "pkt 16: client 7, pkt 1 -> out1") end if i == 14 then assert(dns_msgid(obj) == 0x4a06, "pkt 17: client 7, pkt 2 -> out1") end @@ -288,7 +300,11 @@ while true do i = i + 1 if i == 1 then assert(dns_msgid(obj) == 0xe7af) - assert(ip_pkt(obj):source() == "1.0.0.0") + if ffi.abi("be") then + assert(ip_pkt(obj):source() == "0.0.0.1") + else + assert(ip_pkt(obj):source() == "1.0.0.0") + end assert(ip_pkt(obj):destination() == "8.8.8.8") end end diff --git a/src/test/test_padding.gold b/src/test/test_padding.gold new file mode 100644 index 0000000..077aeb0 --- /dev/null +++ b/src/test/test_padding.gold @@ -0,0 +1,288 @@ + +type length +pcap 46 (len) +pcap 46 (caplen) +ip 45 (len) +udp 25 +payload 17 (len) +payload 1 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 74 (len) +pcap 74 (caplen) +ip 60 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 74 (len) +pcap 74 (caplen) +ip 60 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 110 (len) +pcap 110 (caplen) +ip 96 (len) +tcp +payload 44 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 800 (len) +pcap 800 (caplen) +ip 785 (len) +tcp +payload 733 (len) +payload 1 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip 52 (len) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 84 (len) +pcap 84 (caplen) +ip 70 (len) +udp 50 +payload 42 (len) +payload 0 (padding) + +type length +pcap 773 (len) +pcap 773 (caplen) +ip 759 (len) +udp 739 +payload 731 (len) +payload 0 (padding) + +type length +pcap 85 (len) +pcap 85 (caplen) +ip 71 (len) +udp 51 +payload 43 (len) +payload 0 (padding) + +type length +pcap 774 (len) +pcap 774 (caplen) +ip 760 (len) +udp 740 +payload 732 (len) +payload 0 (padding) + +type length +pcap 66 (len) +pcap 66 (caplen) +ip6 25 (plen) +udp 25 +payload 17 (len) +payload 1 (padding) + +type length +pcap 80 (len) +pcap 80 (caplen) +ip6 40 (plen) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 80 (len) +pcap 80 (caplen) +ip6 40 (plen) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 114 (len) +pcap 114 (caplen) +ip6 74 (plen) +tcp +payload 42 (len) +payload 0 (padding) + +type length +pcap 1200 (len) +pcap 1200 (caplen) +ip6 1159 (plen) +tcp +payload 1127 (len) +payload 1 (padding) + +type length +pcap 72 (len) +pcap 72 (caplen) +ip6 32 (plen) +tcp +payload 0 (len) +payload 0 (padding) + +type length +pcap 72 (len) +pcap 72 (caplen) +ip6 32 (plen) +tcp +payload 0 (len) +payload 0 (padding) diff --git a/src/test/test_padding.lua b/src/test/test_padding.lua new file mode 100644 index 0000000..1d06dca --- /dev/null +++ b/src/test/test_padding.lua @@ -0,0 +1,70 @@ +#!/usr/bin/env dnsjit +local bit = require("bit") +local ffi = require("ffi") +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local object = require("dnsjit.core.objects") +local log = require("dnsjit.core.log").new("pcap2tcpdns") +local getopt = require("dnsjit.lib.getopt").new({ + { "r", "read", "-", "input file to read, use - for stdin", "?" }, +}) + +log:enable("all") + +-- Parse arguments +local args = {} +getopt:parse() +args.read = getopt:val("r") + +-- Set up input +if args.read ~= "" then + log:notice("using input PCAP "..args.read) + if input:open_offline(args.read) ~= 0 then + log:fatal("failed to open input PCAP "..args.read) + end +else + getopt:usage() + log:fatal("input must be specified, use -r") +end +layer:producer(input) +local produce, pctx = layer:produce() + +-- set up output +io.stdout:setvbuf("no") +io.stderr:setvbuf("no") + +local obj, obj_pcap_in, obj_ip, obj_udp, obj_pl +local npacketsin = 0 +while true do + obj = produce(pctx) + if obj == nil then break end + npacketsin = npacketsin + 1 + print("\ntype", "length") + + obj_pcap_in = obj:cast_to(object.PCAP) + print(obj_pcap_in:type(), tonumber(obj_pcap_in.len), "(len)") + print(obj_pcap_in:type(), tonumber(obj_pcap_in.caplen), "(caplen)") + + obj_ip = obj:cast_to(object.IP) + if obj_ip then + print(obj_ip:type(), tonumber(obj_ip.len), "(len)") + else + obj_ip = obj:cast_to(object.IP6) + print(obj_ip:type(), tonumber(obj_ip.plen), "(plen)") + end + + obj_udp = obj:cast_to(object.UDP) + if obj_udp then + print(obj_udp:type(), tonumber(obj_udp.ulen)) + else + obj_tcp = obj:cast_to(object.TCP) + if obj_tcp then + print(obj_tcp:type()) + end + end + + obj_pl = obj:cast_to(object.PAYLOAD) + print(obj_pl:type(), tonumber(obj_pl.len), "(len)") + print(obj_pl:type(), tonumber(obj_pl.padding), "(padding)") +end +log:info(string.format("processed %d packets", npacketsin)) diff --git a/src/version.h b/src/version.h index 94fffa0..5194558 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 OARC, Inc. + * Copyright (c) 2018-2025 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 4 +#define DNSJIT_MINOR_VERSION 5 #define DNSJIT_PATCH_VERSION 0 #endif