summaryrefslogtreecommitdiff
path: root/server/responder/common
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-10 16:58:31 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-11 12:29:36 -0400
commit06a3b13134e29b75971970aa45ba14576a4f6ced (patch)
tree32c82e27f6020dad8134d80d09d22d6d94cbd5b1 /server/responder/common
parent38268cfc515e1f136cabfbcc9a620a2d9c929cda (diff)
downloadsssd-06a3b13134e29b75971970aa45ba14576a4f6ced.tar.gz
sssd-06a3b13134e29b75971970aa45ba14576a4f6ced.tar.bz2
sssd-06a3b13134e29b75971970aa45ba14576a4f6ced.zip
Change services identification mechanism
Let services identify themselves voiluntarily as the first operation instead of polling from the monitor. Also consolidate some common functions and make them available as monitor helpers.
Diffstat (limited to 'server/responder/common')
-rw-r--r--server/responder/common/responder.h2
-rw-r--r--server/responder/common/responder_common.c16
2 files changed, 14 insertions, 4 deletions
diff --git a/server/responder/common/responder.h b/server/responder/common/responder.h
index 0f090831..f4187650 100644
--- a/server/responder/common/responder.h
+++ b/server/responder/common/responder.h
@@ -102,6 +102,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
const char *sss_pipe_name,
const char *sss_priv_pipe_name,
const char *confdb_service_path,
+ const char *svc_name,
+ uint16_t svc_version,
struct sbus_interface *dp_intf,
struct sbus_interface *monitor_intf,
struct resp_ctx **responder_ctx);
diff --git a/server/responder/common/responder_common.c b/server/responder/common/responder_common.c
index f3df7c65..75e72103 100644
--- a/server/responder/common/responder_common.c
+++ b/server/responder/common/responder_common.c
@@ -286,7 +286,9 @@ static void accept_fd_handler(struct tevent_context *ev,
}
static int sss_monitor_init(struct resp_ctx *rctx,
- struct sbus_interface *intf)
+ struct sbus_interface *intf,
+ const char *svc_name,
+ uint16_t svc_version)
{
char *sbus_address;
int ret;
@@ -306,8 +308,12 @@ static int sss_monitor_init(struct resp_ctx *rctx,
return ret;
}
- /* Set up NSS-specific listeners */
- /* None currently used */
+ /* Identify ourselves to the monitor */
+ ret = monitor_common_send_id(rctx->mon_conn, svc_name, svc_version);
+ if (ret != EOK) {
+ DEBUG(0, ("Failed to identify to the monitor!\n"));
+ return ret;
+ }
return EOK;
}
@@ -447,6 +453,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
const char *sss_pipe_name,
const char *sss_priv_pipe_name,
const char *confdb_service_path,
+ const char *svc_name,
+ uint16_t svc_version,
struct sbus_interface *dp_intf,
struct sbus_interface *monitor_intf,
struct resp_ctx **responder_ctx)
@@ -472,7 +480,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
return ret;
}
- ret = sss_monitor_init(rctx, monitor_intf);
+ ret = sss_monitor_init(rctx, monitor_intf, svc_name, svc_version);
if (ret != EOK) {
DEBUG(0, ("fatal error setting up message bus\n"));
return ret;