diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/Makefile.am | 47 | ||||
-rw-r--r-- | src/test/dns.pcap | bin | 0 -> 20228 bytes | |||
-rw-r--r-- | src/test/pellets.pcap | bin | 0 -> 9177 bytes | |||
-rwxr-xr-x | src/test/test-base64url.sh | 20 | ||||
-rwxr-xr-x | src/test/test-ipsplit.sh | 20 | ||||
-rwxr-xr-x | src/test/test-trie.sh | 20 | ||||
-rw-r--r-- | src/test/test1.gold | 1493 | ||||
-rwxr-xr-x | src/test/test1.sh | 21 | ||||
-rw-r--r-- | src/test/test2.gold | 42 | ||||
-rwxr-xr-x | src/test/test2.sh | 21 | ||||
-rw-r--r-- | src/test/test3.gold | 82 | ||||
-rwxr-xr-x | src/test/test3.sh | 22 | ||||
-rw-r--r-- | src/test/test4.gold | 82 | ||||
-rwxr-xr-x | src/test/test4.sh | 21 | ||||
-rwxr-xr-x | src/test/test5.sh | 24 | ||||
-rwxr-xr-x | src/test/test6.sh | 23 | ||||
-rw-r--r-- | src/test/test_base64url.lua | 24 | ||||
-rwxr-xr-x | src/test/test_ipsplit.lua | 294 | ||||
-rwxr-xr-x | src/test/test_trie.lua | 134 |
19 files changed, 2390 insertions, 0 deletions
diff --git a/src/test/Makefile.am b/src/test/Makefile.am new file mode 100644 index 0000000..09a3c41 --- /dev/null +++ b/src/test/Makefile.am @@ -0,0 +1,47 @@ +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in +CLEANFILES = test*.log test*.trs test*.out \ + *.pcap-dist + +TESTS = test1.sh test2.sh test3.sh test4.sh test5.sh test6.sh test-ipsplit.sh \ + test-trie.sh test-base64url.sh + +test1.sh: dns.pcap-dist + +test2.sh: dns.pcap-dist + +test3.sh: dns.pcap-dist + +test4.sh: dns.pcap-dist + +test5.sh: dns.pcap-dist + +test6.sh: dns.pcap-dist + +test-ipsplit.sh: pellets.pcap-dist dns.pcap-dist + +test-trie.sh: pellets.pcap-dist dns.pcap-dist + +.pcap.pcap-dist: + cp "$<" "$@" + +EXTRA_DIST = $(TESTS) \ + dns.pcap pellets.pcap test_ipsplit.lua test_trie.lua test_base64url.lua \ + test1.gold test2.gold test3.gold test4.gold diff --git a/src/test/dns.pcap b/src/test/dns.pcap Binary files differnew file mode 100644 index 0000000..a0e585c --- /dev/null +++ b/src/test/dns.pcap diff --git a/src/test/pellets.pcap b/src/test/pellets.pcap Binary files differnew file mode 100644 index 0000000..ef39a7b --- /dev/null +++ b/src/test/pellets.pcap diff --git a/src/test/test-base64url.sh b/src/test/test-base64url.sh new file mode 100755 index 0000000..163f847 --- /dev/null +++ b/src/test/test-base64url.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e +# Copyright (c) 2020, CZ.NIC, z.s.p.o. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/test_base64url.lua" diff --git a/src/test/test-ipsplit.sh b/src/test/test-ipsplit.sh new file mode 100755 index 0000000..3d118d6 --- /dev/null +++ b/src/test/test-ipsplit.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e +# Copyright (c) 2020, CZ.NIC, z.s.p.o. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/test_ipsplit.lua" diff --git a/src/test/test-trie.sh b/src/test/test-trie.sh new file mode 100755 index 0000000..238eea1 --- /dev/null +++ b/src/test/test-trie.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e +# Copyright (c) 2020, CZ.NIC, z.s.p.o. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/test_trie.lua" diff --git a/src/test/test1.gold b/src/test/test1.gold new file mode 100644 index 0000000..7ded214 --- /dev/null +++ b/src/test/test1.gold @@ -0,0 +1,1493 @@ +udp 172.17.0.10:53199 -> 8.8.8.8:53 +id: 59311 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:53199 +id: 59311 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 44 <12> +authorities: class type ttl labels RR labels + IN NS 157880 <12> <56>ns4.<12> + IN NS 157880 <12> <74>ns3.<12> + IN NS 157880 <12> <92>ns1.<12> + IN NS 157880 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157880 <110> + IN A 331882 <92> + IN A 157880 <74> + IN A 157880 <56> +udp 172.17.0.10:57822 -> 8.8.8.8:53 +id: 35665 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:57822 +id: 35665 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72125 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72125 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71608 <16> <127>ns2.<131>google.<138>com. + IN NS 71608 <16> <155>ns3.<131> + IN NS 71608 <16> <173>ns1.<131> + IN NS 71608 <16> <191>ns4.<131> +additionals: class type ttl labels RR labels + IN A 331882 <173> + IN A 157880 <155> + IN A 157880 <191> + IN A 157880 <127> +udp 172.17.0.10:40043 -> 8.8.8.8:53 +id: 5337 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:40043 +id: 5337 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 44 <12> +authorities: class type ttl labels RR labels + IN NS 157880 <12> <56>ns1.<12> + IN NS 157880 <12> <74>ns2.<12> + IN NS 157880 <12> <92>ns3.<12> + IN NS 157880 <12> <110>ns4.<12> +additionals: class type ttl labels RR labels + IN A 157880 <74> + IN A 331882 <56> + IN A 157880 <92> + IN A 157880 <110> +udp 172.17.0.10:37953 -> 8.8.8.8:53 +id: 22982 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:37953 +id: 22982 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 34 <12> +authorities: class type ttl labels RR labels + IN NS 157870 <12> <56>ns4.<12> + IN NS 157870 <12> <74>ns1.<12> + IN NS 157870 <12> <92>ns2.<12> + IN NS 157870 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157870 <92> + IN A 331872 <74> + IN A 157870 <110> + IN A 157870 <56> +udp 172.17.0.10:48658 -> 8.8.8.8:53 +id: 18718 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:48658 +id: 18718 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72115 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72115 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71598 <16> <127>ns2.<131>google.<138>com. + IN NS 71598 <16> <155>ns3.<131> + IN NS 71598 <16> <173>ns4.<131> + IN NS 71598 <16> <191>ns1.<131> +additionals: class type ttl labels RR labels + IN A 331872 <191> + IN A 157870 <155> + IN A 157870 <173> + IN A 157870 <127> +udp 172.17.0.10:40953 -> 8.8.8.8:53 +id: 22531 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:40953 +id: 22531 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 297 <12> +authorities: class type ttl labels RR labels + IN NS 157828 <12> <56>ns2.<12> + IN NS 157828 <12> <74>ns4.<12> + IN NS 157828 <12> <92>ns1.<12> + IN NS 157828 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157828 <56> + IN A 331830 <92> + IN A 157828 <110> + IN A 157828 <74> +udp 172.17.0.10:45174 -> 8.8.8.8:53 +id: 58510 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:45174 +id: 58510 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 291 <12> +authorities: class type ttl labels RR labels + IN NS 157822 <12> <56>ns2.<12> + IN NS 157822 <12> <74>ns3.<12> + IN NS 157822 <12> <92>ns1.<12> + IN NS 157822 <12> <110>ns4.<12> +additionals: class type ttl labels RR labels + IN A 157822 <56> + IN A 331824 <92> + IN A 157822 <74> + IN A 157822 <110> +udp 172.17.0.10:33916 -> 8.8.8.8:53 +id: 45248 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:33916 +id: 45248 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72067 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72067 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71550 <16> <127>ns3.<131>google.<138>com. + IN NS 71550 <16> <155>ns4.<131> + IN NS 71550 <16> <173>ns2.<131> + IN NS 71550 <16> <191>ns1.<131> +additionals: class type ttl labels RR labels + IN A 331824 <191> + IN A 157822 <127> + IN A 157822 <155> + IN A 157822 <173> +udp 172.17.0.10:43559 -> 8.8.8.8:53 +id: 49483 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:43559 +id: 49483 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 285 <12> +authorities: class type ttl labels RR labels + IN NS 157816 <12> <56>ns4.<12> + IN NS 157816 <12> <74>ns3.<12> + IN NS 157816 <12> <92>ns1.<12> + IN NS 157816 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157816 <110> + IN A 331818 <92> + IN A 157816 <74> + IN A 157816 <56> +udp 172.17.0.10:54859 -> 8.8.8.8:53 +id: 31669 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:54859 +id: 31669 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 283 <12> +authorities: class type ttl labels RR labels + IN NS 157814 <12> <56>ns2.<12> + IN NS 157814 <12> <74>ns1.<12> + IN NS 157814 <12> <92>ns4.<12> + IN NS 157814 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157814 <56> + IN A 331816 <74> + IN A 157814 <110> + IN A 157814 <92> +udp 172.17.0.10:58176 -> 8.8.8.8:53 +id: 25433 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:58176 +id: 25433 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72059 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72059 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71542 <16> <127>ns4.<131>google.<138>com. + IN NS 71542 <16> <155>ns1.<131> + IN NS 71542 <16> <173>ns3.<131> + IN NS 71542 <16> <191>ns2.<131> +additionals: class type ttl labels RR labels + IN A 331816 <155> + IN A 157814 <173> + IN A 157814 <127> + IN A 157814 <191> +udp 172.17.0.10:41266 -> 8.8.8.8:53 +id: 63798 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:41266 +id: 63798 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 282 <12> +authorities: class type ttl labels RR labels + IN NS 157813 <12> <56>ns4.<12> + IN NS 157813 <12> <74>ns1.<12> + IN NS 157813 <12> <92>ns3.<12> + IN NS 157813 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157813 <110> + IN A 331815 <74> + IN A 157813 <92> + IN A 157813 <56> +udp 172.17.0.10:34607 -> 8.8.8.8:53 +id: 8470 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:34607 +id: 8470 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72058 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72058 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71541 <16> <127>ns1.<131>google.<138>com. + IN NS 71541 <16> <155>ns2.<131> + IN NS 71541 <16> <173>ns4.<131> + IN NS 71541 <16> <191>ns3.<131> +additionals: class type ttl labels RR labels + IN A 331815 <127> + IN A 157813 <191> + IN A 157813 <173> + IN A 157813 <155> +udp 172.17.0.10:60437 -> 8.8.8.8:53 +id: 60258 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:60437 +id: 60258 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 281 <12> +authorities: class type ttl labels RR labels + IN NS 157812 <12> <56>ns3.<12> + IN NS 157812 <12> <74>ns2.<12> + IN NS 157812 <12> <92>ns4.<12> + IN NS 157812 <12> <110>ns1.<12> +additionals: class type ttl labels RR labels + IN A 157812 <74> + IN A 331814 <110> + IN A 157812 <56> + IN A 157812 <92> +udp 172.17.0.10:37149 -> 8.8.8.8:53 +id: 44985 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:37149 +id: 44985 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72057 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72057 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71540 <16> <127>ns4.<131>google.<138>com. + IN NS 71540 <16> <155>ns3.<131> + IN NS 71540 <16> <173>ns1.<131> + IN NS 71540 <16> <191>ns2.<131> +additionals: class type ttl labels RR labels + IN A 331814 <173> + IN A 157812 <155> + IN A 157812 <127> + IN A 157812 <191> +udp 172.17.0.10:53820 -> 8.8.8.8:53 +id: 45512 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:53820 +id: 45512 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 280 <12> +authorities: class type ttl labels RR labels + IN NS 157811 <12> <56>ns3.<12> + IN NS 157811 <12> <74>ns4.<12> + IN NS 157811 <12> <92>ns1.<12> + IN NS 157811 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157811 <110> + IN A 331813 <92> + IN A 157811 <56> + IN A 157811 <74> +udp 172.17.0.10:52368 -> 8.8.8.8:53 +id: 22980 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:52368 +id: 22980 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72056 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72056 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71539 <16> <127>ns2.<131>google.<138>com. + IN NS 71539 <16> <155>ns3.<131> + IN NS 71539 <16> <173>ns4.<131> + IN NS 71539 <16> <191>ns1.<131> +additionals: class type ttl labels RR labels + IN A 331813 <191> + IN A 157811 <155> + IN A 157811 <173> + IN A 157811 <127> +udp 172.17.0.10:47637 -> 8.8.8.8:53 +id: 1834 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:47637 +id: 1834 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 279 <12> +authorities: class type ttl labels RR labels + IN NS 157810 <12> <56>ns1.<12> + IN NS 157810 <12> <74>ns2.<12> + IN NS 157810 <12> <92>ns4.<12> + IN NS 157810 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157810 <74> + IN A 331812 <56> + IN A 157810 <110> + IN A 157810 <92> +udp 172.17.0.10:34426 -> 8.8.8.8:53 +id: 25431 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:34426 +id: 25431 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72055 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72055 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71538 <16> <127>ns1.<131>google.<138>com. + IN NS 71538 <16> <155>ns4.<131> + IN NS 71538 <16> <173>ns3.<131> + IN NS 71538 <16> <191>ns2.<131> +additionals: class type ttl labels RR labels + IN A 331812 <127> + IN A 157810 <173> + IN A 157810 <155> + IN A 157810 <191> +udp 172.17.0.10:41059 -> 8.8.8.8:53 +id: 48432 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:41059 +id: 48432 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 278 <12> +authorities: class type ttl labels RR labels + IN NS 157809 <12> <56>ns3.<12> + IN NS 157809 <12> <74>ns4.<12> + IN NS 157809 <12> <92>ns2.<12> + IN NS 157809 <12> <110>ns1.<12> +additionals: class type ttl labels RR labels + IN A 157809 <92> + IN A 331811 <110> + IN A 157809 <56> + IN A 157809 <74> +udp 172.17.0.10:51181 -> 8.8.8.8:53 +id: 47411 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:51181 +id: 47411 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72054 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72054 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71537 <16> <127>ns2.<131>google.<138>com. + IN NS 71537 <16> <155>ns1.<131> + IN NS 71537 <16> <173>ns3.<131> + IN NS 71537 <16> <191>ns4.<131> +additionals: class type ttl labels RR labels + IN A 331811 <155> + IN A 157809 <173> + IN A 157809 <191> + IN A 157809 <127> +udp 172.17.0.10:32976 -> 8.8.8.8:53 +id: 12038 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:32976 +id: 12038 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 277 <12> +authorities: class type ttl labels RR labels + IN NS 157808 <12> <56>ns2.<12> + IN NS 157808 <12> <74>ns3.<12> + IN NS 157808 <12> <92>ns1.<12> + IN NS 157808 <12> <110>ns4.<12> +additionals: class type ttl labels RR labels + IN A 157808 <56> + IN A 331810 <92> + IN A 157808 <74> + IN A 157808 <110> +udp 172.17.0.10:53467 -> 8.8.8.8:53 +id: 11614 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:53467 +id: 11614 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 275 <12> +authorities: class type ttl labels RR labels + IN NS 157806 <12> <56>ns3.<12> + IN NS 157806 <12> <74>ns1.<12> + IN NS 157806 <12> <92>ns4.<12> + IN NS 157806 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157806 <110> + IN A 331808 <74> + IN A 157806 <56> + IN A 157806 <92> +udp 172.17.0.10:41532 -> 8.8.8.8:53 +id: 59173 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:41532 +id: 59173 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 273 <12> +authorities: class type ttl labels RR labels + IN NS 157804 <12> <56>ns1.<12> + IN NS 157804 <12> <74>ns3.<12> + IN NS 157804 <12> <92>ns2.<12> + IN NS 157804 <12> <110>ns4.<12> +additionals: class type ttl labels RR labels + IN A 157804 <92> + IN A 331806 <56> + IN A 157804 <74> + IN A 157804 <110> +udp 172.17.0.10:44982 -> 8.8.8.8:53 +id: 45535 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:44982 +id: 45535 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 271 <12> +authorities: class type ttl labels RR labels + IN NS 157802 <12> <56>ns4.<12> + IN NS 157802 <12> <74>ns2.<12> + IN NS 157802 <12> <92>ns1.<12> + IN NS 157802 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157802 <74> + IN A 331804 <92> + IN A 157802 <110> + IN A 157802 <56> +udp 172.17.0.10:40224 -> 8.8.8.8:53 +id: 60808 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:40224 +id: 60808 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72047 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72047 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71530 <16> <127>ns3.<131>google.<138>com. + IN NS 71530 <16> <155>ns4.<131> + IN NS 71530 <16> <173>ns2.<131> + IN NS 71530 <16> <191>ns1.<131> +additionals: class type ttl labels RR labels + IN A 331804 <191> + IN A 157802 <127> + IN A 157802 <155> + IN A 157802 <173> +udp 172.17.0.10:45658 -> 8.8.8.8:53 +id: 64325 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:45658 +id: 64325 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 270 <12> +authorities: class type ttl labels RR labels + IN NS 157801 <12> <56>ns1.<12> + IN NS 157801 <12> <74>ns3.<12> + IN NS 157801 <12> <92>ns4.<12> + IN NS 157801 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157801 <110> + IN A 331803 <56> + IN A 157801 <74> + IN A 157801 <92> +udp 172.17.0.10:60457 -> 8.8.8.8:53 +id: 25543 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:60457 +id: 25543 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72046 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72046 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71529 <16> <127>ns2.<131>google.<138>com. + IN NS 71529 <16> <155>ns3.<131> + IN NS 71529 <16> <173>ns4.<131> + IN NS 71529 <16> <191>ns1.<131> +additionals: class type ttl labels RR labels + IN A 331803 <191> + IN A 157801 <155> + IN A 157801 <173> + IN A 157801 <127> +udp 172.17.0.10:59762 -> 8.8.8.8:53 +id: 20736 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:59762 +id: 20736 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 269 <12> +authorities: class type ttl labels RR labels + IN NS 157800 <12> <56>ns3.<12> + IN NS 157800 <12> <74>ns1.<12> + IN NS 157800 <12> <92>ns4.<12> + IN NS 157800 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157800 <110> + IN A 331802 <74> + IN A 157800 <56> + IN A 157800 <92> +udp 172.17.0.10:56022 -> 8.8.8.8:53 +id: 25911 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:56022 +id: 25911 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72045 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72045 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71528 <16> <127>ns1.<131>google.<138>com. + IN NS 71528 <16> <155>ns4.<131> + IN NS 71528 <16> <173>ns2.<131> + IN NS 71528 <16> <191>ns3.<131> +additionals: class type ttl labels RR labels + IN A 331802 <127> + IN A 157800 <191> + IN A 157800 <155> + IN A 157800 <173> +udp 172.17.0.10:37669 -> 8.8.8.8:53 +id: 64358 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:37669 +id: 64358 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 268 <12> +authorities: class type ttl labels RR labels + IN NS 157799 <12> <56>ns2.<12> + IN NS 157799 <12> <74>ns1.<12> + IN NS 157799 <12> <92>ns4.<12> + IN NS 157799 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157799 <56> + IN A 331801 <74> + IN A 157799 <110> + IN A 157799 <92> +udp 172.17.0.10:42978 -> 8.8.8.8:53 +id: 37698 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:42978 +id: 37698 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72044 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72044 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71527 <16> <127>ns1.<131>google.<138>com. + IN NS 71527 <16> <155>ns4.<131> + IN NS 71527 <16> <173>ns3.<131> + IN NS 71527 <16> <191>ns2.<131> +additionals: class type ttl labels RR labels + IN A 331801 <127> + IN A 157799 <173> + IN A 157799 <155> + IN A 157799 <191> +udp 172.17.0.10:49829 -> 8.8.8.8:53 +id: 54706 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:49829 +id: 54706 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 267 <12> +authorities: class type ttl labels RR labels + IN NS 157798 <12> <56>ns2.<12> + IN NS 157798 <12> <74>ns4.<12> + IN NS 157798 <12> <92>ns3.<12> + IN NS 157798 <12> <110>ns1.<12> +additionals: class type ttl labels RR labels + IN A 157798 <56> + IN A 331800 <110> + IN A 157798 <92> + IN A 157798 <74> +udp 172.17.0.10:50599 -> 8.8.8.8:53 +id: 32142 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:50599 +id: 32142 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72043 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72043 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71526 <16> <127>ns3.<131>google.<138>com. + IN NS 71526 <16> <155>ns1.<131> + IN NS 71526 <16> <173>ns2.<131> + IN NS 71526 <16> <191>ns4.<131> +additionals: class type ttl labels RR labels + IN A 331800 <155> + IN A 157798 <127> + IN A 157798 <191> + IN A 157798 <173> +udp 172.17.0.10:44980 -> 8.8.8.8:53 +id: 41808 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:44980 +id: 41808 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 266 <12> +authorities: class type ttl labels RR labels + IN NS 157797 <12> <56>ns2.<12> + IN NS 157797 <12> <74>ns4.<12> + IN NS 157797 <12> <92>ns1.<12> + IN NS 157797 <12> <110>ns3.<12> +additionals: class type ttl labels RR labels + IN A 157797 <56> + IN A 331799 <92> + IN A 157797 <110> + IN A 157797 <74> +udp 172.17.0.10:60063 -> 8.8.8.8:53 +id: 18886 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:60063 +id: 18886 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72042 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72042 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71525 <16> <127>ns3.<131>google.<138>com. + IN NS 71525 <16> <155>ns1.<131> + IN NS 71525 <16> <173>ns4.<131> + IN NS 71525 <16> <191>ns2.<131> +additionals: class type ttl labels RR labels + IN A 331799 <155> + IN A 157797 <127> + IN A 157797 <173> + IN A 157797 <191> +udp 172.17.0.10:42042 -> 8.8.8.8:53 +id: 10624 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:42042 +id: 10624 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 265 <12> +authorities: class type ttl labels RR labels + IN NS 157796 <12> <56>ns3.<12> + IN NS 157796 <12> <74>ns4.<12> + IN NS 157796 <12> <92>ns1.<12> + IN NS 157796 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157796 <110> + IN A 331798 <92> + IN A 157796 <56> + IN A 157796 <74> +udp 172.17.0.10:60469 -> 8.8.8.8:53 +id: 33139 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:60469 +id: 33139 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72041 <12> <57>dfw06s47-in-f206.<74>1e100.<80>net. + IN PTR 72041 <12> <97>dfw06s47-in-f14.<74> +authorities: class type ttl labels RR labels + IN NS 71524 <16> <127>ns2.<131>google.<138>com. + IN NS 71524 <16> <155>ns4.<131> + IN NS 71524 <16> <173>ns3.<131> + IN NS 71524 <16> <191>ns1.<131> +additionals: class type ttl labels RR labels + IN A 331798 <191> + IN A 157796 <173> + IN A 157796 <155> + IN A 157796 <127> +udp 172.17.0.10:45703 -> 8.8.8.8:53 +id: 61415 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:45703 +id: 61415 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 264 <12> +authorities: class type ttl labels RR labels + IN NS 157795 <12> <56>ns3.<12> + IN NS 157795 <12> <74>ns4.<12> + IN NS 157795 <12> <92>ns2.<12> + IN NS 157795 <12> <110>ns1.<12> +additionals: class type ttl labels RR labels + IN A 157795 <92> + IN A 331797 <110> + IN A 157795 <56> + IN A 157795 <74> +udp 172.17.0.10:33507 -> 8.8.8.8:53 +id: 59258 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +udp 8.8.8.8:53 -> 172.17.0.10:33507 +id: 59258 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 2 + nscount: 4 + arcount: 4 +questions: class type labels + IN PTR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. +answers: class type ttl labels RR labels + IN PTR 72040 <12> <57>dfw06s47-in-f14.<73>1e100.<79>net. + IN PTR 72040 <12> <96>dfw06s47-in-f206.<73> +authorities: class type ttl labels RR labels + IN NS 71523 <16> <127>ns1.<131>google.<138>com. + IN NS 71523 <16> <155>ns4.<131> + IN NS 71523 <16> <173>ns3.<131> + IN NS 71523 <16> <191>ns2.<131> +additionals: class type ttl labels RR labels + IN A 331797 <127> + IN A 157795 <173> + IN A 157795 <155> + IN A 157795 <191> +udp 172.17.0.10:46798 -> 8.8.8.8:53 +id: 17700 + qr: 0 + opcode: QUERY + flags: RD + rcode: NOERROR + qdcount: 1 + ancount: 0 + nscount: 0 + arcount: 0 +questions: class type labels + IN A <12>google.<19>com. +udp 8.8.8.8:53 -> 172.17.0.10:46798 +id: 17700 + qr: 1 + opcode: QUERY + flags: RD RA + rcode: NOERROR + qdcount: 1 + ancount: 1 + nscount: 4 + arcount: 4 +questions: class type labels + IN A <12>google.<19>com. +answers: class type ttl labels RR labels + IN A 263 <12> +authorities: class type ttl labels RR labels + IN NS 157794 <12> <56>ns1.<12> + IN NS 157794 <12> <74>ns4.<12> + IN NS 157794 <12> <92>ns3.<12> + IN NS 157794 <12> <110>ns2.<12> +additionals: class type ttl labels RR labels + IN A 157794 <110> + IN A 331796 <56> + IN A 157794 <92> + IN A 157794 <74> diff --git a/src/test/test1.sh b/src/test/test1.sh new file mode 100755 index 0000000..42bc635 --- /dev/null +++ b/src/test/test1.sh @@ -0,0 +1,21 @@ +#!/bin/sh -e +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/../../examples/dumpdns.lua" dns.pcap-dist >test1.out +diff "$srcdir/test1.gold" test1.out diff --git a/src/test/test2.gold b/src/test/test2.gold new file mode 100644 index 0000000..2fb62b0 --- /dev/null +++ b/src/test/test2.gold @@ -0,0 +1,42 @@ +src dst id rcode qname qtype +172.17.0.10 8.8.8.8 59311 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 35665 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 5337 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 22982 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 18718 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 22531 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 58510 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 45248 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 49483 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 31669 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 25433 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 63798 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 8470 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 60258 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 44985 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 45512 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 22980 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 1834 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 25431 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 48432 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 47411 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 12038 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 11614 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 59173 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 45535 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 60808 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 64325 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 25543 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 20736 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 25911 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 64358 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 37698 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 54706 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 32142 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 41808 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 18886 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 10624 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 33139 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 61415 NOERROR <12>google.<19>com. A +172.17.0.10 8.8.8.8 59258 NOERROR <12>206.<16>218.<20>58.<23>216.<27>in-addr.<35>arpa. PTR +172.17.0.10 8.8.8.8 17700 NOERROR <12>google.<19>com. A diff --git a/src/test/test2.sh b/src/test/test2.sh new file mode 100755 index 0000000..9a58d06 --- /dev/null +++ b/src/test/test2.sh @@ -0,0 +1,21 @@ +#!/bin/sh -e +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/../../examples/dumpdns-qr.lua" dns.pcap-dist >test2.out +diff "$srcdir/test2.gold" test2.out diff --git a/src/test/test3.gold b/src/test/test3.gold new file mode 100644 index 0000000..cdbd0bf --- /dev/null +++ b/src/test/test3.gold @@ -0,0 +1,82 @@ +59311 172.17.0.10 -> 8.8.8.8 +59311 8.8.8.8 -> 172.17.0.10 +35665 172.17.0.10 -> 8.8.8.8 +35665 8.8.8.8 -> 172.17.0.10 +5337 172.17.0.10 -> 8.8.8.8 +5337 8.8.8.8 -> 172.17.0.10 +22982 172.17.0.10 -> 8.8.8.8 +22982 8.8.8.8 -> 172.17.0.10 +18718 172.17.0.10 -> 8.8.8.8 +18718 8.8.8.8 -> 172.17.0.10 +22531 172.17.0.10 -> 8.8.8.8 +22531 8.8.8.8 -> 172.17.0.10 +58510 172.17.0.10 -> 8.8.8.8 +58510 8.8.8.8 -> 172.17.0.10 +45248 172.17.0.10 -> 8.8.8.8 +45248 8.8.8.8 -> 172.17.0.10 +49483 172.17.0.10 -> 8.8.8.8 +49483 8.8.8.8 -> 172.17.0.10 +31669 172.17.0.10 -> 8.8.8.8 +31669 8.8.8.8 -> 172.17.0.10 +25433 172.17.0.10 -> 8.8.8.8 +25433 8.8.8.8 -> 172.17.0.10 +63798 172.17.0.10 -> 8.8.8.8 +63798 8.8.8.8 -> 172.17.0.10 +8470 172.17.0.10 -> 8.8.8.8 +8470 8.8.8.8 -> 172.17.0.10 +60258 172.17.0.10 -> 8.8.8.8 +60258 8.8.8.8 -> 172.17.0.10 +44985 172.17.0.10 -> 8.8.8.8 +44985 8.8.8.8 -> 172.17.0.10 +45512 172.17.0.10 -> 8.8.8.8 +45512 8.8.8.8 -> 172.17.0.10 +22980 172.17.0.10 -> 8.8.8.8 +22980 8.8.8.8 -> 172.17.0.10 +1834 172.17.0.10 -> 8.8.8.8 +1834 8.8.8.8 -> 172.17.0.10 +25431 172.17.0.10 -> 8.8.8.8 +25431 8.8.8.8 -> 172.17.0.10 +48432 172.17.0.10 -> 8.8.8.8 +48432 8.8.8.8 -> 172.17.0.10 +47411 172.17.0.10 -> 8.8.8.8 +47411 8.8.8.8 -> 172.17.0.10 +12038 172.17.0.10 -> 8.8.8.8 +12038 8.8.8.8 -> 172.17.0.10 +11614 172.17.0.10 -> 8.8.8.8 +11614 8.8.8.8 -> 172.17.0.10 +59173 172.17.0.10 -> 8.8.8.8 +59173 8.8.8.8 -> 172.17.0.10 +45535 172.17.0.10 -> 8.8.8.8 +45535 8.8.8.8 -> 172.17.0.10 +60808 172.17.0.10 -> 8.8.8.8 +60808 8.8.8.8 -> 172.17.0.10 +64325 172.17.0.10 -> 8.8.8.8 +64325 8.8.8.8 -> 172.17.0.10 +25543 172.17.0.10 -> 8.8.8.8 +25543 8.8.8.8 -> 172.17.0.10 +20736 172.17.0.10 -> 8.8.8.8 +20736 8.8.8.8 -> 172.17.0.10 +25911 172.17.0.10 -> 8.8.8.8 +25911 8.8.8.8 -> 172.17.0.10 +64358 172.17.0.10 -> 8.8.8.8 +64358 8.8.8.8 -> 172.17.0.10 +37698 172.17.0.10 -> 8.8.8.8 +37698 8.8.8.8 -> 172.17.0.10 +54706 172.17.0.10 -> 8.8.8.8 +54706 8.8.8.8 -> 172.17.0.10 +32142 172.17.0.10 -> 8.8.8.8 +32142 8.8.8.8 -> 172.17.0.10 +41808 172.17.0.10 -> 8.8.8.8 +41808 8.8.8.8 -> 172.17.0.10 +18886 172.17.0.10 -> 8.8.8.8 +18886 8.8.8.8 -> 172.17.0.10 +10624 172.17.0.10 -> 8.8.8.8 +10624 8.8.8.8 -> 172.17.0.10 +33139 172.17.0.10 -> 8.8.8.8 +33139 8.8.8.8 -> 172.17.0.10 +61415 172.17.0.10 -> 8.8.8.8 +61415 8.8.8.8 -> 172.17.0.10 +59258 172.17.0.10 -> 8.8.8.8 +59258 8.8.8.8 -> 172.17.0.10 +17700 172.17.0.10 -> 8.8.8.8 +17700 8.8.8.8 -> 172.17.0.10 diff --git a/src/test/test3.sh b/src/test/test3.sh new file mode 100755 index 0000000..b9a0b64 --- /dev/null +++ b/src/test/test3.sh @@ -0,0 +1,22 @@ +#!/bin/sh -e +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/../../examples/filter_rcode.lua" dns.pcap-dist 0 >test3.out +../dnsjit "$srcdir/../../examples/filter_rcode.lua" dns.pcap-dist 1 >>test3.out +diff "$srcdir/test3.gold" test3.out diff --git a/src/test/test4.gold b/src/test/test4.gold new file mode 100644 index 0000000..f56e464 --- /dev/null +++ b/src/test/test4.gold @@ -0,0 +1,82 @@ +59311 +59311 +35665 +35665 +5337 +5337 +22982 +22982 +18718 +18718 +22531 +22531 +58510 +58510 +45248 +45248 +49483 +49483 +31669 +31669 +25433 +25433 +63798 +63798 +8470 +8470 +60258 +60258 +44985 +44985 +45512 +45512 +22980 +22980 +1834 +1834 +25431 +25431 +48432 +48432 +47411 +47411 +12038 +12038 +11614 +11614 +59173 +59173 +45535 +45535 +60808 +60808 +64325 +64325 +25543 +25543 +20736 +20736 +25911 +25911 +64358 +64358 +37698 +37698 +54706 +54706 +32142 +32142 +41808 +41808 +18886 +18886 +10624 +10624 +33139 +33139 +61415 +61415 +59258 +59258 +17700 +17700 diff --git a/src/test/test4.sh b/src/test/test4.sh new file mode 100755 index 0000000..b2d060d --- /dev/null +++ b/src/test/test4.sh @@ -0,0 +1,21 @@ +#!/bin/sh -e +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/../../examples/readme.lua" dns.pcap-dist >test4.out +diff "$srcdir/test4.gold" test4.out diff --git a/src/test/test5.sh b/src/test/test5.sh new file mode 100755 index 0000000..f766e00 --- /dev/null +++ b/src/test/test5.sh @@ -0,0 +1,24 @@ +#!/bin/sh -e +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/../../examples/test_throughput.lua" -vvvvv -t -s 1000000 +../dnsjit "$srcdir/../../examples/test_pcap_read.lua" -vvvvv dns.pcap-dist +../dnsjit "$srcdir/../../examples/test_pcap_read.lua" -l -vvvvv dns.pcap-dist +../dnsjit "$srcdir/../../examples/test_pcap_read.lua" -p -vvvvv dns.pcap-dist +../dnsjit "$srcdir/../../examples/test_pcap_read.lua" -l -p -vvvvv dns.pcap-dist diff --git a/src/test/test6.sh b/src/test/test6.sh new file mode 100755 index 0000000..67f8e25 --- /dev/null +++ b/src/test/test6.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e +# Copyright (c) 2018-2021, OARC, Inc. +# All rights reserved. +# +# This file is part of dnsjit. +# +# dnsjit is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dnsjit is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dnsjit. If not, see <http://www.gnu.org/licenses/>. + +../dnsjit "$srcdir/../../examples/dumpdns.lua" "$srcdir/dns.pcap" > test6-dns.out +../dnsjit "$srcdir/../../examples/dumpdns2pcap.lua" "$srcdir/dns.pcap" test6-pcap.out +../dnsjit "$srcdir/../../examples/dumpdns.lua" test6-pcap.out > test6-dns2.out +diff test6-dns.out test6-dns2.out diff --git a/src/test/test_base64url.lua b/src/test/test_base64url.lua new file mode 100644 index 0000000..00aea6a --- /dev/null +++ b/src/test/test_base64url.lua @@ -0,0 +1,24 @@ +base64url = require("dnsjit.lib.base64url") +ffi = require("ffi") + +-- empty string works +assert(base64url.decode(base64url.encode("")) == "") + +-- regular string data +assert(base64url.encode("abcd") == "YWJjZA") +assert(base64url.decode(base64url.encode("abcd")) == "abcd") + +-- invalid base64 data +base64url.decode("+") + +-- check all symbols - arbitrary binary data +c_array = ffi.new("uint8_t[?]", 256) +bin_symbols = {} +for i = 0, 255 do + bin_symbols[i + 1] = string.char(i) + c_array[i] = i +end +bin_str = table.concat(bin_symbols) + +assert(base64url.decode(base64url.encode(bin_str)) == bin_str) +assert(base64url.encode(c_array, 256) == base64url.encode(bin_str)) diff --git a/src/test/test_ipsplit.lua b/src/test/test_ipsplit.lua new file mode 100755 index 0000000..43dc8a0 --- /dev/null +++ b/src/test/test_ipsplit.lua @@ -0,0 +1,294 @@ +-- Test cases for dnsjit.filter.ipsplit +-- Some checks that use ip_pkt() assume little-endian machine and will fail otherwise +local ffi = require("ffi") +local object = require("dnsjit.core.objects") +local dns = require("dnsjit.core.object.dns").new() + +local function dns_msgid(obj) + local obj = ffi.cast("core_object_t*", obj) + assert(obj, "obj is nil") + local pl = obj:cast() + assert(obj:type() == "payload" and pl.len > 0, "obj doesn't have payload") + dns.obj_prev = obj + dns:parse_header() + return dns.id +end + +local function ip_pkt(obj) + local obj = ffi.cast("core_object_t*", obj) + assert(obj, "obj is nil") + local pl = obj:cast() + assert(obj:type() == "payload" and pl.len > 0, "obj doesn't have payload") + + local pkt = obj.obj_prev + while pkt ~= nil do + if pkt.obj_type == object.IP or pkt.obj_type == object.IP6 then + return pkt:cast() + end + pkt = pkt.obj_prev + end + assert(pkt, "obj has no ip/ip6 layer") +end + + +----------------------------------------------------- +-- pellets.pcap: client detection +-- +-- All packets have IPv6 layer and are expected to +-- be sucessfully processed by ipsplit filter. +-- Clients should be identified from source ip. +----------------------------------------------------- +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local copy = require("dnsjit.filter.copy").new() +local ipsplit = require("dnsjit.filter.ipsplit").new() +local out1 = require("dnsjit.core.channel").new(256) +local out2 = require("dnsjit.core.channel").new(256) + +input:open_offline("pellets.pcap-dist") +layer:producer(input) +ipsplit:receiver(out1) +ipsplit:receiver(out2) +ipsplit:overwrite_dst() +copy:obj_type(object.IP) +copy:obj_type(object.IP6) +copy:obj_type(object.PAYLOAD) +copy:receiver(ipsplit) + +local prod, pctx = layer:produce() +local recv, rctx = copy:receive() + +-- Process entire PCAP first, channels are large enough to bufer all packets +while true do + local obj = prod(pctx) + if obj == nil then break end + recv(rctx, obj) +end +out1:close() +out2:close() + +assert(ipsplit:discarded() == 0, "some valid packets have been discarded") +assert(out1:size() == 47, "out1: some IPv6 packets lost by filter") +assert(out2:size() == 44, "out2: some IPv6 packets lost by filter") + +-- out1: test individual packets +local i = 0 +while true do + local obj = out1:get() + if obj == nil then break end + i = i + 1 + + 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") + 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") + 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") + 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 +end + +-- out2: test individual packets +local i = 0 +while true do + local obj = out2:get() + if obj == nil then break end + i = i + 1 + + if i == 1 then + assert(dns_msgid(obj) == 0xe6bd, "pkt 2: client 2, pkt 1 -> out2") + assert(ip_pkt(obj):source() == "2001:0db8:beef:feed:0000:0000:0000:0004") + assert(ip_pkt(obj):destination() == "0100:0000:0000:0000:0000:0000:0000:0001") + end + if i == 4 then assert(dns_msgid(obj) == 0xabfe, "pkt 18: client 8, pkt 1 -> out2") end + if i == 5 then assert(dns_msgid(obj) == 0xabff, "pkt 21: client 8, pkt 2 -> out2") end +end + + +----------------------------------------------------- +-- pellets.pcap: weighted ipsplit:sequential() +-- +-- Test sequential client assignment that respects +-- weight. +----------------------------------------------------- +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local copy = require("dnsjit.filter.copy").new() +local ipsplit = require("dnsjit.filter.ipsplit").new() +local out1 = require("dnsjit.core.channel").new(256) +local out2 = require("dnsjit.core.channel").new(256) + +input:open_offline("pellets.pcap-dist") +layer:producer(input) +ipsplit:receiver(out1, 3) +ipsplit:receiver(out2, 2) +copy:obj_type(object.IP) +copy:obj_type(object.IP6) +copy:obj_type(object.PAYLOAD) +copy:receiver(ipsplit) + +local prod, pctx = layer:produce() +local recv, rctx = copy:receive() + +-- Process entire PCAP first, channels are large enough to bufer all packets +while true do + local obj = prod(pctx) + if obj == nil then break end + recv(rctx, obj) +end +out1:close() +out2:close() + +assert(ipsplit:discarded() == 0, "some valid packets have been discarded") +assert(out1:size() + out2:size() == 91, "some IPv6 packets lost by filter") + +-- out1: test individual packets +local i = 0 +while true do + local obj = out1:get() + if obj == nil then break end + i = i + 1 + + 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() == "0000:0000:0000:0000:0000:0000:0000:0001") + end + if i == 2 then assert(dns_msgid(obj) == 0xe6bd, "pkt 2: client 2, pkt 1 -> out1") end + if i == 3 then assert(dns_msgid(obj) == 0xb3e8, "pkt 3: client 3, pkt 1 -> out1") end + if i == 4 then assert(dns_msgid(obj) == 0xb3e9, "pkt 4: client 3, pkt 2 -> out1") end + if i == 5 then assert(dns_msgid(obj) == 0x0a6f, "pkt 9: client 6, pkt 1 -> out1") end +end + +-- out2: test individual packets +local i = 0 +while true do + local obj = out2:get() + if obj == nil then break end + i = i + 1 + + if i == 1 then assert(dns_msgid(obj) == 0xaac6, "pkt 5: client 4, pkt 1 -> out2") end + if i == 2 then assert(dns_msgid(obj) == 0xaea6, "pkt 6: client 5, pkt 1 -> out2") end + if i == 3 then assert(dns_msgid(obj) == 0xaea7, "pkt 7: client 5, pkt 2 -> out2") end +end + +----------------------------------------------------- +-- pellets.pcap: weighted ipsplit:random() +-- +-- Test sequential client assignment that respects +-- weight. +----------------------------------------------------- +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local copy = require("dnsjit.filter.copy").new() +local ipsplit = require("dnsjit.filter.ipsplit").new() +local out1 = require("dnsjit.core.channel").new(256) +local out2 = require("dnsjit.core.channel").new(256) + +input:open_offline("pellets.pcap-dist") +layer:producer(input) +ipsplit:receiver(out1, 85) +ipsplit:receiver(out2, 15) +ipsplit:random() +copy:obj_type(object.IP) +copy:obj_type(object.IP6) +copy:obj_type(object.PAYLOAD) +copy:receiver(ipsplit) + +local prod, pctx = layer:produce() +local recv, rctx = copy:receive() + +-- Process entire PCAP first, channels are large enough to bufer all packets +while true do + local obj = prod(pctx) + if obj == nil then break end + recv(rctx, obj) +end +out1:close() +out2:close() + +assert(ipsplit:discarded() == 0, "some valid packets have been discarded") +assert(out1:size() == 81, "out1: some IPv6 packets lost by filter") +assert(out2:size() == 10, "out2: some IPv6 packets lost by filter") + +-- out1: test individual packets +local i = 0 +while true do + local obj = out1:get() + if obj == nil then break end + i = i + 1 + if i == 1 then assert(dns_msgid(obj) == 0xe6bd, "pkt 1: client 2, pkt 1 -> out1") end + if i == 2 then assert(dns_msgid(obj) == 0xb3e8, "pkt 2: client 3, pkt 1 -> out1") end + if i == 3 then assert(dns_msgid(obj) == 0xb3e9, "pkt 3: client 3, pkt 2 -> out1") end + if i == 5 then assert(dns_msgid(obj) == 0xaea6, "pkt 4: client 5, pkt 1 -> out1") end + if i == 29 then assert(dns_msgid(obj) == 0xaeaf, "pkt 29: client 5, pkt 10 -> out1") end +end + +-- out2: test individual packets +local i = 0 +while true do + local obj = out2:get() + if obj == nil then break end + i = i + 1 + if i == 1 then assert(dns_msgid(obj) == 0x0a31, "pkt 1: client 1, pkt 1 -> out2") end + if i == 2 then assert(dns_msgid(obj) == 0x0a6f, "pkt 2: client 6, pkt 1 -> out2") end + if i == 10 then assert(dns_msgid(obj) == 0x0a70, "pkt 10: client 6, pkt 2 -> out2") end +end + +----------------------------------------------------- +-- Tests with dns.pcap +-- +-- Packets use IPv4 and not all packets have IP layer +----------------------------------------------------- +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local copy = require("dnsjit.filter.copy").new() +local ipsplit = require("dnsjit.filter.ipsplit").new() +local out1 = require("dnsjit.core.channel").new(256) +local out2 = require("dnsjit.core.channel").new(256) + +input:open_offline("dns.pcap-dist") +layer:producer(input) +ipsplit:receiver(out1) +ipsplit:receiver(out2) +ipsplit:overwrite_src() +copy:obj_type(object.IP) +copy:obj_type(object.IP6) +copy:obj_type(object.PAYLOAD) +copy:receiver(ipsplit) + +local prod, pctx = layer:produce() +local recv, rctx = copy:receive() + +-- Process entire PCAP first, channels are large enough to bufer all packets +while true do + local obj = prod(pctx) + if obj == nil then break end + recv(rctx, obj) +end +out1:close() +out2:close() + +assert(out1:size() + out2:size() == 123, "some IPv4 packets lost by filter") + +-- out1: test individual packets +local i = 0 +while true do + local obj = out1:get() + if obj == nil then break end + i = i + 1 + if i == 1 then + assert(dns_msgid(obj) == 0xe7af) + assert(ip_pkt(obj):source() == "1.0.0.0") + assert(ip_pkt(obj):destination() == "8.8.8.8") + end +end diff --git a/src/test/test_trie.lua b/src/test/test_trie.lua new file mode 100755 index 0000000..ddaccdf --- /dev/null +++ b/src/test/test_trie.lua @@ -0,0 +1,134 @@ +-- Test cases for dnsjit.lib.trie + +local function key_compare(node1, node2) + local key1, keylen1 = node1:key() + local key2, keylen2 = node2:key() + if keylen1 ~= keylen2 then return false end + for i = 0, keylen1 - 1 do + if key1[i] ~= key2[i] then return false end + end + return true +end + +----------------------------------------------------- +-- binary-key trie with which stores numbers +----------------------------------------------------- +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local object = require("dnsjit.core.objects") +local ip = require("dnsjit.lib.ip") +local trie = require("dnsjit.lib.trie").new("uint32_t", true, 16) + +input:open_offline("pellets.pcap-dist") +layer:producer(input) + +local prod, pctx = layer:produce() + +-- fill trie with values +while true do + local obj = prod(pctx) + if obj == nil then break end + local pkt = obj:cast_to(object.IP6) + + if pkt ~= nil then + -- count number of packets per IP + local node = trie:get_ins(pkt.src) + node:set(node:get() + 1) + end +end + +assert(trie:weight() == 29) + +-- test iterator and check values +local iter = trie:iter() +local node = iter:node() +local npkts = 0 + +local i = 0 +while node ~= nil do + i = i + 1 + local ip6str = ip.tostring(node:key()) + local val = tonumber(node:get()) + npkts = npkts + val + + if i == 1 then assert(ip6str == "2001:0db8:beef:feed:0000:0000:0000:0003" and val == 1) end + if i == 1 then + local first = trie:get_first() + assert(key_compare(node, first)) + assert(node:get() == first:get()) + end + if i == 2 then assert(ip6str == "2001:0db8:beef:feed:0000:0000:0000:0004" and val == 1) end + if i == 2 then + local second = trie:get_try(node:key()) + assert(key_compare(node, second)) + assert(node:get() == second:get()) + end + if i == 5 then assert(ip6str == "2001:0db8:beef:feed:0000:0000:0000:0008" and val == 10) end + if i == 29 then assert(ip6str == "2001:0db8:beef:feed:0000:0000:0000:0042" and val == 1) end + + iter:next() + node = iter:node() +end + +assert(npkts == 91) + +trie:clear() +assert(trie:weight() == 0) + + +----------------------------------------------------- +-- string-key trie with which stores objects +----------------------------------------------------- +local input = require("dnsjit.input.pcap").new() +local layer = require("dnsjit.filter.layer").new() +local object = require("dnsjit.core.objects") +local trie = require("dnsjit.lib.trie").new("core_object_t*") + +input:open_offline("dns.pcap-dist") +layer:producer(input) + +local prod, pctx = layer:produce() + +-- fill trie with values +while true do + local obj = prod(pctx) + if obj == nil then break end + local pkt = obj:cast_to(object.IP) + + if pkt ~= nil then + local node = trie:get_ins(pkt:source()) + local pkt2 = node:get() + if val ~= nil then + val:free() + end + node:set(pkt:copy():uncast()) + end +end + +assert(trie:weight() == 3) + +local node +node = trie:get_first() +assert(node:key() == "172.17.0.10") +pkt = node:get():cast() +assert(pkt:source() == "172.17.0.10") +assert(pkt.id == 0x538b) +pkt:free() + +node = trie:get_try("8.8.8.8") +assert(node:key() == "8.8.8.8") +pkt = node:get():cast() +assert(pkt:source() == "8.8.8.8") +pkt:free() + +node = trie:get_try("216.58.218.206") +assert(node:key() == "216.58.218.206") +pkt = node:get():cast() +assert(pkt:source() == "216.58.218.206") +pkt:free() + +node = trie:get_try("nonexistent") +assert(node == nil) + +trie:clear() +assert(trie:weight() == 0) |