def query.labels

bend-kit-dns@0.7.0.0 · dns.bend:78

import bend-kit-dns@0.7.0.0/dns.bend as Dns
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

78# §2.3.4: a name is at most 255 octets in wire form, its final zero octet included.
79def query.labels(+id: U32, +xs: List<&2, String>) -> Maybe<&1, Bytes.Bytes>:
80  query.if(id, xs, Bool.and(labels.ok(xs), U32.is_le(labels.len(xs, 0), 254)))

Uses (10)

Used by (1)