summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2016-01-19 15:05:03 +0100
committerJakub Hrozek <jhrozek@redhat.com>2016-01-19 17:42:23 +0100
commit7fdec78178440855058be8ca1011e0b1aa45de31 (patch)
treedd5aab00c23618bdcae9f63b33862bfce5c7c788 /src/providers
parent5a7f17aedad34a8618765bc33342c109a6958ab5 (diff)
downloadsssd-7fdec78178440855058be8ca1011e0b1aa45de31.tar.gz
sssd-7fdec78178440855058be8ca1011e0b1aa45de31.tar.xz
sssd-7fdec78178440855058be8ca1011e0b1aa45de31.zip
FO: add be_fo_get_active_server_name()
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/data_provider_fo.c17
-rw-r--r--src/providers/dp_backend.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c
index 4c4d7b23..39f57255 100644
--- a/src/providers/data_provider_fo.c
+++ b/src/providers/data_provider_fo.c
@@ -726,6 +726,23 @@ void be_fo_try_next_server(struct be_ctx *ctx, const char *service_name)
}
}
+const char *be_fo_get_active_server_name(struct be_ctx *ctx,
+ const char *service_name)
+{
+ struct be_svc_data *svc;
+ struct fo_server *server;
+
+ svc = be_fo_find_svc_data(ctx, service_name);
+ if (svc != NULL) {
+ server = fo_get_active_server(svc->fo_service);
+ if (server != NULL) {
+ return fo_get_server_name(server);
+ }
+ }
+
+ return NULL;
+}
+
int be_fo_run_callbacks_at_next_request(struct be_ctx *ctx,
const char *service_name)
{
diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h
index cfd8b8aa..e6e2d0f3 100644
--- a/src/providers/dp_backend.h
+++ b/src/providers/dp_backend.h
@@ -287,6 +287,9 @@ int be_fo_run_callbacks_at_next_request(struct be_ctx *ctx,
void reset_fo(struct be_ctx *be_ctx);
void be_fo_reset_svc(struct be_ctx *be_ctx, const char *svc_name);
+const char *be_fo_get_active_server_name(struct be_ctx *ctx,
+ const char *service_name);
+
errno_t be_res_init(struct be_ctx *ctx);
/* be_req helpers */