summaryrefslogtreecommitdiffstats
path: root/src/util/dlinklist.h
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-04-16 17:58:28 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-04-30 07:51:18 -0400
commit0d72f05cc87f42a8c2856c96501c64d69541be00 (patch)
tree4269b14e30621920dc63209e29c3176e9d163071 /src/util/dlinklist.h
parent3765c2f9d4ba8aeffe140a8c5ab88acd79c66768 (diff)
downloadsssd-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/util/dlinklist.h')
-rw-r--r--src/util/dlinklist.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/dlinklist.h b/src/util/dlinklist.h
index be5ff914..f323de70 100644
--- a/src/util/dlinklist.h
+++ b/src/util/dlinklist.h
@@ -110,6 +110,22 @@ do { \
} \
} while (0)
+/* insert all elements from list2 after the given element 'el' in the
+ * first list */
+#define DLIST_ADD_LIST_AFTER(list1, el, list2, type) \
+do { \
+ if (!(list1) || !(el) || !(list2)) { \
+ DLIST_CONCATENATE(list1, list2, type); \
+ } else { \
+ type tmp; \
+ for (tmp = (list2); tmp->next; tmp = tmp->next) ; \
+ (list2)->prev = (el); \
+ tmp->next = (el)->next; \
+ (el)->next = (list2); \
+ if ((el)->next != NULL) (el)->next->prev = tmp; \
+ } \
+} while (0);
+
#define DLIST_FOR_EACH(p, list) \
for ((p) = (list); (p) != NULL; (p) = (p)->next)