doc: document the test/common/dns
module
Added requested documentation for the dns.js module. Also fixed a typo. PR-URL: https://github.com/nodejs/node/pull/15772 Fixes: https://github.com/nodejs/node/issues/15596 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
fa265a2cca
commit
b9f90fd0b4
@ -7,6 +7,7 @@ This directory contains modules used to test the Node.js implementation.
|
|||||||
* [Benchmark module](#benchmark-module)
|
* [Benchmark module](#benchmark-module)
|
||||||
* [Common module API](#common-module-api)
|
* [Common module API](#common-module-api)
|
||||||
* [Countdown module](#countdown-module)
|
* [Countdown module](#countdown-module)
|
||||||
|
* [DNS module](#dns-module)
|
||||||
* [Fixtures module](#fixtures-module)
|
* [Fixtures module](#fixtures-module)
|
||||||
* [WPT module](#wpt-module)
|
* [WPT module](#wpt-module)
|
||||||
|
|
||||||
@ -404,11 +405,54 @@ Creates a new `Countdown` instance.
|
|||||||
|
|
||||||
Decrements the `Countdown` counter.
|
Decrements the `Countdown` counter.
|
||||||
|
|
||||||
### Coutndown.prototype.remaining
|
### Countdown.prototype.remaining
|
||||||
|
|
||||||
Specifies the remaining number of times `Countdown.prototype.dec()` must be
|
Specifies the remaining number of times `Countdown.prototype.dec()` must be
|
||||||
called before the callback is invoked.
|
called before the callback is invoked.
|
||||||
|
|
||||||
|
## DNS Module
|
||||||
|
|
||||||
|
The `DNS` module provides a naïve DNS parser/serializer.
|
||||||
|
|
||||||
|
### readDomainFromPacket(buffer, offset)
|
||||||
|
|
||||||
|
* `buffer` [<Buffer>]
|
||||||
|
* `offset` [<Number>]
|
||||||
|
* return [<Object>]
|
||||||
|
|
||||||
|
Reads the domain string from a packet and returns an object containing the
|
||||||
|
number of bytes read and the domain.
|
||||||
|
|
||||||
|
### parseDNSPacket(buffer)
|
||||||
|
|
||||||
|
* `buffer` [<Buffer>]
|
||||||
|
* return [<Object>]
|
||||||
|
|
||||||
|
Parses a DNS packet. Returns an object with the values of the various flags of
|
||||||
|
the packet depending on the type of packet.
|
||||||
|
|
||||||
|
### writeIPv6(ip)
|
||||||
|
|
||||||
|
* `ip` [<String>]
|
||||||
|
* return [<Buffer>]
|
||||||
|
|
||||||
|
Reads an IPv6 String and returns a Buffer containing the parts.
|
||||||
|
|
||||||
|
### writeDomainName(domain)
|
||||||
|
|
||||||
|
* `domain` [<String>]
|
||||||
|
* return [<Buffer>]
|
||||||
|
|
||||||
|
Reads a Domain String and returns a Buffer containing the domain.
|
||||||
|
|
||||||
|
### writeDNSPacket(parsed)
|
||||||
|
|
||||||
|
* `parsed` [<Object>]
|
||||||
|
* return [<Buffer>]
|
||||||
|
|
||||||
|
Takes in a parsed Object and writes its fields to a DNS packet as a Buffer
|
||||||
|
object.
|
||||||
|
|
||||||
## Fixtures Module
|
## Fixtures Module
|
||||||
|
|
||||||
The `common/fixtures` module provides convenience methods for working with
|
The `common/fixtures` module provides convenience methods for working with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user