-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement the NAPTR record * implement NAPTR record for readme * update * Update index.js * Update index.js * Update index.js * fix test failed * Add actual example values to README * Update README.md * Update README.md --------- Co-authored-by: root <[email protected]> Co-authored-by: silverwind <[email protected]>
- Loading branch information
1 parent
31d3caf
commit aca1ff7
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,6 +366,22 @@ The options `PADDING`, `CLIENT_SUBNET`, `TCP_KEEPALIVE` and `KEY_TAG` support en | |
} | ||
``` | ||
|
||
#### `NAPTR` | ||
|
||
``` js | ||
{ | ||
data: | ||
{ | ||
order: 100, | ||
preference: 10, | ||
flags: 's', | ||
services: 'SIP+D2U', | ||
regexp: '!^.*$!sip:[email protected]!', | ||
replacement: '_sip._udp.example.com' | ||
} | ||
} | ||
``` | ||
|
||
When encoding, scalar values are converted to an array and strings are converted to UTF-8 encoded Buffers. When decoding, the return value will always be an array of Buffer. | ||
|
||
If you need another record type, open an issue and we'll try to add it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -556,6 +556,18 @@ tape('ds', function (t) { | |
t.end() | ||
}) | ||
|
||
tape('naptr', function (t) { | ||
testEncoder(t, packet.naptr, { | ||
order: 1, | ||
preference: 1, | ||
flags: 'S', | ||
services: 'SIP+D2T', | ||
regexp: '!^.*$!sip:[email protected]!', | ||
replacement: '_sip._udp.xuexample.com' | ||
}) | ||
t.end() | ||
}) | ||
|
||
tape('unpack', function (t) { | ||
const buf = Buffer.from([ | ||
0x00, 0x79, | ||
|