Module dns_message_parser::rr
source · [−]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
The IPv4 host address resource record type.
The IPv6 host address resource record type.
The AFS Data base location resource record type:
The certification authority authorization resource record type.
The canonical name resource record type.
The geographical location resource record type.
The host information resource record type.
The key exchange resource record type.
The location information resource record type.
The mailbox domain name resource record type.
The mail destination resource record type. (obsolete)
The mail forwarder resource record type. (obsolete)
The mail group member resource record type.
The mailbox or mail list information resource record type.
The mail rename domain name resource record type.
The mail exchange resource record type.
The authoritative name server resource record type.
The domain name pointer resource record type.
The X.400 pointer resource record type.
The responsible person resource record type.
The route through resource record type.
The start of a zone of authority resource record type.
The location of services resource record type.
A Service Binding record for locating alternative endpoints for a service.
The well known service description resource record type.
Enums
https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
The class field in the resource records.
https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml#ds-rr-types-1
The modes inferred from the SvcPriority
field
The type field in the resource records.
Constants
The bit at offset 15 of the DNSKEY flags field is the Secure Entry Point flag.
The bit at offset 7 of the DNSKEY flags field is the Zone Key flag.