#
decode-proto f6 ab 01 20 00 01 00 00 00 00 00 01 00 00 06 00 01 00 00 29 10 00 00 00 00 00 00 0c 00 0a 00 08 36 bf 11 1f ef 2e 01 09
-match Header = { ID = 63147, Query = ::Query, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = no, Reserved = no, Authentic-Data = yes, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 1, Answer-Count = 0, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 0, Type.Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109 } } } }
+match Header = { ID = 63147, Query = ::Query, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = no, Reserved = no, Authentic-Data = yes, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 1, Answer-Count = 0, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 0, Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109 } } } }
encode-proto -
match f6 ab 01 20 00 01 00 00 00 00 00 01 00 00 06 00 01 00 00 29 10 00 00 00 00 00 00 0c 00 0a 00 08 36 bf 11 1f ef 2e 01 09
# | | optdata = '6\xbf\x11\x1f\xef.\x01\t}\x8f\xfe\x06\\co\xfb\x14-vt\x94@zs'
#
decode-proto f6 ab 81 87 00 01 00 00 00 00 00 01 00 00 06 00 01 00 00 29 10 00 01 00 00 00 00 1c 00 0a 00 18 36 bf 11 1f ef 2e 01 09 7d 8f fe 06 5c 63 6f fb 14 2d 76 74 94 40 7a 73
-match Header = { ID = 63147, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = yes, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::YX-Resource-Record-Set, Question-Count = 1, Answer-Count = 0, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 16777216, Type.Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109, Server = 0x7d8ffe065c636ffb142d767494407a73 } } } }
+match Header = { ID = 63147, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = yes, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::YX-Resource-Record-Set, Question-Count = 1, Answer-Count = 0, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 16777216, Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109, Server = 0x7d8ffe065c636ffb142d767494407a73 } } } }
encode-proto -
match f6 ab 81 87 00 01 00 00 00 00 00 01 00 00 06 00 01 00 00 29 10 00 01 00 00 00 00 1c 00 0a 00 18 36 bf 11 1f ef 2e 01 09 7d 8f fe 06 5c 63 6f fb 14 2d 76 74 94 40 7a 73
# | | optdata = '6\xbf\x11\x1f\xef.\x01\t}\x8f\xfe\x06\\co\xfb\x14-vt\x94@zs'
#
decode-proto b4 33 01 20 00 01 00 00 00 00 00 01 00 00 06 00 01 00 00 29 10 00 00 00 00 00 00 1c 00 0a 00 18 36 bf 11 1f ef 2e 01 09 7d 8f fe 06 5c 63 6f fb 14 2d 76 74 94 40 7a 73
-match Header = { ID = 46131, Query = ::Query, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = no, Reserved = no, Authentic-Data = yes, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 1, Answer-Count = 0, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 0, Type.Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109, Server = 0x7d8ffe065c636ffb142d767494407a73 } } } }
+match Header = { ID = 46131, Query = ::Query, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = no, Reserved = no, Authentic-Data = yes, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 1, Answer-Count = 0, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 0, Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109, Server = 0x7d8ffe065c636ffb142d767494407a73 } } } }
encode-proto -
match b4 33 01 20 00 01 00 00 00 00 00 01 00 00 06 00 01 00 00 29 10 00 00 00 00 00 00 1c 00 0a 00 18 36 bf 11 1f ef 2e 01 09 7d 8f fe 06 5c 63 6f fb 14 2d 76 74 94 40 7a 73
# | | optdata = '6\xbf\x11\x1f\xef.\x01\t\n/\x9d\xa2\\co\xfbI\xc3[\xb1O\xa4(\xb4'
#
decode-proto b4 33 81 a0 00 01 00 01 00 00 00 01 00 00 06 00 01 00 00 06 00 01 00 01 4e fe 00 40 01 61 0c 72 6f 6f 74 2d 73 65 72 76 65 72 73 03 6e 65 74 00 05 6e 73 74 6c 64 0c 76 65 72 69 73 69 67 6e 2d 67 72 73 03 63 6f 6d 00 78 57 d1 92 00 00 07 08 00 00 03 84 00 09 3a 80 00 01 51 80 00 00 29 10 00 00 00 00 00 00 1c 00 0a 00 18 36 bf 11 1f ef 2e 01 09 0a 2f 9d a2 5c 63 6f fb 49 c3 5b b1 4f a4 28 b4
-match Header = { ID = 46131, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = yes, Reserved = no, Authentic-Data = yes, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 1, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Resource-Record = { Name = ".", Type = ::SOA, Class = ::Internet, TTL = 85758, Type.SOA = { Master-Name = "a.root-servers.net", Responsible-Name = "nstld.verisign-grs.com", Serial = 2019021202, Refresh = 1800, Retry = 900, Expire = 604800, Minimum = 86400 } }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 0, Type.Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109, Server = 0x0a2f9da25c636ffb49c35bb14fa428b4 } } } }
+match Header = { ID = 46131, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = yes, Recursion-Available = yes, Reserved = no, Authentic-Data = yes, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 1, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 1 }, Question = { Name = ".", Type = 6, Class = ::Internet }, Resource-Record = { Name = ".", Type = ::SOA, Class = ::Internet, TTL = 85758, SOA = { Master-Name = "a.root-servers.net", Responsible-Name = "nstld.verisign-grs.com", Serial = 2019021202, Refresh = 1800, Retry = 900, Expire = 604800, Minimum = 86400 } }, Additional-Record = { Name = ".", Type = ::Opt, Class = 4096, TTL = 0, Opt = { Options = { Cookie = { Client = 0x36bf111fef2e0109, Server = 0x0a2f9da25c636ffb49c35bb14fa428b4 } } } }
encode-proto -
match b4 33 81 a0 00 01 00 01 00 00 00 01 00 00 06 00 01 00 00 06 00 01 00 01 4e fe 00 40 01 61 0c 72 6f 6f 74 2d 73 65 72 76 65 72 73 03 6e 65 74 00 05 6e 73 74 6c 64 0c 76 65 72 69 73 69 67 6e 2d 67 72 73 03 63 6f 6d 00 78 57 d1 92 00 00 07 08 00 00 03 84 00 09 3a 80 00 01 51 80 00 00 29 10 00 00 00 00 00 00 1c 00 0a 00 18 36 bf 11 1f ef 2e 01 09 0a 2f 9d a2 5c 63 6f fb 49 c3 5b b1 4f a4 28 b4
# Z type class TTL
decode-proto 00 00 80 00 00 00 00 01 00 00 00 00 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
-match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = ".", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = ".", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }
encode-proto -
match 00 00 80 00 00 00 00 01 00 00 00 00 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
# Really "decode RR".
# Z type class TTL length IPaddr
decode-pair 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
-match Resource-Record = { Name = ".", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+match Resource-Record = { Name = ".", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }
encode-pair -
match 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
#
# And a complex label
#
-encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error, Question-Count = 0, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { ip = 127.0.0.1 } }
+encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error, Question-Count = 0, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, A = { ip = 127.0.0.1 } }
match 00 00 80 00 00 00 00 01 00 00 00 00 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
decode-proto -
-match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 1, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }
#
# Check the encoder can manage counts on its own, and finishes encoding missing count attributes in the header
# This is regession test for the struct encoder, which would stop encoding if count attributes weren't explicitly
# provided resulting in a malformed header.
#
-encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { ip = 127.0.0.1 } }
+encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, A = { ip = 127.0.0.1 } }
match 00 00 80 00 00 00 00 01 00 00 00 00 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
#
# multiple labels (2)
#
-encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error, Question-Count = 0, Answer-Count = 2, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error, Question-Count = 0, Answer-Count = 2, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = A, Class = Internet, TTL = 16, A = { IP = 127.0.0.1 } }
match 00 00 80 00 00 00 00 02 00 00 00 00 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01 03 66 74 70 c0 10 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
#
# and then "ftp" with a pointer c010 to "example.com"
#
decode-proto -
-match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 2, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 2, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }
#
# multiple labels (3), but with all counts removed. The counts will
# about every bit of RFC correctness here, we just care to test the
# encoders and decoders for formatting.
#
-encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error, Question-Count = 0, Answer-Count = 3, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ns.example.com", Type = A, Class = Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+encode-proto Header = { ID = 0, Query = Response, Opcode = Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = No-Error, Question-Count = 0, Answer-Count = 3, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = A, Class = Internet, TTL = 16, A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = A, Class = Internet, TTL = 16, A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ns.example.com", Type = A, Class = Internet, TTL = 16, A = { IP = 127.0.0.1 } }
match 00 00 80 00 00 00 00 03 00 00 00 00 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 00 00 00 10 00 04 7f 00 00 01 03 66 74 70 c0 10 00 01 00 01 00 00 00 10 00 04 7f 00 00 01 02 6e 73 c0 10 00 01 00 01 00 00 00 10 00 04 7f 00 00 01
#
# and then "ftp" with a pointer c010 to "example.com"
#
decode-proto -
-match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 3, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ns.example.com", Type = ::A, Class = ::Internet, TTL = 16, Type.A = { IP = 127.0.0.1 } }
+match Header = { ID = 0, Query = ::Response, Opcode = ::Query, Authoritative = no, Truncated-Response = no, Recursion-Desired = no, Recursion-Available = no, Reserved = no, Authentic-Data = no, Checking-Disabled = no, Rcode = ::No-Error, Question-Count = 0, Answer-Count = 3, Name-Server-Count = 0, Additional-Records-Count = 0 }, Resource-Record = { Name = "www.example.com", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ftp.example.com", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }, Resource-Record = { Name = "ns.example.com", Type = ::A, Class = ::Internet, TTL = 16, A = { IP = 127.0.0.1 } }
count
match 25