From 48589ff6e03adb1c5af3235dacff202fc8bbf6d4 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 4 Jul 2023 10:50:03 +0200 Subject: [PATCH] update debugging tests --- bin/main.ml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index fad8e8d..6772f9e 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1,11 +1,19 @@ open Dnstoy +let print = function + | Some value -> print_endline (Utils.get_bytecode value) + | None -> print_endline "No IP found" +;; + let () = - let response = Network.send_request "8.8.8.8" "www.mylloon.fr" in + let response = Network.send_request "8.8.8.8" "www.mylloon.fr" Types.DNSType.a in print_endline (Utils.get_bytecode response); let dns_packet = Response.parse_dns_packet response in print_endline (Debug.dns_packet dns_packet); - print_endline (Network.lookup_domain "example.com"); - print_endline (Network.lookup_domain "recurse.com"); - print_endline (Network.lookup_domain "www.metafilter.com") + print (Network.lookup_domain "example.com"); + print (Network.lookup_domain "recurse.com"); + print (Network.lookup_domain "www.metafilter.com"); + List.iter + (fun e -> print_endline (Debug.dns_record e)) + (Network.send "8.8.8.8" "example.com" 16).answers ;;