Debian Codegraph @

zpack.go

raw
1 // Code generated by "go run pack_generate.go"; DO NOT EDIT.
2
3 package dns
4
5 import (
6 "fmt"
7
8 "golang.org/x/crypto/cryptobyte"
9 )
10
11 // zpack calls the pack methods for each RR.
12 func zpack(rr RR, msg []byte, off int, compression map[string]uint16) (int, error) {
13 switch x := rr.(type) {
14 case *TSIG:
15 return x.pack(msg, off, compression)
16 case *DELEG:
17 return x.pack(msg, off, compression)
18 case *OPT:
19 return x.pack(msg, off, compression)
20 case *NSEC3:
21 return x.pack(msg, off, compression)
22 case *DNSKEY:
23 return x.pack(msg, off, compression)
24 case *DS:
25 return x.pack(msg, off, compression)
26 case *NSEC:
27 return x.pack(msg, off, compression)
28 case *RRSIG:
29 return x.pack(msg, off, compression)
30 case *AAAA:
31 return x.pack(msg, off, compression)
32 case *A:
33 return x.pack(msg, off, compression)
34 case *TXT:
35 return x.pack(msg, off, compression)
36 case *NS:
37 return x.pack(msg, off, compression)
38 case *MX:
39 return x.pack(msg, off, compression)
40 case *CNAME:
41 return x.pack(msg, off, compression)
42 case *NULL:
43 return x.pack(msg, off, compression)
44 case *NXNAME:
45 return x.pack(msg, off, compression)
46 case *HINFO:
47 return x.pack(msg, off, compression)
48 case *MB:
49 return x.pack(msg, off, compression)
50 case *MG:
51 return x.pack(msg, off, compression)
52 case *MINFO:
53 return x.pack(msg, off, compression)
54 case *MR:
55 return x.pack(msg, off, compression)
56 case *MF:
57 return x.pack(msg, off, compression)
58 case *MD:
59 return x.pack(msg, off, compression)
60 case *AFSDB:
61 return x.pack(msg, off, compression)
62 case *X25:
63 return x.pack(msg, off, compression)
64 case *ISDN:
65 return x.pack(msg, off, compression)
66 case *RT:
67 return x.pack(msg, off, compression)
68 case *PTR:
69 return x.pack(msg, off, compression)
70 case *RP:
71 return x.pack(msg, off, compression)
72 case *SOA:
73 return x.pack(msg, off, compression)
74 case *SPF:
75 return x.pack(msg, off, compression)
76 case *AVC:
77 return x.pack(msg, off, compression)
78 case *WALLET:
79 return x.pack(msg, off, compression)
80 case *CLA:
81 return x.pack(msg, off, compression)
82 case *IPN:
83 return x.pack(msg, off, compression)
84 case *SRV:
85 return x.pack(msg, off, compression)
86 case *NAPTR:
87 return x.pack(msg, off, compression)
88 case *CERT:
89 return x.pack(msg, off, compression)
90 case *DNAME:
91 return x.pack(msg, off, compression)
92 case *PX:
93 return x.pack(msg, off, compression)
94 case *GPOS:
95 return x.pack(msg, off, compression)
96 case *LOC:
97 return x.pack(msg, off, compression)
98 case *SIG:
99 return x.pack(msg, off, compression)
100 case *NXT:
101 return x.pack(msg, off, compression)
102 case *DLV:
103 return x.pack(msg, off, compression)
104 case *CDS:
105 return x.pack(msg, off, compression)
106 case *KX:
107 return x.pack(msg, off, compression)
108 case *TA:
109 return x.pack(msg, off, compression)
110 case *TALINK:
111 return x.pack(msg, off, compression)
112 case *SSHFP:
113 return x.pack(msg, off, compression)
114 case *KEY:
115 return x.pack(msg, off, compression)
116 case *CDNSKEY:
117 return x.pack(msg, off, compression)
118 case *RKEY:
119 return x.pack(msg, off, compression)
120 case *NSAPPTR:
121 return x.pack(msg, off, compression)
122 case *NSEC3PARAM:
123 return x.pack(msg, off, compression)
124 case *TKEY:
125 return x.pack(msg, off, compression)
126 case *RFC3597:
127 return x.pack(msg, off, compression)
128 case *URI:
129 return x.pack(msg, off, compression)
130 case *DHCID:
131 return x.pack(msg, off, compression)
132 case *TLSA:
133 return x.pack(msg, off, compression)
134 case *SMIMEA:
135 return x.pack(msg, off, compression)
136 case *HIP:
137 return x.pack(msg, off, compression)
138 case *NINFO:
139 return x.pack(msg, off, compression)
140 case *NID:
141 return x.pack(msg, off, compression)
142 case *L32:
143 return x.pack(msg, off, compression)
144 case *L64:
145 return x.pack(msg, off, compression)
146 case *LP:
147 return x.pack(msg, off, compression)
148 case *EUI48:
149 return x.pack(msg, off, compression)
150 case *EUI64:
151 return x.pack(msg, off, compression)
152 case *CAA:
153 return x.pack(msg, off, compression)
154 case *UID:
155 return x.pack(msg, off, compression)
156 case *GID:
157 return x.pack(msg, off, compression)
158 case *UINFO:
159 return x.pack(msg, off, compression)
160 case *EID:
161 return x.pack(msg, off, compression)
162 case *NIMLOC:
163 return x.pack(msg, off, compression)
164 case *OPENPGPKEY:
165 return x.pack(msg, off, compression)
166 case *CSYNC:
167 return x.pack(msg, off, compression)
168 case *ZONEMD:
169 return x.pack(msg, off, compression)
170 case *RESINFO:
171 return x.pack(msg, off, compression)
172 case *SVCB:
173 return x.pack(msg, off, compression)
174 case *HTTPS:
175 return x.pack(msg, off, compression)
176 case *DELEGPARAM:
177 return x.pack(msg, off, compression)
178 case *DSYNC:
179 return x.pack(msg, off, compression)
180 case *ANY:
181 return x.pack(msg, off, compression)
182 case *AXFR:
183 return x.pack(msg, off, compression)
184 case *IXFR:
185 return x.pack(msg, off, compression)
186 }
187 // if here, we don't have the RR in our pkg, check if it does Packer.
188 if x, ok := rr.(Packer); ok {
189 return x.Pack(msg, off)
190 }
191 return 0, fmt.Errorf("dns: no pack defined")
192 }
193
194 // zunpack calls the unpack methods for each RR.
195 func zunpack(rr RR, data cryptobyte.String, msgBuf []byte) error {
196 switch x := rr.(type) {
197 case *TSIG:
198 return x.unpack(data, msgBuf)
199 case *DELEG:
200 return x.unpack(data, msgBuf)
201 case *OPT:
202 return x.unpack(data, msgBuf)
203 case *NSEC3:
204 return x.unpack(data, msgBuf)
205 case *DNSKEY:
206 return x.unpack(data, msgBuf)
207 case *DS:
208 return x.unpack(data, msgBuf)
209 case *NSEC:
210 return x.unpack(data, msgBuf)
211 case *RRSIG:
212 return x.unpack(data, msgBuf)
213 case *AAAA:
214 return x.unpack(data, msgBuf)
215 case *A:
216 return x.unpack(data, msgBuf)
217 case *TXT:
218 return x.unpack(data, msgBuf)
219 case *NS:
220 return x.unpack(data, msgBuf)
221 case *MX:
222 return x.unpack(data, msgBuf)
223 case *CNAME:
224 return x.unpack(data, msgBuf)
225 case *NULL:
226 return x.unpack(data, msgBuf)
227 case *NXNAME:
228 return x.unpack(data, msgBuf)
229 case *HINFO:
230 return x.unpack(data, msgBuf)
231 case *MB:
232 return x.unpack(data, msgBuf)
233 case *MG:
234 return x.unpack(data, msgBuf)
235 case *MINFO:
236 return x.unpack(data, msgBuf)
237 case *MR:
238 return x.unpack(data, msgBuf)
239 case *MF:
240 return x.unpack(data, msgBuf)
241 case *MD:
242 return x.unpack(data, msgBuf)
243 case *AFSDB:
244 return x.unpack(data, msgBuf)
245 case *X25:
246 return x.unpack(data, msgBuf)
247 case *ISDN:
248 return x.unpack(data, msgBuf)
249 case *RT:
250 return x.unpack(data, msgBuf)
251 case *PTR:
252 return x.unpack(data, msgBuf)
253 case *RP:
254 return x.unpack(data, msgBuf)
255 case *SOA:
256 return x.unpack(data, msgBuf)
257 case *SPF:
258 return x.unpack(data, msgBuf)
259 case *AVC:
260 return x.unpack(data, msgBuf)
261 case *WALLET:
262 return x.unpack(data, msgBuf)
263 case *CLA:
264 return x.unpack(data, msgBuf)
265 case *IPN:
266 return x.unpack(data, msgBuf)
267 case *SRV:
268 return x.unpack(data, msgBuf)
269 case *NAPTR:
270 return x.unpack(data, msgBuf)
271 case *CERT:
272 return x.unpack(data, msgBuf)
273 case *DNAME:
274 return x.unpack(data, msgBuf)
275 case *PX:
276 return x.unpack(data, msgBuf)
277 case *GPOS:
278 return x.unpack(data, msgBuf)
279 case *LOC:
280 return x.unpack(data, msgBuf)
281 case *SIG:
282 return x.unpack(data, msgBuf)
283 case *NXT:
284 return x.unpack(data, msgBuf)
285 case *DLV:
286 return x.unpack(data, msgBuf)
287 case *CDS:
288 return x.unpack(data, msgBuf)
289 case *KX:
290 return x.unpack(data, msgBuf)
291 case *TA:
292 return x.unpack(data, msgBuf)
293 case *TALINK:
294 return x.unpack(data, msgBuf)
295 case *SSHFP:
296 return x.unpack(data, msgBuf)
297 case *KEY:
298 return x.unpack(data, msgBuf)
299 case *CDNSKEY:
300 return x.unpack(data, msgBuf)
301 case *RKEY:
302 return x.unpack(data, msgBuf)
303 case *NSAPPTR:
304 return x.unpack(data, msgBuf)
305 case *NSEC3PARAM:
306 return x.unpack(data, msgBuf)
307 case *TKEY:
308 return x.unpack(data, msgBuf)
309 case *RFC3597:
310 return x.unpack(data, msgBuf)
311 case *URI:
312 return x.unpack(data, msgBuf)
313 case *DHCID:
314 return x.unpack(data, msgBuf)
315 case *TLSA:
316 return x.unpack(data, msgBuf)
317 case *SMIMEA:
318 return x.unpack(data, msgBuf)
319 case *HIP:
320 return x.unpack(data, msgBuf)
321 case *NINFO:
322 return x.unpack(data, msgBuf)
323 case *NID:
324 return x.unpack(data, msgBuf)
325 case *L32:
326 return x.unpack(data, msgBuf)
327 case *L64:
328 return x.unpack(data, msgBuf)
329 case *LP:
330 return x.unpack(data, msgBuf)
331 case *EUI48:
332 return x.unpack(data, msgBuf)
333 case *EUI64:
334 return x.unpack(data, msgBuf)
335 case *CAA:
336 return x.unpack(data, msgBuf)
337 case *UID:
338 return x.unpack(data, msgBuf)
339 case *GID:
340 return x.unpack(data, msgBuf)
341 case *UINFO:
342 return x.unpack(data, msgBuf)
343 case *EID:
344 return x.unpack(data, msgBuf)
345 case *NIMLOC:
346 return x.unpack(data, msgBuf)
347 case *OPENPGPKEY:
348 return x.unpack(data, msgBuf)
349 case *CSYNC:
350 return x.unpack(data, msgBuf)
351 case *ZONEMD:
352 return x.unpack(data, msgBuf)
353 case *RESINFO:
354 return x.unpack(data, msgBuf)
355 case *SVCB:
356 return x.unpack(data, msgBuf)
357 case *HTTPS:
358 return x.unpack(data, msgBuf)
359 case *DELEGPARAM:
360 return x.unpack(data, msgBuf)
361 case *DSYNC:
362 return x.unpack(data, msgBuf)
363 case *ANY:
364 return x.unpack(data, msgBuf)
365 case *AXFR:
366 return x.unpack(data, msgBuf)
367 case *IXFR:
368 return x.unpack(data, msgBuf)
369 }
370 // if here, we don't have the RR in our pkg, check if it does Packer.
371 if x, ok := rr.(Packer); ok {
372 return x.Unpack(data)
373 }
374 return fmt.Errorf("dns: no unpack defined")
375 }