Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dns-packet

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-packet - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

41

index.js

@@ -567,2 +567,42 @@ 'use strict'

const rmx = exports.mx = {}
rmx.encode = function (data, buf, offset) {
if (!buf) buf = Buffer.allocUnsafe(rmx.encodingLength(data))
if (!offset) offset = 0
const oldOffset = offset
offset += 2
buf.writeUInt16BE(data.preference || 0, offset)
offset += 2
name.encode(data.exchange, buf, offset)
offset += name.encode.bytes
buf.writeUInt16BE(offset - oldOffset - 2, oldOffset)
rmx.encode.bytes = offset - oldOffset
return buf
}
rmx.encode.bytes = 0
rmx.decode = function (buf, offset) {
if (!offset) offset = 0
const oldOffset = offset
const data = {}
offset += 2
data.preference = buf.readUInt16BE(offset)
offset += 2
data.exchange = name.decode(buf, offset)
offset += name.decode.bytes
rmx.decode.bytes = offset - oldOffset
return data
}
rmx.encodingLength = function (data) {
return 4 + name.encodingLength(data.exchange)
}
const ra = exports.a = {}

@@ -642,2 +682,3 @@

case 'SOA': return rsoa
case 'MX': return rmx
}

@@ -644,0 +685,0 @@ return runknown

2

package.json
{
"name": "dns-packet",
"version": "4.0.0",
"version": "4.1.0",
"description": "An abstract-encoding compliant module for encoding / decoding DNS packets",

@@ -5,0 +5,0 @@ "author": "Mathias Buus",

@@ -248,2 +248,11 @@ # dns-packet

#### `MX`
``` js
{
preference: 10,
exchange: 'mail.example.net'
}
```
If you need another one, open an issue and we'll try to add it.

@@ -250,0 +259,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc