OpenDNSSEC-signer
1.4.1
|
#include "config.h"
#include "shared/allocator.h"
#include "shared/status.h"
#include "wire/listener.h"
#include "wire/netio.h"
#include "wire/query.h"
Go to the source code of this file.
Data Structures | |
struct | sock_struct |
struct | socklist_struct |
struct | udp_data |
struct | tcp_accept_data |
struct | tcp_data |
Typedefs | |
typedef struct sock_struct | sock_type |
typedef struct socklist_struct | socklist_type |
Functions | |
ods_status | sock_listen (socklist_type *sockets, listener_type *listener) |
void | sock_handle_udp (netio_type *netio, netio_handler_type *handler, netio_events_type event_types) |
void | sock_handle_tcp_accept (netio_type *netio, netio_handler_type *handler, netio_events_type event_types) |
void | sock_handle_tcp_read (netio_type *netio, netio_handler_type *handler, netio_events_type event_types) |
void | sock_handle_tcp_write (netio_type *netio, netio_handler_type *handler, netio_events_type event_types) |
typedef struct sock_struct sock_type |
typedef struct socklist_struct socklist_type |
void sock_handle_tcp_accept | ( | netio_type * | netio, |
netio_handler_type * | handler, | ||
netio_events_type | event_types | ||
) |
Handle incoming tcp connections.
[in] | netio | network I/O event handler |
[in] | handler | event handler |
[in] | event_types | the types of events that should be checked for |
Handle incoming tcp connections.
Definition at line 453 of file sock.c.
References query_struct::addr, query_struct::addrlen, tcp_data::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), allocator_deallocate(), tcp_data::bytes_transmitted, tcp_accept_data::engine, tcp_data::engine, netio_handler_struct::fd, netio_add_handler(), netio_current_time(), NETIO_EVENT_READ, NETIO_EVENT_TIMEOUT, ods_log_debug(), ods_log_error(), tcp_data::qstate, tcp_data::query, query_cleanup(), query_create(), QUERY_PROCESSED, sock_handle_tcp_read(), tcp_accept_data::tcp_accept_handler_count, tcp_data::tcp_accept_handler_count, tcp_accept_data::tcp_accept_handlers, tcp_data::tcp_accept_handlers, timespec_add(), netio_handler_struct::user_data, and XFRD_TCP_TIMEOUT.
Referenced by dnshandler_start().
void sock_handle_tcp_read | ( | netio_type * | netio, |
netio_handler_type * | handler, | ||
netio_events_type | event_types | ||
) |
Handle incoming tcp queries.
[in] | netio | network I/O event handler |
[in] | handler | event handler |
[in] | event_types | the types of events that should be checked for |
Handle incoming tcp queries.
Definition at line 558 of file sock.c.
References query_struct::buffer, buffer_current(), buffer_flip(), buffer_position(), buffer_remaining(), buffer_set_limit(), buffer_skip(), tcp_data::bytes_transmitted, tcp_data::engine, netio_handler_struct::event_handler, netio_handler_struct::event_types, netio_handler_struct::fd, query_struct::maxlen, netio_current_time(), NETIO_EVENT_READ, NETIO_EVENT_TIMEOUT, NETIO_EVENT_WRITE, ods_log_assert, ods_log_debug(), ods_log_error(), ods_log_warning(), tcp_data::qstate, tcp_data::query, query_add_optional(), QUERY_DISCARDED, query_process(), QUERY_PROCESSED, query_reset(), sock_handle_tcp_write(), TCP_MAX_MESSAGE_LEN, query_struct::tcplen, netio_handler_struct::timeout, timespec_add(), netio_handler_struct::user_data, and XFRD_TCP_TIMEOUT.
Referenced by sock_handle_tcp_accept(), and sock_handle_tcp_write().
void sock_handle_tcp_write | ( | netio_type * | netio, |
netio_handler_type * | handler, | ||
netio_events_type | event_types | ||
) |
Handle outgoing tcp responses.
[in] | netio | network I/O event handler |
[in] | handler | event handler |
[in] | event_types | the types of events that should be checked for |
Handle outgoing tcp responses.
Definition at line 684 of file sock.c.
References axfr(), query_struct::buffer, buffer_clear(), buffer_current(), buffer_flip(), buffer_remaining(), buffer_skip(), tcp_data::bytes_transmitted, tcp_data::engine, netio_handler_struct::event_handler, netio_handler_struct::event_types, netio_handler_struct::fd, ixfr(), netio_current_time(), NETIO_EVENT_READ, NETIO_EVENT_TIMEOUT, NETIO_EVENT_WRITE, ods_log_assert, ods_log_debug(), ods_log_error(), tcp_data::qstate, tcp_data::query, query_add_optional(), QUERY_AXFR, QUERY_IXFR, QUERY_PROCESSED, sock_handle_tcp_read(), query_struct::tcplen, netio_handler_struct::timeout, timespec_add(), netio_handler_struct::user_data, and XFRD_TCP_TIMEOUT.
Referenced by sock_handle_tcp_read().
void sock_handle_udp | ( | netio_type * | netio, |
netio_handler_type * | handler, | ||
netio_events_type | event_types | ||
) |
Handle incoming udp queries.
[in] | netio | network I/O event handler |
[in] | handler | event handler |
[in] | event_types | the types of events that should be checked for |
ods_status sock_listen | ( | socklist_type * | sockets, |
listener_type * | listener | ||
) |
Create sockets and listen.
[out] | sockets | sockets |
[in] | listener | interfaces |
Create sockets and listen.
Definition at line 295 of file sock.c.
References interface_struct::address, listener_struct::count, DNS_PORT_STRING, interface_struct::family, listener_struct::interfaces, MAX_INTERFACES, ods_log_warning(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, interface_struct::port, sock_struct::s, socklist_struct::tcp, and socklist_struct::udp.
Referenced by dnshandler_listen().