From 9dc2a544f88ddedea24d16f05170cb90858c3e9a Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 20 Dec 2019 13:50:42 +0100 Subject: started rousource record storeage and query --- src/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 75574a0..ff07c48 100644 --- a/src/main.c +++ b/src/main.c @@ -20,6 +20,8 @@ #include "dns.h" #include "log.h" +#include "zonefile.h" + #define PRINT_ERRNO() {printf("%s:%i %i:%s\n", __FILE__, __LINE__, errno, strerror(errno));} #define UDP_BUFFER_LEN 512 @@ -43,7 +45,10 @@ int main1( int argc, char* argv[] ) { printf("TEST MODE. NOT FUNCTIONAL\n"); - + + printf ("%i\n", string_compare (argv[1], argv[2])); + + return 0; /* //Fuzztest the QNAME checker FILE* urand = fopen ("/dev/urandom", "r"); @@ -185,14 +190,14 @@ int handle_connection ( int _socket, if(msg.question_count > 0) { char out[128]; - qname_to_fqdn( msg.question[0].qname, 100, out, 128); + qname_to_fqdn( (char*) msg.question[0].qname, 100, out, 128); printf("%s %i\n", out, msg.question[0].qtype); } dns_destroy_struct ( &msg ); //Always return NXDOMAIN - struct dns_header head = {msg.header.id,1,OP_Q,0,0,0,0,0,RCODE_NAMEERR,0,0,0,0}; + struct dns_header head = {msg.header.id,1,OP_Q,0,0,0,0,0,NAMEERR,0,0,0,0}; char ret[20]; int retlen = dns_construct_header ( &head, ret, 20 ); sendto (_socket, ret, retlen, 0, (struct sockaddr*) sockaddr_client, sockaddr_client_len); -- cgit v1.2.3