/* server.h * (c) Jonas Gunz, 2020 * License: MIT * */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include "dns.h" #include "log.h" #include "database.h" #define UDP_BUFFER_LEN 512 typedef struct server_config { char* bind_ip; uint16_t bind_port; } server_config_t; static int sock_server; int init_socket ( ); void run_dns_server ( server_config_t* _config ); int handle_connection ( int _socket, struct sockaddr_in *sockaddr_client, socklen_t sockaddr_client_len, char* _buffer, int _bufflen, struct database* _zone_db ); void signal_term ( );