summaryrefslogtreecommitdiffstats
path: root/src/resolv/async_resolv.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-06-10 14:05:45 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-06-15 15:56:13 -0400
commit1240496176a07e804c57d43926509d5ccbf0fc41 (patch)
treef74391b6ad92996ba24fe23e09122a7452aa2e16 /src/resolv/async_resolv.h
parent3d334807f302603b81996b41f2a365ce75f36d17 (diff)
downloadsssd-1240496176a07e804c57d43926509d5ccbf0fc41.tar.gz
sssd-1240496176a07e804c57d43926509d5ccbf0fc41.tar.xz
sssd-1240496176a07e804c57d43926509d5ccbf0fc41.zip
Switch resolver to using resolv_hostent and honor TTL
Diffstat (limited to 'src/resolv/async_resolv.h')
-rw-r--r--src/resolv/async_resolv.h56
1 files changed, 31 insertions, 25 deletions
diff --git a/src/resolv/async_resolv.h b/src/resolv/async_resolv.h
index 00e1bdfb2..907865f7a 100644
--- a/src/resolv/async_resolv.h
+++ b/src/resolv/async_resolv.h
@@ -57,6 +57,29 @@ void resolv_reread_configuration(void);
const char *resolv_strerror(int ares_code);
+struct resolv_hostent *
+resolv_copy_hostent(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);
+
+/** Get host by name **/
+enum host_database {
+ DB_FILES,
+ DB_DNS,
+
+ DB_SENTINEL
+};
+
+enum restrict_family {
+ IPV4_ONLY,
+ IPV4_FIRST,
+ IPV6_ONLY,
+ IPV6_FIRST
+};
+
/* 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
@@ -74,39 +97,22 @@ struct resolv_hostent {
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);
-
-/** Get host by name **/
-enum restrict_family {
- IPV4_ONLY,
- IPV4_FIRST,
- IPV6_ONLY,
- IPV6_FIRST
-};
+/* The default database order */
+extern enum host_database default_host_dbs[];
struct tevent_req *resolv_gethostbyname_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct resolv_ctx *ctx,
const char *name,
- enum restrict_family family_order);
+ enum restrict_family family_order,
+ enum host_database *db);
-int resolv_gethostbyname_recv(struct tevent_req *req,
- TALLOC_CTX *mem_ctx,
- int *status,
- int *timeouts,
- struct hostent **hostent);
+int resolv_gethostbyname_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ int *status, int *timeouts,
+ struct resolv_hostent **rhostent);
char *
-resolv_get_string_address(TALLOC_CTX *mem_ctx, struct hostent *hostent);
+resolv_get_string_address(TALLOC_CTX *mem_ctx, struct resolv_hostent *hostent);
/** Get SRV record **/
struct tevent_req *resolv_getsrv_send(TALLOC_CTX *mem_ctx,