Up

module Name

: sig
#
type label

DNS label, including pointer and zero.

#
type domain_name = string list

Domain name, as a list of strings.

#
module Map : Map.S with type key = domain_name

Domain name map

#
val domain_name_to_string : domain_name -> string

Render a domain_name to a simple string.

#
val string_to_domain_name : string -> domain_name

Convert a standard domain string to a domain_name.

#
val for_reverse : Ipaddr.V4.t -> domain_name

Construct name for reverse lookup given an IPv4 address.

#
val parse_name : (int, label) Hashtbl.t -> int -> Cstruct.t -> domain_name * (int * Cstruct.t)

Parse a domain_name out of a Cstruct.t given a set of already observed names from the packet, and the offset we are into the packet.

Returns domain_name and the remainder
#
val marshal_name : ?compress:bool -> int Map.t -> int -> Cstruct.t -> domain_name -> int Map.t * int * Cstruct.t
#
val hashcons_charstring : string -> string Hashcons.hash_consed

Construct a [root:Hashcons] character-string from a string.

#
val hashcons_domainname : domain_name -> domain_name Hashcons.hash_consed

Construct a [root:Hashcons] domain name (list of labels) from a [root: domain_name].

#
val clear_cons_tables : unit -> unit

Clear the [root:Hashcons] tables.

#
exception BadDomainName of string

Malformed input to canon2key.

#
type key = string

Lookup key for the [root:Trie].

#
val canon2key : domain_name -> key

Convert a canonical [ "www"; "example"; "com" ] domain name into a key. N.B. Requires that the input is already lower-case!

#
val dnssec_compare : domain_name -> domain_name -> int
end