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/bin/main.ml

13 lines
456 B
OCaml
Raw Normal View History

2023-06-11 10:54:58 +02:00
open Dnstoy
let () =
2023-06-14 16:35:14 +02:00
let response = Network.send_request "8.8.8.8" "www.example.com" in
print_endline (Utils.get_bytecode response);
let reader, dns_header = Response.parse_header { data = response; pointer = 0 } in
let reader', dns_question = Response.parse_question reader in
let dns_record = Response.parse_record reader' in
2023-06-14 16:35:14 +02:00
Debug.print_dns_header dns_header;
2023-06-14 16:54:55 +02:00
Debug.print_dns_question dns_question;
Debug.print_dns_record dns_record
2023-06-11 10:54:58 +02:00
;;