Commit 564e0a4e authored by Pekka Pessi's avatar Pekka Pessi

Added prerequisite #includes to sresolv files.

Added @todo about cache poisoning.

darcs-hash:20060411214054-65a35-fac41d43b69fd402ca24fbeb9233a65af6408fc4.gz
parent b6e4a74e
......@@ -48,8 +48,6 @@ typedef unsigned _int32 uint32_t;
#endif
#if HAVE_NETINET_IN_H
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif
......
......@@ -45,8 +45,6 @@ typedef unsigned _int32 uint32_t;
#endif
#if HAVE_NETINET_IN_H
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif
......
......@@ -45,10 +45,7 @@ typedef unsigned _int16 uint16_t;
typedef unsigned _int32 uint32_t;
#endif
#endif
#if HAVE_NETINET_IN_H
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif
......
......@@ -21,24 +21,23 @@ The application can either explicitly poll(2) or select(2) on file
descriptors used by resolver and call the driver functions, or it can use
@ref su_root_t "su root" a pointer to a su_root_t object.
There is an internal cache used by sresolv. The query functions add records
to the cache: using the cache is made similar as if receiving entries from
DNS server.
There is an internal cache used by sresolv. The query functions add
records to the cache: using the cache is made similar as if receiving
entries directly from DNS server.
@code
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sresolv.h>
#include <sofia-resolv/sres.h>
sres_resolver_t *sres_resolver_new(char const *resolv_conf_path);
sres_resolver_t *sres_resolver_ref(sres_resolver_t *res);
void sres_resolver_unref(sres_resolver_t *res);
int sres_resolver_add_mutex(sres_resolver_t *res,
void *mutex,
int (*lock)(void *mutex),
int (*unlock)(void *mutex));
sres_resolver_t *sres_resolver_copy(sres_resolver_t *);
void *sres_resolver_set_userdata(sres_resolver_t *res, void *userdata);
void *sres_resolver_get_userdata(sres_resolver_t const *res);
......@@ -49,19 +48,19 @@ void sres_resolver_timer(sres_resolver_t *, int socket);
int sres_resolver_receive(sres_resolver_t *res, int socket);
int sres_resolver_error(sres_resolver_t *res, int socket);
sres_query_t *sres_query_make(sres_resolver_t *res,
sres_answer_f *callback,
sres_context_t *context,
int socket,
uint16_t type,
char const *domain);
sres_query_t *sres_query(sres_resolver_t *res,
sres_answer_f *callback,
sres_context_t *context,
int socket,
uint16_t type,
char const *domain);
sres_query_t *sres_query_make_sockaddr(sres_resolver_t *res,
sres_answer_f *callback,
sres_context_t *context,
int socket,
uint16_t type,
struct sockaddr const *addr);
sres_query_t *sres_query_sockaddr(sres_resolver_t *res,
sres_answer_f *callback,
sres_context_t *context,
int socket,
uint16_t type,
struct sockaddr const *addr);
void sres_query_bind(sres_query_t *q,
sres_answer_f *callback,
......@@ -86,5 +85,9 @@ void sres_free_answer(sres_resolver_t *res, sres_record_t *answer);
@endcode
@todo Caching polioxy and Cache Poisoning
The policy for caching non-authoritave entries should be solved.
*/
......@@ -46,11 +46,8 @@ typedef unsigned _int32 uint32_t;
#endif
#if HAVE_NETINET_IN_H
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#if HAVE_WINSOCK2_H
#include <winsock2.h>
#include <ws2tcpip.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment