dns_transmit Struct Reference
dns: DNS Resolver Library

`#include <dns.h>`

## Data Fields

char * | query
unsigned int | querylen
char * | packet
unsigned int | packetlen
int | s1
int | tcpstate
unsigned int | udploop
unsigned int | curserver
struct timeval | deadline
unsigned int | pos
const ipv4addr * | servers
ipv4addr | localip
uint16 | qtype

## Detailed Description

DNS transmission record

## Field Documentation

## curserver

unsigned int dns_transmit::curserver

Index of the server we are currently sending to.

## deadline

struct timeval dns_transmit::deadline

Deadline for considering a request timed out.

## localip

ipv4addr dns_transmit::localip

The local IP address to transmit with.

## packet

char* dns_transmit::packet

The received response packet. This will either be `NULL` or dynamically allocated.

Referenced by dns_ip4_r(), dns_ip6_r(), dns_mx_r(), dns_name4_r(), dns_name6_r(), and dns_txt_r().

## packetlen

unsigned int dns_transmit::packetlen

The length of the received response packet.

Referenced by dns_ip4_r(), dns_ip6_r(), dns_mx_r(), dns_name4_r(), dns_name6_r(), and dns_txt_r().

## pos

unsigned int dns_transmit::pos

Current sending/receiving position within the buffer, for TCP transmissions.

## qtype

uint16 dns_transmit::qtype

The requested query type.

## query

char* dns_transmit::query

The transmitted query packet. This will either be `NULL` or dynamically allocated.

## querylen

unsigned int dns_transmit::querylen

The length of the transmitted query packet.

## s1

int dns_transmit::s1

The socket file descriptor used for data transmission. This will either be 0 or 1 + an open file descriptor. The addition is done to allow the uninitialized state to be all zeros.

## servers

const ipv4addr* dns_transmit::servers

The list of servers to try.

## tcpstate

int dns_transmit::tcpstate

Current state of the TCP connection. Valid values are:

- 0 is uninitialized (ie using UDP)
- 1 is connecting
- 2 is connected, sending query
- 3 is query sent, waiting for start of response
- 4 is reading response length
- 5 is read packet length, reading response

## udploop

unsigned int dns_transmit::udploop

Count of number of times the UDP query was sent to each server.

The documentation for this struct was generated from the following file:

- dns.h