dns
Library
Module
Module type
Parameter
Class
Class type
val digest_alg_to_string : digest_alg -> string
val string_to_digest_alg : string -> digest_alg option
val digest_alg_to_int : digest_alg -> int
val int_to_digest_alg : int -> digest_alg option
Represent a DNSSEC algorithm, with the usual conversion functions.
val dnssec_alg_to_string : dnssec_alg -> string
val string_to_dnssec_alg : string -> dnssec_alg option
val int_to_dnssec_alg : int -> dnssec_alg option
val dnssec_alg_to_int : dnssec_alg -> int
type q_type =
Represent the rr
type, with the usual conversion functions.
val q_type_to_int : q_type -> int
type rr_type =
val string_to_rr_type : string -> rr_type option
val rr_type_to_string : rr_type -> string
val int_to_rr_type : int -> rr_type option
val rr_type_to_int : rr_type -> int
Represent RDATA elements; a variant type to avoid collision with the compact Trie
representation from RR
.
type rdata =
| A of Ipaddr.V4.t |
| AAAA of Ipaddr.V6.t |
| AFSDB of Cstruct.uint16 * Name.t |
| CNAME of Name.t |
| DNSKEY of Cstruct.uint16 * dnssec_alg * string |
| DS of Cstruct.uint16 * dnssec_alg * digest_alg * string |
| HINFO of string * string |
| IPSECKEY of Cstruct.byte * gateway_tc * ipseckey_alg * gateway * string |
| ISDN of string * string option |
| MB of Name.t |
| MD of Name.t |
| MF of Name.t |
| MG of Name.t |
| MINFO of Name.t * Name.t |
| MR of Name.t |
| MX of Cstruct.uint16 * Name.t |
| NS of Name.t |
| NSEC of Name.t * type_bit_maps |
| NSEC3 of hash_alg
* Cstruct.byte
* Cstruct.uint16
* Cstruct.byte
* string
* Cstruct.byte
* string
* type_bit_maps |
| NSEC3PARAM of hash_alg * Cstruct.byte * Cstruct.uint16 * Cstruct.byte * string |
| PTR of Name.t |
| RP of Name.t * Name.t |
| RRSIG of rr_type
* dnssec_alg
* Cstruct.byte
* int32
* int32
* int32
* Cstruct.uint16
* Name.t
* string |
| SIG of dnssec_alg * int32 * int32 * Cstruct.uint16 * Name.t * string |
| RT of Cstruct.uint16 * Name.t |
| SOA of Name.t * Name.t * int32 * int32 * int32 * int32 * int32 |
| SRV of Cstruct.uint16 * Cstruct.uint16 * Cstruct.uint16 * Name.t |
| SSHFP of pubkey_alg * fp_type * string |
| TXT of string list |
| UNKNOWN of int * string |
| WKS of Ipaddr.V4.t * Cstruct.byte * string |
| X25 of string |
| EDNS0 of int * int * bool * (int * string) list |
val rdata_to_string : rdata -> string
val marshal_rdata :
int Name.Map.t ->
?compress:bool ->
int ->
Cstruct.t ->
rdata ->
rr_type * int Name.Map.t * int
Marshal the RR data into the DNS binary format. Raises Not_implemented
if the RR type is known but the logic is not implemented in the library yet.
val parse_rdata :
( int, Name.label ) Hashtbl.t ->
int ->
rr_type ->
int ->
int32 ->
Cstruct.t ->
rdata
Parse an RDATA element from a packet, given the set of already encountered names, a starting index, and the type of the RDATA. Raises Not_implemented
if the RR type is not recognized.
The class of a rr
, and usual conversion functions.
val rr_class_to_string : rr_class -> string
A resource record
, with usual conversion and parsing functions.
val rr_to_string : rr -> string
val marshal_rr :
?compress:bool ->
(int Name.Map.t * int * Cstruct.t) ->
rr ->
int Name.Map.t * int * Cstruct.t
val parse_rr :
( int, Name.label ) Hashtbl.t ->
int ->
Cstruct.t ->
rr * (int * Cstruct.t)
val q_type_to_string : q_type -> string
A question type, with the usual conversion functions.
val string_to_q_type : string -> q_type option
A question class, with the usual conversion functions.
val q_class_to_string : q_class -> string
val string_to_q_class : string -> q_class option
For normal DNS, only Q_Normal is valid. For mDNS, Q_Normal (called QM in RFC 6762) requests a multicast response or Q_mDNS_Unicast (called QU in RFC 6762) requests a unicast response.
val q_unicast_to_string : q_unicast -> string
A question, with the usual conversion functions. Use make_question
if you want to take advantage of default values.
A convenience function to create a question record with default values for q_class (Q_IN) and q_unicast (Q_Normal).
A convenience function to create a question record with default values for q_class (Q_IN) and q_unicast (Q_Normal).
val question_to_string : question -> string
val parse_question :
( int, Name.label ) Hashtbl.t ->
int ->
Cstruct.t ->
question * (int * Cstruct.t)
The qr
field from the DNS header detail
.
A DNS opcode, with the usual conversion functions.
val opcode_to_string : opcode -> string
type rcode =
| NoError |
| FormErr |
| ServFail |
| NXDomain |
| NotImp |
| Refused |
| YXDomain |
| YXRRSet |
| NXRRSet |
| NotAuth |
| NotZone |
| BadVers |
| BadKey |
| BadTime |
| BadMode |
| BadName |
| BadAlg |
A DNS response code, with the usual conversion functions.
val rcode_to_string : rcode -> string
The detail
field from the DNS header, with the usual conversion functions.
type t = {
id : int; |
detail : detail; |
questions : question list; |
answers : rr list; |
authorities : rr list; |
additionals : rr list; |
}
And finally, the DNS packet itself, with conversion functions.
val to_string : t -> string