aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-03-26 11:04:33 +0700
committerShulhan <ms@kilabit.info>2023-03-26 13:45:53 +0700
commit3fe8e4bcbc3e450a8bc7f35148e5860ce84311da (patch)
treec88122b832b03f5c39e5ec54e89cd8ead5044d2b /lib/dns/testdata
parent5a59307a97dbf4ca0c791dbdc91b472ee1190b48 (diff)
downloadpakakeh.go-3fe8e4bcbc3e450a8bc7f35148e5860ce84311da.tar.xz
lib/dns: fix packing, parsing, and saving MINFO resource data
Even thought the MINFO record not formally obsolete, according to Wikipedia [1], we still need to support this for backward compatibility. When packing the resource data length does not include total length. When parsing, the RMailBox and EmailBox should be added the origin suffix if its not end with dot. When saving, the origin should be trimmed from RMailBox and EmailBox. [1] https://en.wikipedia.org/wiki/List_of_DNS_record_types#Obsolete_record_types
Diffstat (limited to 'lib/dns/testdata')
-rw-r--r--lib/dns/testdata/kilabit.info3
-rw-r--r--lib/dns/testdata/zone/kilabit_info_test.txt18
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/dns/testdata/kilabit.info b/lib/dns/testdata/kilabit.info
index 9c0f7f4e..29cc3814 100644
--- a/lib/dns/testdata/kilabit.info
+++ b/lib/dns/testdata/kilabit.info
@@ -16,4 +16,7 @@
; 13 - HINFO record (obsolete).
@ IN HINFO x86_64 ArchLinux
+; 14 - MINFO record (obsolete).
+ MINFO post-request admin
+
txt_noquote TXT This\032is a text ; Without quote terminated by space.
diff --git a/lib/dns/testdata/zone/kilabit_info_test.txt b/lib/dns/testdata/zone/kilabit_info_test.txt
index 25a1565f..bda556e4 100644
--- a/lib/dns/testdata/zone/kilabit_info_test.txt
+++ b/lib/dns/testdata/zone/kilabit_info_test.txt
@@ -19,6 +19,9 @@ origin: kilabit.info.
; 13 - HINFO record (obsolete).
@ IN HINFO x86_64 ArchLinux
+; 14 - MINFO record (obsolete).
+ MINFO post-request admin
+
txt_noquote TXT This\032is a text ; Without quote terminated by space.
<<< zone_out.txt
@@ -27,6 +30,7 @@ $ORIGIN kilabit.info.
@ 3600 IN A 127.0.0.1
3600 IN TXT "This is a test server"
3600 IN HINFO x86_64 ArchLinux
+ 3600 IN MINFO post-request admin
1.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.ip6.arpa. 3600 IN PTR kilabit.info.
1.0.b.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. 3600 IN PTR kilabit.info.
10.0.0.127.in-addr.arpa. 3600 IN PTR kilabit.info.
@@ -138,6 +142,20 @@ txt_noquote 3600 IN TXT "This is"
0x38| 6e 75 78 | n u x | 110 117 120 |56
<<< message_7.hex
+{Name:kilabit.info. Type:MINFO}
+ | 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7|
+ | 8 9 A B C D E F| 8 9 A B C D E F| 8 9 A B C D E F|
+0x00| 00 00 84 00 00 01 00 01| . . . . . . . .| 0 0 132 0 0 1 0 1|00
+0x08| 00 00 00 00 07 6b 69 6c| . . . . . k i l| 0 0 0 0 7 107 105 108|08
+0x10| 61 62 69 74 04 69 6e 66| a b i t . i n f| 97 98 105 116 4 105 110 102|16
+0x18| 6f 00 00 0e 00 01 c0 0c| o . . . . . . .| 111 0 0 14 0 1 192 12|24
+0x20| 00 0e 00 01 00 00 0e 10| . . . . . . . .| 0 14 0 1 0 0 14 16|32
+0x28| 00 17 0c 70 6f 73 74 2d| . . . p o s t -| 0 23 12 112 111 115 116 45|40
+0x30| 72 65 71 75 65 73 74 c0| r e q u e s t .| 114 101 113 117 101 115 116 192|48
+0x38| 0c 05 61 64 6d 69 6e c0| . . a d m i n .| 12 5 97 100 109 105 110 192|56
+0x40| 0c | . | 12 |64
+
+<<< message_8.hex
{Name:txt_noquote.kilabit.info. Type:TXT}
| 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7| 0 1 2 3 4 5 6 7|
| 8 9 A B C D E F| 8 9 A B C D E F| 8 9 A B C D E F|