OpenDNSSEC-signer
1.4.3
|
#include "config.h"
#include "shared/allocator.h"
#include "signer/zone.h"
#include "wire/buffer.h"
#include "wire/edns.h"
#include "wire/tsig.h"
Go to the source code of this file.
Data Structures | |
struct | query_struct |
struct | response_struct |
Macros | |
#define | UDP_MAX_MESSAGE_LEN 512 |
#define | TCP_MAX_MESSAGE_LEN 65535 |
#define | QUERY_RESPONSE_MAX_RRSET 10 /* should be enough */ |
Typedefs | |
typedef enum query_enum | query_state |
typedef struct query_struct | query_type |
typedef struct response_struct | response_type |
Enumerations | |
enum | query_enum { QUERY_PROCESSED = 0, QUERY_DISCARDED, QUERY_AXFR, QUERY_IXFR } |
Functions | |
query_type * | query_create (void) |
void | query_prepare (query_type *q) |
query_state | query_process (query_type *q, void *engine) |
void | query_reset (query_type *q, size_t maxlen, int is_tcp) |
void | query_add_optional (query_type *q, void *engine) |
int | query_add_rr (query_type *q, ldns_rr *rr) |
void | query_cleanup (query_type *q) |
#define TCP_MAX_MESSAGE_LEN 65535 |
Definition at line 45 of file query.h.
Referenced by sock_handle_tcp_read().
#define UDP_MAX_MESSAGE_LEN 512 |
typedef enum query_enum query_state |
typedef struct query_struct query_type |
typedef struct response_struct response_type |
enum query_enum |
void query_add_optional | ( | query_type * | q, |
void * | engine | ||
) |
Add optional RRs to query.
[in] | q | query |
[in] | engine | signer engine |
Add optional RRs to query.
First EDNS
Then TSIG
Definition at line 919 of file query.c.
References query_struct::buffer, buffer_pkt_arcount(), buffer_pkt_set_arcount(), buffer_position(), buffer_write(), edns_rr_struct::dnssec_ok, engine_struct::edns, EDNS_ERROR, EDNS_NOT_PRESENT, EDNS_OK, query_struct::edns_rr, edns_data_struct::error, tsig_rr_struct::error_code, ods_log_debug(), edns_data_struct::ok, OPT_LEN, OPT_RDATA, query_str, edns_data_struct::rdata_none, edns_rr_struct::status, tsig_rr_struct::status, TSIG_ERROR, TSIG_NOT_PRESENT, TSIG_OK, query_struct::tsig_prepare_it, query_struct::tsig_rr, tsig_rr_append(), tsig_rr_error(), tsig_rr_prepare(), tsig_rr_sign(), tsig_rr_update(), query_struct::tsig_sign_it, and query_struct::tsig_update_it.
Referenced by sock_handle_tcp_read(), sock_handle_tcp_write(), and sock_handle_udp().
int query_add_rr | ( | query_type * | q, |
ldns_rr * | rr | ||
) |
Add RR to query.
[in] | q | query |
[in] | rr | RR |
Add RR to query.
Definition at line 1000 of file query.c.
References query_struct::buffer, buffer_available(), buffer_position(), buffer_set_position(), buffer_skip(), buffer_write_rdf(), buffer_write_u16(), buffer_write_u16_at(), buffer_write_u32(), and ods_log_assert.
Referenced by axfr(), ixfr(), and soa_request().
void query_cleanup | ( | query_type * | q | ) |
Cleanup query.
[in] | q | query |
Cleanup query.
Definition at line 1057 of file query.c.
References query_struct::allocator, allocator_cleanup(), allocator_deallocate(), query_struct::axfr_fd, query_struct::buffer, buffer_cleanup(), ods_fclose(), query_struct::tsig_rr, and tsig_rr_cleanup().
Referenced by dnshandler_cleanup(), query_create(), and sock_handle_tcp_accept().
query_type* query_create | ( | void | ) |
Create query.
Create query.
Definition at line 50 of file query.c.
References query_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), query_struct::axfr_fd, query_struct::buffer, buffer_create(), query_struct::edns_rr, edns_rr_create(), PACKET_BUFFER_SIZE, query_cleanup(), query_reset(), query_struct::tsig_rr, tsig_rr_create(), and UDP_MAX_MESSAGE_LEN.
Referenced by dnshandler_create(), and sock_handle_tcp_accept().
void query_prepare | ( | query_type * | q | ) |
Prepare response.
[in] | q | query |
Prepare response.
Definition at line 577 of file query.c.
References query_struct::buffer, buffer_capacity(), buffer_clear(), buffer_limit(), buffer_pkt_flags(), buffer_pkt_set_flags(), buffer_set_limit(), buffer_set_position(), query_struct::edns_rr, edns_rr_reserved_space(), ods_log_assert, query_struct::reserved_space, query_struct::tsig_rr, and tsig_rr_reserved_space().
query_state query_process | ( | query_type * | q, |
void * | engine | ||
) |
Process query.
[in] | q | query |
[in] | engine | signer engine |
Process query.
Definition at line 813 of file query.c.
References query_struct::buffer, buffer_current(), buffer_limit(), BUFFER_PKT_HEADER_SIZE, buffer_pkt_qr(), buffer_remaining(), lock_basic_lock, lock_basic_unlock, zone_struct::name, ods_log_assert, ods_log_debug(), ods_log_error(), ods_log_warning(), QUERY_DISCARDED, query_str, tsig_rr_struct::status, query_struct::tsig_rr, tsig_status2str(), zonelist_struct::zl_lock, zone_struct::zl_status, query_struct::zone, ZONE_ZL_ADDED, engine_struct::zonelist, and zonelist_lookup_zone_by_dname().
Referenced by sock_handle_tcp_read(), and sock_handle_udp().
void query_reset | ( | query_type * | q, |
size_t | maxlen, | ||
int | is_tcp | ||
) |
Reset query.
[in] | q | query |
[in] | maxlen | maximum message length |
[in] | is_tcp | 1 if tcp query |
Reset query.
Definition at line 92 of file query.c.
References query_struct::addr, query_struct::addrlen, query_struct::axfr_fd, query_struct::axfr_is_done, query_struct::buffer, buffer_clear(), query_struct::edns_rr, edns_rr_reset(), query_struct::maxlen, ods_fclose(), query_struct::reserved_space, query_struct::serial, query_struct::startpos, query_struct::tcp, query_struct::tsig_prepare_it, query_struct::tsig_rr, tsig_rr_reset(), query_struct::tsig_sign_it, query_struct::tsig_update_it, and query_struct::zone.
Referenced by query_create(), sock_handle_tcp_read(), and sock_handle_udp().