17 #include <sys/socket.h> 23 #define LDNS_DEFAULT_TIMEOUT_SEC 5 24 #define LDNS_DEFAULT_TIMEOUT_USEC 0 135 int ldns_tcp_connect2(
const struct sockaddr_storage *to, socklen_t tolen,
struct timeval timeout);
146 int ldns_tcp_connect(
const struct sockaddr_storage *to, socklen_t tolen,
struct timeval timeout);
154 int ldns_udp_connect2(
const struct sockaddr_storage *to,
struct timeval timeout);
164 int ldns_udp_connect(
const struct sockaddr_storage *to,
struct timeval timeout);
220 uint8_t *
ldns_udp_read_wire(
int sockfd,
size_t *size,
struct sockaddr_storage *fr, socklen_t *frlen);
implementation of buffers to ease operations
int ldns_tcp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout)
Send an tcp query and don't wait for an answer but return the socket This function has the flaw that ...
ldns_status ldns_send_buffer(ldns_pkt **pkt, ldns_resolver *r, ldns_buffer *qb, ldns_rdf *tsig_mac)
Sends and ldns_buffer (presumably containing a packet to the nameserver at the resolver object.
ldns_rdf * ldns_sockaddr_storage2rdf(const struct sockaddr_storage *sock, uint16_t *port)
returns an rdf with the sockaddr info.
DNS stub resolver structure.
enum ldns_enum_rr_class ldns_rr_class
ldns_status ldns_send(ldns_pkt **pkt, ldns_resolver *r, const ldns_pkt *query_pkt)
Sends ptk to the nameserver at the resolver object.
ssize_t ldns_tcp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen)
send a query via tcp to a server.
uint8_t * ldns_tcp_read_wire_timeout(int sockfd, size_t *size, struct timeval timeout)
Gives back a raw packet from the wire and reads the header data from the given socket.
int ldns_udp_bgsend2(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout)
Send an udp query and don't wait for an answer but return the socket.
Including this file will include all ldns files, and define some lookup tables.
int ldns_udp_connect(const struct sockaddr_storage *to, struct timeval timeout)
Create a udp socket to the specified address This function has the flaw that it returns 0 on failure,...
int ldns_udp_connect2(const struct sockaddr_storage *to, struct timeval timeout)
Create a udp socket to the specified address.
int ldns_udp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout)
Send an udp query and don't wait for an answer but return the socket This function has the flaw that ...
ldns_status ldns_axfr_start(ldns_resolver *resolver, const ldns_rdf *domain, ldns_rr_class c)
Prepares the resolver for an axfr query The query is sent and the answers can be read with ldns_axfr_...
int ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout)
Create a tcp socket to the specified address This function has the flaw that it returns 0 on failure,...
struct sockaddr_storage * ldns_rdf2native_sockaddr_storage(const ldns_rdf *rd, uint16_t port, size_t *size)
returns the native sockaddr representation from the rdf.
enum ldns_enum_status ldns_status
Resource record data field.
ssize_t ldns_udp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen)
send a query via udp to a server.
ldns_status ldns_tcp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout, size_t *answersize)
Sends a buffer to an ip using tcp and return the respons as a ldns_pkt.
ldns_status ldns_udp_send(uint8_t **result, ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout, size_t *answersize)
Sends a buffer to an ip using udp and return the respons as a ldns_pkt.
uint8_t * ldns_udp_read_wire(int sockfd, size_t *size, struct sockaddr_storage *fr, socklen_t *frlen)
Gives back a raw packet from the wire and reads the header data from the given socket.
uint8_t * ldns_tcp_read_wire(int sockfd, size_t *size)
This routine may block.
int ldns_tcp_connect2(const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout)
Create a tcp socket to the specified address.
int ldns_tcp_bgsend2(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout)
Send an tcp query and don't wait for an answer but return the socket.