Go to the source code of this file.
Defines | |
#define | LDNS_DEFAULT_TIMEOUT_SEC 5 |
#define | LDNS_DEFAULT_TIMEOUT_USEC 0 |
Functions | |
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. | |
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_send (ldns_pkt **pkt, ldns_resolver *r, ldns_pkt *query_pkt) |
Sends ptk to the nameserver at the resolver object. | |
int | ldns_tcp_connect (const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout) |
Create a tcp socket to the specified address. | |
int | ldns_udp_connect (const struct sockaddr_storage *to, struct timeval timeout) |
Create a udp socket to the specified address. | |
int | ldns_udp_server_connect (const struct sockaddr_storage *to, struct timeval timeout) |
Create a udp socket to the specified address and bind it too (making it a server socket). | |
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. | |
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. | |
uint8_t * | ldns_tcp_read_wire (int sockfd, size_t *size) |
Gives back a raw packet from the wire and reads the header data from the given socket. | |
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. |
ldns_status ldns_send | ( | ldns_pkt ** | pkt, | |
ldns_resolver * | r, | |||
ldns_pkt * | query_pkt | |||
) |
Sends ptk to the nameserver at the resolver object.
Returns the data as a ldns_pkt
[out] | pkt | packet received from the nameserver |
[in] | r | the resolver to use |
[in] | query_pkt | the query to send |
int ldns_tcp_connect | ( | const struct sockaddr_storage * | to, | |
socklen_t | tolen, | |||
struct timeval | timeout | |||
) |
Create a tcp socket to the specified address.
[in] | to | ip and family |
[in] | tolen | length of to |
[in] | timeout | timeout for the socket |
uint8_t* ldns_tcp_read_wire | ( | int | sockfd, | |
size_t * | size | |||
) |
Gives back a raw packet from the wire and reads the header data from the given socket.
Allocates the data (of size size) itself, so don't forget to free
[in] | sockfd | the socket to read from |
[out] | size | the number of bytes that are read |
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.
[in] | qbin | the ldns_buffer to be send |
[in] | qbin | the ldns_buffer to be send |
[in] | to | the ip addr to send to |
[in] | tolen | length of the ip addr |
[in] | timeout | the timeout value for the network |
[out] | answersize | size of the packet |
[out] | result | packet with the answer |
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.
Don;t want for the answer
[in] | qbin | the buffer to send |
[in] | sockfd | the socket to use |
[in] | to | which ip to send it |
[in] | tolen | socketlen |
int ldns_udp_connect | ( | const struct sockaddr_storage * | to, | |
struct timeval | timeout | |||
) |
Create a udp socket to the specified address.
[in] | to | ip and family |
[in] | timeout | timeout for the socket |
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.
Allocates the data (of size size) itself, so don't forget to free
[in] | sockfd | the socket to read from |
[in] | fr | the address of the client (if applicable) |
[in] | *frlen | the lenght of the client's addr (if applicable) |
[out] | size | the number of bytes that are read |
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.
[in] | qbin | the ldns_buffer to be send |
[in] | to | the ip addr to send to |
[in] | tolen | length of the ip addr |
[in] | timeout | the timeout value for the network |
[out] | answersize | size of the packet |
[out] | result | packet with the answer |
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.
Don;t want for the answer
[in] | qbin | the buffer to send |
[in] | sockfd | the socket to use |
[in] | to | which ip to send it |
[in] | tolen | socketlen |
int ldns_udp_server_connect | ( | const struct sockaddr_storage * | to, | |
struct timeval | timeout | |||
) |
Create a udp socket to the specified address and bind it too (making it a server socket).
[in] | to | ip and family |
[in] | timeout | timeout for the socket |