43 static const char* xfrh_str =
"xfrhandler";
45 static void xfrhandler_handle_dns(
netio_type* netio,
64 "allocator_alloc() failed", xfrh_str);
88 "netio_create() failed", xfrh_str);
95 "buffer_create() failed", xfrh_str);
102 "tcp_set_create() failed", xfrh_str);
135 if (errno != EINTR) {
178 if (xfrhandler && xfrhandler->
started) {
179 ods_thread_kill(xfrhandler->
thread_id, SIGHUP);
190 xfrhandler_handle_dns(
netio_type* ATTR_UNUSED(netio),
195 ssize_t received = 0;
203 if (received == -1) {
204 ods_log_error(
"[%s] unable to forward dns packet: %s", xfrh_str,
tcp_set_type * tcp_set_create(allocator_type *allocator)
xfrd_type * udp_waiting_first
xfrd_type * udp_waiting_last
void ods_log_debug(const char *format,...)
void tcp_set_cleanup(tcp_set_type *set, allocator_type *allocator)
void * allocator_alloc(allocator_type *allocator, size_t size)
void xfrhandler_cleanup(xfrhandler_type *xfrhandler)
enum netio_events_enum netio_events_type
void ods_log_error(const char *format,...)
netio_handler_type dnshandler
buffer_type * buffer_create(allocator_type *allocator, size_t capacity)
void netio_add_handler(netio_type *netio, netio_handler_type *handler)
time_t xfrhandler_time(xfrhandler_type *xfrhandler)
netio_type * netio_create(allocator_type *allocator)
void xfrhandler_start(xfrhandler_type *xfrhandler)
notify_type * notify_waiting_first
netio_event_handler_type event_handler
notify_type * notify_waiting_last
void xfrhandler_signal(xfrhandler_type *xfrhandler)
#define PACKET_BUFFER_SIZE
xfrhandler_type * xfrhandler_create(allocator_type *allocator)
allocator_type * allocator
netio_events_type event_types
void ods_log_deeebug(const char *format,...)
void allocator_deallocate(allocator_type *allocator, void *data)
void buffer_cleanup(buffer_type *buffer, allocator_type *allocator)
struct timespec * timeout
#define ods_log_assert(x)
ods_thread_type thread_id
int netio_dispatch(netio_type *netio, const struct timespec *timeout, const sigset_t *sigmask)
void netio_cleanup(netio_type *netio)