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-15 15:56:12 -0400
commit58bddcfd77bf21290c42321dbf314b9e1f532e81 (patch)
tree47cf27e66dd3422184ee5cddcc25f3de27b24421 /src/resolv/async_resolv.h
parent4a305e734e2fb34905e62eecb4282bb87ebc5f24 (diff)
downloadsssd_unused-58bddcfd77bf21290c42321dbf314b9e1f532e81.tar.gz
sssd_unused-58bddcfd77bf21290c42321dbf314b9e1f532e81.tar.xz
sssd_unused-58bddcfd77bf21290c42321dbf314b9e1f532e81.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 d6cbe149..00e1bdfb 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);