module

Krikri::PluginHelpers::NsupdateMessage

NsupdateMessage - a minimal RFC2136 dynamic-DNS client (wire format + RFC2845 TSIG signing), the pieces of dnspython that community.general.nsupdate actually drives: SOA queries (zone lookup), standard queries (TTL check), and UPDATE messages with prerequisites (record-exists probes), add/delete RR operations. Pure byte plumbing + response parsing so it is unit-testable without a DNS server; the plugin executes the network I/O.

Constants

CLASS_ANY = 255
CLASS_IN = 1
CLASS_NONE = 254
RCODES = {0 => "NOERROR", 1 => "FORMERR", 2 => "SERVFAIL", 3 => "NXDOMAIN", 4 => "NOTIMP", 5 => "REFUSED", 6 => "YXDOMAIN", 7 => "YXRRSET", 8 => "NXRRSET", 9 => "NOTAUTH", 10 => "NOTZONE", 11 => "DSOTYPENI", 12 => "BADSIG", 13 => "BADKEY", 14 => "BADTIME", 15 => "BADMODE", 16 => "BADNAME", 17 => "BADALG", 18 => "BADTRUNC", 19 => "BADCOOKIE"}

dnspython's dns.rcode.to_text table (the ones a DDNS update flow can realistically see).

TYPE_NAMES = {1 => "A", 2 => "NS", 5 => "CNAME", 6 => "SOA", 12 => "PTR", 15 => "MX", 16 => "TXT", 28 => "AAAA", 33 => "SRV", 255 => "ANY"}
TYPE_TSIG = 250
TYPES = {"A" => 1, "NS" => 2, "CNAME" => 5, "SOA" => 6, "PTR" => 12, "MX" => 15, "TXT" => 16, "AAAA" => 28, "SRV" => 33, "ANY" => 255}

Class methods

build_query(id : UInt16, qname : String, qtype : Int32, tsig : Tsig | Nil) : Bytes

A standard query (opcode QUERY, RD set), optional TSIG in additional.

Source
build_update(id : UInt16, zone : String, prerequisites : Array(RR), updates : Array(RR), tsig : Tsig | Nil) : Bytes

An RFC2136 UPDATE message: zone section, prerequisite RRs (class IN, "must exist" style), update RRs (add: class IN; delete: class NONE).

Source
decode_name(message : Bytes, offset : Int32) : Tuple(String, Int32)

Decodes a name at offset in message, following compression pointers; returns {name (absolute, trailing dot), next_offset}.

Source
encode_name(name : String) : Bytes

Encodes a (possibly relative) dotted name. No escape sequences, no compression.

Source
encode_rdata(type_name : String, value : String) : Bytes
Source
hmac(tsig : Tsig, data : Bytes) : Bytes
Source
names_equal?(a : String, b : String) : Bool

Case-insensitive DNS name equality on label sequences.

Source
parent(name : String) : String | Nil

Drops the leftmost label of an absolute name (dns.name#parent).

Source
parse_response(message : Bytes) : ParsedResponse
Source
prerequisite_present(name : String, type_code : Int32) : RR

"this RRSET exists (independent of rdata)" prerequisite.

Source
prerequisite_present_with(name : String, type_code : Int32, rdata : Bytes) : RR

"RRSET exists with this rdata" prerequisite.

Source
rcode_to_text(rcode : Int32) : String
Source
subdomain_of?(name : String, zone : String) : Bool

True when name is a subdomain of (or equal to) zone.

Source
txt_helper(entry : String) : String

The real module's txt_helper: make sure a TXT value carries quotes so dnspython's character-string parser sees one string.

Source
update_add(name : String, type_code : Int32, ttl : Int32, rdata : Bytes) : RR
Source
update_delete(name : String, type_code : Int32) : RR
Source

Nested types