/* server.h * (c) Jonas Gunz, 2020 * License: MIT * */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dns.h" #include "log.h" #include "database.h" #include "zonefile.h" #define UDP_BUFFER_LEN 512 typedef struct server_config { char* bind_ip; uint16_t bind_port; char* zonefile; char* user; } server_config_t; void server_start ( server_config_t* _config ); void server_handle_connection ( int _socket, database_t* _zone_db ); int server_get_socket ( char* _bind_ip, uint16_t _bind_port, sa_family_t _sock ); void signal_term ( int _sig );