From 0d72f05cc87f42a8c2856c96501c64d69541be00 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 16 Apr 2010 17:58:28 +0200 Subject: 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 --- src/providers/fail_over.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/providers/fail_over.h') diff --git a/src/providers/fail_over.h b/src/providers/fail_over.h index ffcd0687..70e694fe 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 -- cgit