diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-06-10 14:05:45 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-06-30 14:07:37 -0400 |
commit | 604c27c21d6488066c398fbce3e1f57a0847fd78 (patch) | |
tree | a19cc47daaba8e69f8f97914405e2002c0b5a13e /src/resolv/async_resolv.h | |
parent | 068b1feac5c116e716643d6364fea51440f9fc89 (diff) | |
download | sssd_unused-604c27c21d6488066c398fbce3e1f57a0847fd78.tar.gz sssd_unused-604c27c21d6488066c398fbce3e1f57a0847fd78.tar.xz sssd_unused-604c27c21d6488066c398fbce3e1f57a0847fd78.zip |
Switch resolver to using resolv_hostent and honor TTL
Conflicts:
src/providers/fail_over.c
Diffstat (limited to 'src/resolv/async_resolv.h')
-rw-r--r-- | src/resolv/async_resolv.h | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/src/resolv/async_resolv.h b/src/resolv/async_resolv.h index 00e1bdfb..907865f7 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, |