summaryrefslogtreecommitdiffstats
path: root/src/resolv/async_resolv.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-06-10 14:01:17 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-06-30 14:07:37 -0400
commit034f83783ec3b261e60ad08c4ebac4dc610b5853 (patch)
tree12b8571039962a1f00d51fb54cd08d96b14c990a /src/resolv/async_resolv.h
parentdedabcb09a893cd1e70d3727343fbfa2c02e4548 (diff)
downloadsssd-034f83783ec3b261e60ad08c4ebac4dc610b5853.tar.gz
sssd-034f83783ec3b261e60ad08c4ebac4dc610b5853.tar.xz
sssd-034f83783ec3b261e60ad08c4ebac4dc610b5853.zip
Add new resolv_hostent data structure and utility functions
Diffstat (limited to 'src/resolv/async_resolv.h')
-rw-r--r--src/resolv/async_resolv.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/resolv/async_resolv.h b/src/resolv/async_resolv.h
index d6cbe1494..00e1bdfb2 100644
--- a/src/resolv/async_resolv.h
+++ b/src/resolv/async_resolv.h
@@ -37,6 +37,10 @@
#include "resolv/ares/ares_data.h"
#endif /* HAVE_ARES_DATA */
+#ifndef RESOLV_DEFAULT_TTL
+#define RESOLV_DEFAULT_TTL 7200
+#endif /* RESOLV_DEFAULT_TTL */
+
/*
* An opaque structure which holds context for a module using the async
* resolver. Is should be used as a "local-global" variable - in sssd,
@@ -53,6 +57,31 @@ void resolv_reread_configuration(void);
const char *resolv_strerror(int ares_code);
+/* If resolv_hostent->family is AF_INET, then ipaddr points to
+ * struct in_addr, else if family is AF_INET6, ipaddr points to
+ * struct in6_addr
+ */
+struct resolv_addr {
+ uint8_t *ipaddr;
+ int ttl;
+};
+
+struct resolv_hostent {
+ char *name; /* official name of host */
+ char **aliases; /* alias list */
+ int family; /* host address type */
+
+ struct resolv_addr **addr_list; /* list of addresses */
+};
+
+struct resolv_hostent *
+resolv_copy_hostent2(TALLOC_CTX *mem_ctx, struct hostent *src);
+
+struct resolv_hostent *
+resolv_copy_hostent_ares(TALLOC_CTX *mem_ctx, struct hostent *src,
+ int family, void *ares_ttl_data,
+ int num_ares_ttl_data);
+
struct hostent *resolv_copy_hostent(TALLOC_CTX *mem_ctx,
struct hostent *src);