Expand description
This module contains struct for resource records handling.
The RR enum represents an arbitrary resource record. Each type has a dedicated struct,
which has a variant in the RR enum. For example, the A struct represent an A record.
The Class enum represents the class field of the resource record.
The Type enum represents the type field of the resource record.
Yet there are some missing resource records and types
§Example
use dns_message_parser::rr::{RR, A};
// Init A record
let a = A {
// The domain name of the A record
domain_name: "example.org".parse().unwrap(),
// The time to live of the A record
ttl: 1000,
// The address of the A record
ipv4_addr: "10.0.0.1".parse().unwrap(),
};
// Convert the resource record into a RR
let rr = RR::A(a);
// Encode the A record into bytes::BytesMut
let bytes = rr.encode().unwrap();
// Decode the A record into a RR enum
let rr = RR::decode(bytes.freeze()).unwrap();Modules§
Structs§
- A
- The IPv4 host address resource record type.
- AAAA
- The IPv6 host address resource record type.
- AFSDB
- The AFS Data base location resource record type:
- APItem
- APL
- CAA
- The certification authority authorization resource record type.
- CNAME
- The canonical name resource record type.
- DNAME
- DNSKEY
- DS
- EID
- EUI48
- EUI64
- GPOS
- The geographical location resource record type.
- HINFO
- The host information resource record type.
- ISDN
- The ISDN resource record type.
- ISDN
Address - KX
- The key exchange resource record type.
- L32
- L64
- LOC
- The location information resource record type.
- LP
- MB
- The mailbox domain name resource record type.
- MD
- The mail destination resource record type. (obsolete)
- MF
- The mail forwarder resource record type. (obsolete)
- MG
- The mail group member resource record type.
- MINFO
- The mailbox or mail list information resource record type.
- MR
- The mail rename domain name resource record type.
- MX
- The mail exchange resource record type.
- NID
- NIMLOC
- NS
- The authoritative name server resource record type.
- NSAP
- The NSAP resource record type.
- NULL
- The null type.
- NonEmpty
Vec - OPT
- PSDN
Address - PTR
- The domain name pointer resource record type.
- PX
- The X.400 pointer resource record type.
- RP
- The responsible person resource record type.
- RT
- The route through resource record type.
- SA
- SOA
- The start of a zone of authority resource record type.
- SRV
- The location of services resource record type.
- SSHFP
- Service
Binding - A Service Binding record for locating alternative endpoints for a service.
- TXT
- The text resource record type.
- Tag
- URI
- WKS
- The well known service description resource record type.
- X25
- The X25 resource record type.
Enums§
- AFSDB
Subtype - Address
- Address
Error - Address
Family Number - Algorithm
Type - https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
- Class
- The class field in the resource records.
- Digest
Type - https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml#ds-rr-types-1
- ISDN
Error - PSDN
Address Error - RR
- SSHFP
Algorithm - SSHFP
Type - Service
Binding Mode - The modes inferred from the
SvcPriorityfield - Service
Parameter - TagError
- Type
- The type field in the resource records.
Constants§
- APL_
NEGATION_ MASK - DNSKEY_
ZERO_ MASK - SECURE_
ENTRY_ POINT_ FLAG - The bit at offset 15 of the DNSKEY flags field is the Secure Entry Point flag.
- ZONE_
KEY_ FLAG - The bit at offset 7 of the DNSKEY flags field is the Zone Key flag.