41 static const char* xfrh_str =
"xfrhandler";
43 static void xfrhandler_handle_dns(
netio_type* netio,
62 "allocator_alloc() failed", xfrh_str);
87 "netio_create() failed", xfrh_str);
94 "buffer_create() failed", xfrh_str);
101 "tcp_set_create() failed", xfrh_str);
134 if (errno != EINTR) {
177 if (xfrhandler && xfrhandler->
started) {
178 ods_thread_kill(xfrhandler->
thread_id, SIGHUP);
189 xfrhandler_handle_dns(
netio_type* ATTR_UNUSED(netio),
194 ssize_t received = 0;
201 ods_log_debug(
"[%s] read forwarded dns packet: %d bytes received",
202 xfrh_str, (
int) received);
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,...)
xfrd_type * tcp_waiting_first
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)