OpenDNSSEC-signer  1.4.8.2
Data Structures | Macros | Typedefs | Enumerations | Functions
xfrd.h File Reference
#include "config.h"
#include "shared/allocator.h"
#include "shared/locks.h"
#include "shared/status.h"
#include "wire/acl.h"
#include "wire/buffer.h"
#include "wire/netio.h"
#include "wire/tsig.h"
#include <stdint.h>
#include <time.h>
Include dependency graph for xfrd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  soa_struct
 
struct  xfrd_struct
 

Macros

#define XFRD_MAX_ROUNDS   3 /* max number of rounds along the masters */
 
#define XFRD_MAX_UDP   100 /* max number of udp sockets at a time for ixfr */
 
#define XFRD_NO_IXFR_CACHE   172800 /* 48h before retrying ixfr after notimpl */
 
#define XFRD_TCP_TIMEOUT   120 /* seconds, before a tcp request times out */
 
#define XFRD_UDP_TIMEOUT   5 /* seconds, before a udp request times out */
 

Typedefs

typedef enum xfrd_pkt_enum xfrd_pkt_status
 
typedef struct soa_struct soa_type
 
typedef struct xfrd_struct xfrd_type
 

Enumerations

enum  xfrd_pkt_enum {
  XFRD_PKT_BAD, XFRD_PKT_MORE, XFRD_PKT_NOTIMPL, XFRD_PKT_TC,
  XFRD_PKT_XFR, XFRD_PKT_NEWLEASE
}
 

Functions

xfrd_typexfrd_create (void *xfrhandler, void *zone)
 
void xfrd_set_timer_now (xfrd_type *xfrd)
 
void xfrd_set_timer_retry (xfrd_type *xfrd)
 
void xfrd_set_timer_refresh (xfrd_type *xfrd)
 
socklen_t xfrd_acl_sockaddr_to (acl_type *acl, struct sockaddr_storage *to)
 
void xfrd_cleanup (xfrd_type *xfrd, int backup)
 

Macro Definition Documentation

#define XFRD_MAX_ROUNDS   3 /* max number of rounds along the masters */

Zone transfers.

Definition at line 47 of file xfrd.h.

Referenced by xfrd_acl_sockaddr_to().

#define XFRD_MAX_UDP   100 /* max number of udp sockets at a time for ixfr */

Definition at line 48 of file xfrd.h.

Referenced by xfrd_acl_sockaddr_to().

#define XFRD_NO_IXFR_CACHE   172800 /* 48h before retrying ixfr after notimpl */

Definition at line 49 of file xfrd.h.

Referenced by xfrd_acl_sockaddr_to().

#define XFRD_TCP_TIMEOUT   120 /* seconds, before a tcp request times out */
#define XFRD_UDP_TIMEOUT   5 /* seconds, before a udp request times out */

Definition at line 51 of file xfrd.h.

Referenced by xfrd_acl_sockaddr_to().

Typedef Documentation

typedef struct soa_struct soa_type

Definition at line 70 of file xfrd.h.

Definition at line 65 of file xfrd.h.

typedef struct xfrd_struct xfrd_type

Zone transfer state.

Definition at line 90 of file xfrd.h.

Enumeration Type Documentation

Packet status.

Enumerator
XFRD_PKT_BAD 
XFRD_PKT_MORE 
XFRD_PKT_NOTIMPL 
XFRD_PKT_TC 
XFRD_PKT_XFR 
XFRD_PKT_NEWLEASE 

Definition at line 57 of file xfrd.h.

Function Documentation

socklen_t xfrd_acl_sockaddr_to ( acl_type acl,
struct sockaddr_storage *  to 
)

Use acl address to setup remote sockaddr struct.

Parameters
[in]aclacl
[in]toremote address storage
Returns
socklen_t length of address

Use acl address to setup remote sockaddr struct.

Definition at line 558 of file xfrd.c.

