This repository has been archived on 2024-05-23. You can view files and clone it, but cannot push or open issues or pull requests.
dns-toy/lib/types.ml

44 lines
660 B
OCaml
Raw Permalink Normal View History

2023-06-19 20:10:00 +02:00
type reader =
{ data : bytes
; pointer : int
}
2023-06-05 20:38:10 +02:00
type dns_header =
{ id : int
; flags : int
; num_questions : int
; num_answers : int
; num_authorities : int
; num_additionals : int
}
type dns_question =
{ name : bytes
; type_ : int
; class_ : int
}
2023-06-14 16:54:55 +02:00
type dns_record =
{ name : bytes
; type_ : int
; class_ : int
; ttl : int
; data : bytes
}
2023-06-19 21:52:39 +02:00
type dns_packet =
{ header : dns_header
; questions : dns_question list
; answers : dns_record list
; authorities : dns_record list
; additionals : dns_record list
}
2023-07-04 10:49:37 +02:00
module DNSType = struct
let a = 1
let ns = 2
2023-07-05 02:14:14 +02:00
let cname = 5
let soa = 6
2023-07-04 10:49:37 +02:00
let txt = 16
end