@@ -7,6 +7,7 @@ This directory contains modules used to test the Node.js implementation.
7
7
* [ Benchmark module] ( #benchmark-module )
8
8
* [ Common module API] ( #common-module-api )
9
9
* [ Countdown module] ( #countdown-module )
10
+ * [ DNS module] ( #dns-module )
10
11
* [ Fixtures module] ( #fixtures-module )
11
12
* [ WPT module] ( #wpt-module )
12
13
@@ -404,11 +405,54 @@ Creates a new `Countdown` instance.
404
405
405
406
Decrements the ` Countdown ` counter.
406
407
407
- ### Coutndown .prototype.remaining
408
+ ### Countdown .prototype.remaining
408
409
409
410
Specifies the remaining number of times ` Countdown.prototype.dec() ` must be
410
411
called before the callback is invoked.
411
412
413
+ ## DNS Module
414
+
415
+ The ` DNS ` module provides a naïve DNS parser/serializer.
416
+
417
+ ### readDomainFromPacket(buffer, offset)
418
+
419
+ * ` buffer ` [ < ; Buffer>]
420
+ * ` offset ` [ < ; Number>]
421
+ * return [ < ; Object>]
422
+
423
+ Reads the domain string from a packet and returns an object containing the
424
+ number of bytes read and the domain.
425
+
426
+ ### parseDNSPacket(buffer)
427
+
428
+ * ` buffer ` [ < ; Buffer>]
429
+ * return [ < ; Object>]
430
+
431
+ Parses a DNS packet. Returns an object with the values of the various flags of
432
+ the packet depending on the type of packet.
433
+
434
+ ### writeIPv6(ip)
435
+
436
+ * ` ip ` [ < ; String>]
437
+ * return [ < ; Buffer>]
438
+
439
+ Reads an IPv6 String and returns a Buffer containing the parts.
440
+
441
+ ### writeDomainName(domain)
442
+
443
+ * ` domain ` [ < ; String>]
444
+ * return [ < ; Buffer>]
445
+
446
+ Reads a Domain String and returns a Buffer containing the domain.
447
+
448
+ ### writeDNSPacket(parsed)
449
+
450
+ * ` parsed ` [ < ; Object>]
451
+ * return [ < ; Buffer>]
452
+
453
+ Takes in a parsed Object and writes its fields to a DNS packet as a Buffer
454
+ object.
455
+
412
456
## Fixtures Module
413
457
414
458
The ` common/fixtures ` module provides convenience methods for working with
0 commit comments