References ADAPTER_DNS, acl_struct::address, zone_struct::adinbound, tsig_rr_struct::algo, tsig_rr_struct::algo_name, tsig_struct::algorithm, zone_struct::apex, buffer_available(), buffer_begin(), buffer_clear(), buffer_current(), buffer_flip(), buffer_limit(), buffer_pkt_ancount(), buffer_pkt_arcount(), BUFFER_PKT_HEADER_SIZE, buffer_pkt_id(), buffer_pkt_qdcount(), buffer_pkt_query(), buffer_pkt_rcode(), buffer_pkt_set_arcount(), buffer_pkt_set_nscount(), buffer_pkt_tc(), buffer_position(), buffer_read_dname(), buffer_read_u16(), buffer_read_u32(), buffer_remaining(), buffer_set_limit(), buffer_set_position(), buffer_skip(), buffer_skip_dname(), buffer_skip_rr(), buffer_write(), buffer_write_rdf(), buffer_write_u16(), buffer_write_u16_at(), buffer_write_u32(), adapter_struct::config, tsig_key_struct::dname, DNS_PORT_STRING, xfrhandler_struct::engine, engine_wakeup_workers(), tsig_rr_struct::error_code, netio_handler_struct::event_types, soa_struct::expire, acl_struct::family, tcp_conn_struct::fd, netio_handler_struct::fd, xfrd_struct::handler, tcp_conn_struct::is_reading, acl_struct::ixfr_disabled, tsig_struct::key, tsig_rr_struct::key, tsig_rr_struct::key_name, zone_struct::klass, lock_basic_lock, lock_basic_unlock, LOG_DEBUG, log_dname(), xfrd_struct::master, xfrd_struct::master_num, soa_struct::minimum, soa_struct::mname, xfrd_struct::msg_do_retransfer, xfrd_struct::msg_is_ixfr, xfrd_struct::msg_new_serial, xfrd_struct::msg_old_serial, xfrd_struct::msg_rr_count, xfrd_struct::msg_seq_nr, tcp_conn_struct::msglen, zone_struct::name, NETIO_EVENT_READ, NETIO_EVENT_TIMEOUT, NETIO_EVENT_WRITE, acl_struct::next, xfrd_struct::next_master, ods_build_path(), ods_fclose(), ods_fopen(), ods_log_assert, ods_log_crit(), ods_log_debug(), ods_log_deeebug(), ods_log_error(), ods_log_info(), ods_log_verbose(), ods_status2str(), ODS_STATUS_BUFAVAIL, ODS_STATUS_INSERIAL, ODS_STATUS_OK, ODS_STATUS_PARSESOA, ODS_STATUS_REQAXFR, ODS_STATUS_SKIPDNAME, tsig_rr_struct::original_query_id, tcp_conn_struct::packet, xfrhandler_struct::packet, PF_INET, PF_INET6, acl_struct::port, tsig_rr_struct::position, xfrd_struct::query_id, soa_struct::refresh, dnsin_struct::request_xfr, soa_struct::retry, soa_struct::rname, xfrd_struct::round_num, xfrd_struct::rw_lock, soa_struct::serial, xfrd_struct::serial_disk, xfrd_struct::serial_disk_acquired, xfrd_struct::serial_lock, xfrd_struct::serial_notify, xfrd_struct::serial_notify_acquired, xfrd_struct::serial_retransfer, xfrd_struct::serial_xfr, xfrd_struct::serial_xfr_acquired, xfrd_struct::soa, tsig_rr_struct::status, TASK_READ, xfrd_struct::tcp_conn, tcp_conn_read(), tcp_conn_ready(), tcp_conn_write(), xfrhandler_struct::tcp_set, xfrd_struct::tcp_waiting, TCPSET_MAX, time_now(), xfrd_struct::timeout, netio_handler_struct::timeout, tcp_conn_struct::total_bytes, acl_struct::tsig, tsig_lookup_algo(), TSIG_OK, xfrd_struct::tsig_rr, tsig_rr_append(), tsig_rr_find(), tsig_rr_prepare(), tsig_rr_reset(), tsig_rr_sign(), tsig_rr_update(), tsig_rr_verify(), tsig_strerror(), soa_struct::ttl, adapter_struct::type, xfrhandler_struct::udp_use_num, xfrd_struct::udp_waiting, xfrhandler_struct::udp_waiting_first, xfrhandler_struct::udp_waiting_last, xfrd_struct::udp_waiting_next, tsig_rr_struct::update_since_last_prepare, netio_handler_struct::user_data, util_serial_gt(), tsig_algo_struct::wf_name, xfrd_acl_sockaddr_to(), XFRD_MAX_ROUNDS, XFRD_MAX_UDP, XFRD_NO_IXFR_CACHE, XFRD_PKT_BAD, XFRD_PKT_MORE, XFRD_PKT_NEWLEASE, XFRD_PKT_NOTIMPL, XFRD_PKT_TC, XFRD_PKT_XFR, xfrd_set_timer_now(), xfrd_set_timer_refresh(), xfrd_set_timer_retry(), XFRD_TCP_TIMEOUT, XFRD_TSIG_MAX_UNSIGNED, XFRD_UDP_TIMEOUT, xfrd_struct::xfrhandler, xfrd_struct::zone, zone_struct::zone_lock, and zone_reschedule_task().

