Macros | Functions | Variables
streamtcp.c File Reference

This program performs multiple DNS queries on a TCP stream. More...

#include "config.h"
#include <signal.h>
#include "util/locks.h"
#include "util/log.h"
#include "util/net_help.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)
 open TCP socket to svr
 
static void write_q (int fd, int udp, SSL *ssl, sldns_buffer *buf, uint16_t id, 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 int get_random (void)
 
static void send_em (const char *svr, int udp, int usessl, int noanswer, 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. More...
 
char * optarg
 getopt global, in case header files fail to declare it. More...
 

Detailed Description

This program performs multiple DNS queries on a TCP stream.

Variable Documentation

◆ optind

int optind

getopt global, in case header files fail to declare it.

Referenced by main().

◆ optarg

char* optarg

getopt global, in case header files fail to declare it.

Referenced by main().