summaryrefslogtreecommitdiffstats
path: root/src/providers/fail_over.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-02-22 10:28:26 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-02-22 12:54:53 -0500
commite0bb119bdc1549d731f371202428c0cb667d3388 (patch)
tree3c4edcfb90558ca95a36c6edafdf9a98f35474d0 /src/providers/fail_over.h
parent48dbc3c447449b9bb1a9b7c839b9471ef4f547bf (diff)
downloadsssd_unused-e0bb119bdc1549d731f371202428c0cb667d3388.tar.gz
sssd_unused-e0bb119bdc1549d731f371202428c0cb667d3388.tar.xz
sssd_unused-e0bb119bdc1549d731f371202428c0cb667d3388.zip
Restrict family lookups
Adds a new option that tells resolver which address family to prefer or use exclusively. Fixes: #404
Diffstat (limited to 'src/providers/fail_over.h')
-rw-r--r--src/providers/fail_over.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/providers/fail_over.h b/src/providers/fail_over.h
index f1184832..ffcd0687 100644
--- a/src/providers/fail_over.h
+++ b/src/providers/fail_over.h
@@ -28,9 +28,10 @@
#include <stdbool.h>
#include <talloc.h>
+#include "resolv/async_resolv.h"
+
/* Some forward declarations that don't have to do anything with fail over. */
struct hostent;
-struct resolv_ctx;
struct tevent_context;
struct tevent_req;
@@ -53,12 +54,26 @@ struct fo_service;
struct fo_server;
/*
- * Create a new fail over context. The 'retry_timeout' argument specifies the
+ * Failover settings.
+ *
+ * The 'retry_timeout' member specifies the
* duration in seconds of how long a server or port will be considered
* non-working after being marked as such.
+ *
+ * The family_order member specifies the order of address families to
+ * try when looking up the service.
+ */
+struct fo_options {
+ time_t retry_timeout;
+ enum restrict_family family_order;
+};
+
+/*
+ * Create a new fail over context based on options passed in the
+ * opts parameter
*/
struct fo_ctx *fo_context_init(TALLOC_CTX *mem_ctx,
- time_t retry_timeout);
+ struct fo_options *opts);
/*
* Create a new service structure for 'ctx', saving it to the location pointed
@@ -94,6 +109,7 @@ int fo_add_server(struct fo_service *service,
struct tevent_req *fo_resolve_service_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct resolv_ctx *resolv,
+ struct fo_ctx *ctx,
struct fo_service *service);
int fo_resolve_service_recv(struct tevent_req *req,