Referenced by notify_create(), and xfrd_acl_sockaddr_to().

void xfrd_cleanup ( xfrd_type xfrd,
int  backup 
)

Cleanup zone transfer structure.

Parameters
[in]xfrdzone transfer structure.
[in]backupbackup transfer variables.

Cleanup zone transfer structure.

Definition at line 2159 of file xfrd.c.

References xfrd_struct::allocator, allocator_cleanup(), allocator_deallocate(), lock_basic_destroy, xfrd_struct::rw_lock, xfrd_struct::serial_lock, xfrd_struct::tsig_rr, and tsig_rr_cleanup().

Referenced by engine_wakeup_workers(), xfrd_create(), and zone_cleanup().

xfrd_type* xfrd_create ( void *  xfrhandler,
void *  zone 
)

Create zone transfer structure.

Parameters
[in]xfrhandlerzone transfer handler
[in]zonezone reference
Returns
xfrd_type* zone transfer structure.

Create zone transfer structure.

Definition at line 316 of file xfrd.c.

References xfrd_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), netio_handler_struct::event_handler, netio_handler_struct::event_types, soa_struct::expire, netio_handler_struct::fd, xfrd_struct::handler, lock_basic_init, lock_basic_lock, lock_basic_unlock, xfrd_struct::master, xfrd_struct::master_num, soa_struct::minimum, soa_struct::mname, xfrd_struct::msg_do_retransfer, xfrd_struct::msg_is_ixfr, xfrd_struct::msg_new_serial, xfrd_struct::msg_old_serial, xfrd_struct::msg_rr_count, xfrd_struct::msg_seq_nr, NETIO_EVENT_READ, NETIO_EVENT_TIMEOUT, xfrd_struct::next_master, ods_log_assert, ods_log_error(), xfrd_struct::query_id, soa_struct::refresh, soa_struct::retry, soa_struct::rname, xfrd_struct::round_num, xfrd_struct::rw_lock, soa_struct::serial, xfrd_struct::serial_disk, xfrd_struct::serial_disk_acquired, xfrd_struct::serial_lock, xfrd_struct::serial_notify, xfrd_struct::serial_notify_acquired, xfrd_struct::serial_retransfer, xfrd_struct::serial_xfr, xfrd_struct::serial_xfr_acquired, xfrd_struct::soa, xfrd_struct::tcp_conn, xfrd_struct::tcp_waiting, xfrd_struct::tcp_waiting_next, xfrd_struct::timeout, netio_handler_struct::timeout, xfrd_struct::tsig_rr, tsig_rr_create(), soa_struct::ttl, xfrd_struct::udp_waiting, xfrd_struct::udp_waiting_next, netio_handler_struct::user_data, xfrd_cleanup(), xfrd_struct::xfrhandler, xfrhandler_time(), and xfrd_struct::zone.

Referenced by engine_wakeup_workers().

void xfrd_set_timer_now ( xfrd_type xfrd)

Set timeout for zone transfer to now.

Parameters
[in]xfrdzone transfer structure.

Set timeout for zone transfer to now.

Definition at line 472 of file xfrd.c.

References zone_struct::name, ods_log_debug(), xfrd_struct::xfrhandler, and xfrd_struct::zone.

Referenced by engine_wakeup_workers(), query_reset(), and xfrd_acl_sockaddr_to().

void xfrd_set_timer_refresh ( xfrd_type xfrd)

Set timeout for zone transfer to REFRESH.

Parameters
[in]xfrdzone transfer structure.

Set timeout for zone transfer to REFRESH.

Definition at line 510 of file xfrd.c.

References acl_struct::addr, acl_addr_storage::addr, acl_addr_storage::addr6, acl_struct::family, zone_struct::name, ods_log_assert, ods_log_debug(), soa_struct::refresh, xfrd_struct::soa, xfrd_struct::xfrhandler, and xfrd_struct::zone.

Referenced by xfrd_acl_sockaddr_to().

void xfrd_set_timer_retry ( xfrd_type xfrd)

Set timeout for zone transfer to RETRY.

Parameters
[in]xfrdzone transfer structure.

Set timeout for zone transfer to RETRY.

Definition at line 491 of file xfrd.c.

References zone_struct::name, ods_log_debug(), soa_struct::retry, xfrd_struct::soa, xfrd_struct::xfrhandler, and xfrd_struct::zone.

Referenced by xfrd_acl_sockaddr_to().