net.h

Go to the documentation of this file.
00001 /*
00002  * net.h
00003  *
00004  * DNS Resolver definitions
00005  *
00006  * a Net::DNS like library for C
00007  *
00008  * (c) NLnet Labs, 2004, 2005
00009  *
00010  * See the file LICENSE for the license
00011  */
00012 
00013 #ifndef _LDNS_NET_H
00014 #define _LDNS_NET_H
00015 
00016 #include <ldns/packet.h>
00017 #include <ldns/buffer.h>
00018 #include <ldns/resolver.h>
00019 #include <ldns/keys.h>
00020 
00021 #include <sys/socket.h>
00022 
00023 #define LDNS_DEFAULT_TIMEOUT_SEC 5
00024 #define LDNS_DEFAULT_TIMEOUT_USEC 0
00025 
00026 
00037 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);
00038 
00050 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);
00051 
00061 ldns_status ldns_send(ldns_pkt **pkt, ldns_resolver *r, ldns_pkt *query_pkt);
00062 
00070 int ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout);
00071 
00078 int ldns_udp_connect(const struct sockaddr_storage *to, struct timeval timeout);
00079 
00087 int ldns_udp_server_connect(const struct sockaddr_storage *to, struct timeval timeout);
00088 
00098 ssize_t ldns_tcp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen);
00099 
00109 ssize_t ldns_udp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen);
00118 uint8_t *ldns_tcp_read_wire(int sockfd, size_t *size);
00119 
00130 uint8_t *ldns_udp_read_wire(int sockfd, size_t *size, struct sockaddr_storage *fr, socklen_t *frlen);
00131 
00132 #endif  /* !_LDNS_NET_H */

Generated on Mon Feb 20 15:49:56 2006 for ldns by  doxygen 1.4.6