|
unbound 0.1
|
This program performs multiple DNS queries on a TCP stream. More...
#include "config.h"#include <signal.h>#include <stdlib.h>#include <unistd.h>#include "util/locks.h"#include "util/log.h"#include "util/net_help.h"#include "util/proxy_protocol.h"#include "util/data/msgencode.h"#include "util/data/msgparse.h"#include "util/data/msgreply.h"#include "util/data/dname.h"#include "sldns/sbuffer.h"#include "sldns/str2wire.h"#include "sldns/wire2str.h"#include <openssl/ssl.h>#include <openssl/rand.h>#include <openssl/err.h>Macros | |
| #define | PF_INET6 10 |
| define in case streamtcp is compiled on legacy systems | |
Functions | |
| static void | usage (char *argv[]) |
| usage information for streamtcp | |
| static int | open_svr (const char *svr, int udp, struct sockaddr_storage *addr, socklen_t *addrlen) |
| open TCP socket to svr | |
| static void | write_soa_serial_to_buf (sldns_buffer *buf, struct query_info *qinfo, uint32_t serial) |
| Append a SOA record with serial number. | |
| static void | write_q (int fd, int udp, SSL *ssl, sldns_buffer *buf, uint16_t id, sldns_buffer *proxy_buf, int pp2_parsed, const char *strname, const char *strtype, const char *strclass) |
| write a query over the TCP fd | |
| static void | recv_one (int fd, int udp, SSL *ssl, sldns_buffer *buf) |
| receive DNS datagram over TCP and print it | |
| static void | print_any_answers (int fd, int udp, SSL *ssl, sldns_buffer *buf, int *num_answers, int wait_all) |
| see if we can receive any results | |
| static int | get_random (void) |
| static int | parse_pp2_client (const char *pp2_client, int udp, sldns_buffer *proxy_buf) |
| static void | send_em (const char *svr, const char *pp2_client, int udp, int usessl, int noanswer, int onarrival, int delay, int num, char **qs) |
| send the TCP queries and print answers | |
| int | main (int argc, char **argv) |
| main program for streamtcp | |
Variables | |
| int | optind |
| getopt global, in case header files fail to declare it. | |
| char * | optarg |
| getopt global, in case header files fail to declare it. | |
This program performs multiple DNS queries on a TCP stream.
| #define PF_INET6 10 |
define in case streamtcp is compiled on legacy systems
Referenced by contact_server(), open_svr(), and outnet_get_tcp_fd().
|
static |
usage information for streamtcp
References usage().
|
static |
open TCP socket to svr
References addr_is_ip6(), extstrtoaddr(), and PF_INET6.
Referenced by send_em().
|
static |
Append a SOA record with serial number.
References LDNS_RR_TYPE_SOA, PTR_CREATE, query_info::qclass, sldns_buffer_capacity(), sldns_buffer_flip(), sldns_buffer_limit(), sldns_buffer_set_limit(), sldns_buffer_set_position(), sldns_buffer_write_u16(), sldns_buffer_write_u32(), sldns_buffer_write_u8(), and write_soa_serial_to_buf().
Referenced by write_q(), and write_soa_serial_to_buf().
|
static |
write a query over the TCP fd
References attach_edns_record(), BIT_RD, edns_data::bits, calc_edns_field_size(), EDNS_DO, edns_data::edns_present, LDNS_RR_TYPE_SOA, query_info::local_alias, log_crypto_err(), query_info::qclass, qinfo_query_encode(), query_info::qname, query_info::qname_len, query_info::qtype, sldns_buffer_begin(), sldns_buffer_capacity(), sldns_buffer_clear(), sldns_buffer_flip(), sldns_buffer_limit(), sldns_buffer_set_limit(), sldns_buffer_skip(), sldns_buffer_write(), sldns_buffer_write_u16_at(), sldns_get_rr_class_by_name(), sldns_get_rr_type_by_name(), sldns_str2wire_dname(), edns_data::udp_size, write_q(), and write_soa_serial_to_buf().
|
static |
receive DNS datagram over TCP and print it
References fatal_exit(), log_crypto_err(), recv_one(), sldns_buffer_begin(), sldns_buffer_capacity(), sldns_buffer_clear(), sldns_buffer_limit(), sldns_buffer_read_u8_at(), sldns_buffer_set_limit(), and sldns_wire2str_pkt().
Referenced by print_any_answers(), recv_one(), and send_em().
|
static |
see if we can receive any results
References print_any_answers(), and recv_one().
Referenced by print_any_answers(), and send_em().
|
static |
send the TCP queries and print answers
References connect_sslctx_create(), fatal_exit(), log_crypto_err(), log_crypto_err_io(), open_svr(), outgoing_ssl_fd(), print_any_answers(), recv_one(), send_em(), sldns_buffer_begin(), sldns_buffer_free(), sldns_buffer_limit(), sldns_buffer_new(), sock_close(), and write_q().