diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2010-04-16 17:58:28 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-04-30 07:51:18 -0400 |
commit | 0d72f05cc87f42a8c2856c96501c64d69541be00 (patch) | |
tree | 4269b14e30621920dc63209e29c3176e9d163071 /src/providers/fail_over.h | |
parent | 3765c2f9d4ba8aeffe140a8c5ab88acd79c66768 (diff) | |
download | sssd-0d72f05cc87f42a8c2856c96501c64d69541be00.tar.gz sssd-0d72f05cc87f42a8c2856c96501c64d69541be00.tar.xz sssd-0d72f05cc87f42a8c2856c96501c64d69541be00.zip |
Support SRV servers in failover
Adds a new failover API call fo_add_srv_server that allows the caller
to specify a server that is later resolved into a list of specific
servers using SRV requests.
Also adds a new failover option that specifies how often should the
servers resolved from SRV query considered valid until we need a
refresh.
The "real" servers to connect to are returned to the user as usual,
using the fo_resolve_service_{send,recv} calls.
Make SRV resolution work with c-ares 1.6
Diffstat (limited to 'src/providers/fail_over.h')
-rw-r--r-- | src/providers/fail_over.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/providers/fail_over.h b/src/providers/fail_over.h index ffcd06877..70e694fee 100644 --- a/src/providers/fail_over.h +++ b/src/providers/fail_over.h @@ -30,6 +30,9 @@ #include "resolv/async_resolv.h" +#define FO_PROTO_TCP "tcp" +#define FO_PROTO_UDP "udp" + /* Some forward declarations that don't have to do anything with fail over. */ struct hostent; struct tevent_context; @@ -60,10 +63,14 @@ struct fo_server; * duration in seconds of how long a server or port will be considered * non-working after being marked as such. * + * The 'srv_retry_timeout' member specifies how long a SRV lookup + * is considered valid until we ask the server again. + * * The family_order member specifies the order of address families to * try when looking up the service. */ struct fo_options { + time_t srv_retry_timeout; time_t retry_timeout; enum restrict_family family_order; }; @@ -101,6 +108,13 @@ int fo_add_server(struct fo_service *service, int port, void *user_data); + +int fo_add_srv_server(struct fo_service *service, + const char *srv, + const char *domain, + const char *proto, + void *user_data); + /* * Request the first server from the service's list of servers. It is only * considered if it is not marked as not working (or the retry interval already |