003 File Manager
Current Path:
/usr/src/contrib/ldns/ldns
usr
/
src
/
contrib
/
ldns
/
ldns
/
📁
..
📄
buffer.h
(16.36 KB)
📄
common.h
(2.15 KB)
📄
common.h.in
(2.4 KB)
📄
config.h
(16.7 KB)
📄
config.h.in
(15.91 KB)
📄
dane.h
(11 KB)
📄
dname.h
(6.36 KB)
📄
dnssec.h
(19.67 KB)
📄
dnssec_sign.h
(14.15 KB)
📄
dnssec_verify.h
(29.4 KB)
📄
dnssec_zone.h
(14.47 KB)
📄
duration.h
(2.94 KB)
📄
error.h
(4.13 KB)
📄
higher.h
(3.31 KB)
📄
host2str.h
(30.78 KB)
📄
host2wire.h
(6.39 KB)
📄
keys.h
(17.52 KB)
📄
ldns.h
(4.53 KB)
📄
net.h
(6.96 KB)
📄
net.h.in
(6.96 KB)
📄
packet.h
(25.42 KB)
📄
parse.h
(5.49 KB)
📄
radix.h
(6.16 KB)
📄
rbtree.h
(7.33 KB)
📄
rdata.h
(11.94 KB)
📄
resolver.h
(24.4 KB)
📄
rr.h
(27.1 KB)
📄
rr_functions.h
(11.86 KB)
📄
sha1.h
(1.14 KB)
📄
sha2.h
(5.38 KB)
📄
str2host.h
(9.05 KB)
📄
tsig.h
(3.81 KB)
📄
update.h
(2.78 KB)
📄
util.h
(10.38 KB)
📄
util.h.in
(10.45 KB)
📄
wire2host.h
(7.02 KB)
📄
zone.h
(4.55 KB)
Editing: net.h.in
/* * net.h * * DNS Resolver definitions * * a Net::DNS like library for C * * (c) NLnet Labs, 2005-2006 * * See the file LICENSE for the license */ #ifndef LDNS_NET_H #define LDNS_NET_H #include <ldns/ldns.h> @include_sys_socket_h@ #ifdef __cplusplus extern "C" { #endif #define LDNS_DEFAULT_TIMEOUT_SEC 5 #define LDNS_DEFAULT_TIMEOUT_USEC 0 /** * \file * * Contains functions to send and receive packets over a network. */ /** * Sends a buffer to an ip using udp and return the respons as a ldns_pkt * \param[in] qbin the ldns_buffer to be send * \param[in] to the ip addr to send to * \param[in] tolen length of the ip addr * \param[in] timeout the timeout value for the network * \param[out] answersize size of the packet * \param[out] result packet with the answer * \return status */ 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); /** * Send an udp query and don't wait for an answer but return * the socket * \param[in] qbin the ldns_buffer to be send * \param[in] to the ip addr to send to * \param[in] tolen length of the ip addr * \param[in] timeout *unused*, was the timeout value for the network * \return the socket used */ int ldns_udp_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 * \param[in] qbin the ldns_buffer to be send * \param[in] to the ip addr to send to * \param[in] tolen length of the ip addr * \param[in] timeout the timeout value for the connect attempt * \return the socket used */ int ldns_tcp_bgsend(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout); /** * Sends a buffer to an ip using tcp and return the respons as a ldns_pkt * \param[in] qbin the ldns_buffer to be send * \param[in] qbin the ldns_buffer to be send * \param[in] to the ip addr to send to * \param[in] tolen length of the ip addr * \param[in] timeout the timeout value for the network * \param[out] answersize size of the packet * \param[out] result packet with the answer * \return status */ 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 ptk to the nameserver at the resolver object. Returns the data * as a ldns_pkt * * \param[out] pkt packet received from the nameserver * \param[in] r the resolver to use * \param[in] query_pkt the query to send * \return status */ ldns_status ldns_send(ldns_pkt **pkt, ldns_resolver *r, const ldns_pkt *query_pkt); /** * Sends and ldns_buffer (presumably containing a packet to the nameserver at the resolver object. Returns the data * as a ldns_pkt * * \param[out] pkt packet received from the nameserver * \param[in] r the resolver to use * \param[in] qb the buffer to send * \param[in] tsig_mac the tsig MAC to authenticate the response with (NULL to do no TSIG authentication) * \return status */ ldns_status ldns_send_buffer(ldns_pkt **pkt, ldns_resolver *r, ldns_buffer *qb, ldns_rdf *tsig_mac); /** * Create a tcp socket to the specified address * \param[in] to ip and family * \param[in] tolen length of to * \param[in] timeout timeout for the connect attempt * \return a socket descriptor */ int ldns_tcp_connect(const struct sockaddr_storage *to, socklen_t tolen, struct timeval timeout); /** * Create a udp socket to the specified address * \param[in] to ip and family * \param[in] timeout *unused*, was timeout for the socket * \return a socket descriptor */ int ldns_udp_connect(const struct sockaddr_storage *to, struct timeval timeout); /** * send a query via tcp to a server. Don't want for the answer * * \param[in] qbin the buffer to send * \param[in] sockfd the socket to use * \param[in] to which ip to send it * \param[in] tolen socketlen * \return number of bytes sent */ ssize_t ldns_tcp_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 * * \param[in] qbin the buffer to send * \param[in] sockfd the socket to use * \param[in] to which ip to send it * \param[in] tolen socketlen * \return number of bytes sent */ ssize_t ldns_udp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen); /** * 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 * * \param[in] sockfd the socket to read from * \param[out] size the number of bytes that are read * \param[in] timeout the time allowed between packets. * \return the data read */ uint8_t *ldns_tcp_read_wire_timeout(int sockfd, size_t *size, struct timeval timeout); /** * This routine may block. Use ldns_tcp_read_wire_timeout, it checks timeouts. * 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 * * \param[in] sockfd the socket to read from * \param[out] size the number of bytes that are read * \return the data read */ 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 * * \param[in] sockfd the socket to read from * \param[in] fr the address of the client (if applicable) * \param[in] *frlen the length of the client's addr (if applicable) * \param[out] size the number of bytes that are read * \return the data read */ uint8_t *ldns_udp_read_wire(int sockfd, size_t *size, struct sockaddr_storage *fr, socklen_t *frlen); /** * returns the native sockaddr representation from the rdf. * \param[in] rd the ldns_rdf to operate on * \param[in] port what port to use. 0 means; use default (53) * \param[out] size what is the size of the sockaddr_storage * \return struct sockaddr* the address in the format so other * functions can use it (sendto) */ struct sockaddr_storage * ldns_rdf2native_sockaddr_storage(const ldns_rdf *rd, uint16_t port, size_t *size); /** * returns an rdf with the sockaddr info. works for ip4 and ip6 * \param[in] sock the struct sockaddr_storage to convert * \param[in] port what port was used. When NULL this is not set * \return ldns_rdf* wth the address */ ldns_rdf * ldns_sockaddr_storage2rdf(const struct sockaddr_storage *sock, uint16_t *port); /** * Prepares the resolver for an axfr query * The query is sent and the answers can be read with ldns_axfr_next * \param[in] resolver the resolver to use * \param[in] domain the domain to exfr * \param[in] c the class to use * \return ldns_status the status of the transfer */ ldns_status ldns_axfr_start(ldns_resolver *resolver, const ldns_rdf *domain, ldns_rr_class c); #ifdef __cplusplus } #endif #endif /* LDNS_NET_H */
Upload File
Create Folder