diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-12-20 13:50:42 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-12-20 13:50:42 +0100 |
commit | 9dc2a544f88ddedea24d16f05170cb90858c3e9a (patch) | |
tree | 08b296c874aaa9780527a27ef9985f15ecc2e2ac /src/main.c | |
parent | 5124da870f85b23ea8e46d48a9cccc38df6323fb (diff) | |
download | dns-9dc2a544f88ddedea24d16f05170cb90858c3e9a.tar.gz |
started rousource record storeage and query
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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); |