summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-08-05 06:51:07 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-10 09:42:19 -0400
commit0c7050d8569ce7ee61b13d02b4733249a11e171f (patch)
treeab51d15a42dd2049d5a55eed8dbd79945e119050 /server/providers
parent2b0f40eaba44742fa38bb5b67ada510e7b2b6324 (diff)
downloadsssd-0c7050d8569ce7ee61b13d02b4733249a11e171f.tar.gz
sssd-0c7050d8569ce7ee61b13d02b4733249a11e171f.tar.bz2
sssd-0c7050d8569ce7ee61b13d02b4733249a11e171f.zip
Cosmetic changes
Rationalize and rename connection names in preparatoin for merging of server and connection structures.
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/data_provider.c124
-rw-r--r--server/providers/data_provider_be.c82
-rw-r--r--server/providers/dp_backend.h4
3 files changed, 105 insertions, 105 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index 6a19247f..29bfe946 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -62,7 +62,7 @@ struct dp_ctx {
struct dp_client {
struct dp_ctx *dpctx;
- struct sbus_conn_ctx *conn_ctx;
+ struct sbus_connection *conn;
};
struct dp_backend {
@@ -84,10 +84,10 @@ struct dp_frontend {
static int dp_backend_destructor(void *ctx);
static int dp_frontend_destructor(void *ctx);
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn);
+static int service_identity(DBusMessage *message, struct sbus_connection *conn);
+static int service_pong(DBusMessage *message, struct sbus_connection *conn);
+static int service_reload(DBusMessage *message, struct sbus_connection *conn);
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn);
struct sbus_method mon_sbus_methods[] = {
{ SERVICE_METHOD_IDENTITY, service_identity },
@@ -97,8 +97,8 @@ struct sbus_method mon_sbus_methods[] = {
{ NULL, NULL }
};
-static int dp_get_account_info(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int dp_pamhandler(DBusMessage *message, struct sbus_conn_ctx *sconn);
+static int dp_get_account_info(DBusMessage *message, struct sbus_connection *conn);
+static int dp_pamhandler(DBusMessage *message, struct sbus_connection *conn);
struct sbus_method dp_sbus_methods[] = {
{ DP_SRV_METHOD_GETACCTINFO, dp_get_account_info },
@@ -120,7 +120,7 @@ struct dp_be_request {
struct dp_backend *be;
};
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = DATA_PROVIDER_VERSION;
const char *name = DATA_PROVIDER_SERVICE_NAME;
@@ -142,13 +142,13 @@ static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_pong(DBusMessage *message, struct sbus_connection *conn)
{
DBusMessage *reply;
dbus_bool_t ret;
@@ -163,13 +163,13 @@ static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_reload(DBusMessage *message, struct sbus_connection *conn)
{
/* Monitor calls this function when we need to reload
* our configuration information. Perform whatever steps
@@ -177,10 +177,10 @@ static int service_reload(DBusMessage *message, struct sbus_conn_ctx *sconn)
*/
/* Send an empty reply to acknowledge receipt */
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn)
{
int ret;
@@ -189,12 +189,12 @@ static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
return EIO;
}
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
static int dp_monitor_init(struct dp_ctx *dpctx)
{
- struct sbus_conn_ctx *conn_ctx;
+ struct sbus_connection *conn;
struct sbus_method_ctx *sm_ctx;
char *sbus_address;
int ret;
@@ -219,7 +219,7 @@ static int dp_monitor_init(struct dp_ctx *dpctx)
}
ret = sbus_client_init(dpctx, dpctx->ev, sm_ctx,
- sbus_address, &conn_ctx,
+ sbus_address, &conn,
NULL, NULL);
if (ret != EOK) {
DEBUG(0, ("Failed to connect to monitor services.\n"));
@@ -235,33 +235,33 @@ static int dp_monitor_init(struct dp_ctx *dpctx)
static void be_identity_check(DBusPendingCall *pending, void *data);
static void be_got_account_info(DBusPendingCall *pending, void *data);
-static int dbus_dp_init(struct sbus_conn_ctx *conn_ctx, void *data)
+static int dbus_dp_init(struct sbus_connection *conn, void *data)
{
struct dp_ctx *dpctx;
struct dp_client *dpcli;
DBusMessage *msg;
DBusPendingCall *pending_reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t dbret;
dpctx = talloc_get_type(data, struct dp_ctx);
- conn = sbus_get_connection(conn_ctx);
+ dbus_conn = sbus_get_connection(conn);
/* hang off this memory to the connection so that when the connection
* is freed we can potentially call a destructor */
- dpcli = talloc(conn_ctx, struct dp_client);
+ dpcli = talloc(conn, struct dp_client);
if (!dpcli) {
DEBUG(0,("Out of memory?!\n"));
- talloc_free(conn_ctx);
+ talloc_free(conn);
return ENOMEM;
}
dpcli->dpctx = dpctx;
- dpcli->conn_ctx = conn_ctx;
+ dpcli->conn = conn;
/* Attach the client context to the connection context, so that it is
* always available when we need to manage the connection. */
- sbus_conn_set_private_data(conn_ctx, dpcli);
+ sbus_conn_set_private_data(conn, dpcli);
/* identify the connecting client */
msg = dbus_message_new_method_call(NULL,
@@ -270,10 +270,10 @@ static int dbus_dp_init(struct sbus_conn_ctx *conn_ctx, void *data)
DP_CLI_METHOD_IDENTITY);
if (msg == NULL) {
DEBUG(0,("Out of memory?!\n"));
- talloc_free(conn_ctx);
+ talloc_free(conn);
return ENOMEM;
}
- dbret = dbus_connection_send_with_reply(conn, msg, &pending_reply,
+ dbret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply,
600000 /* TODO: set timeout */);
if (!dbret || pending_reply == NULL) {
/*
@@ -282,7 +282,7 @@ static int dbus_dp_init(struct sbus_conn_ctx *conn_ctx, void *data)
* We'll drop it using the default destructor.
*/
DEBUG(0, ("D-BUS send failed.\n"));
- talloc_free(conn_ctx);
+ talloc_free(conn);
dbus_message_unref(msg);
return EIO;
}
@@ -300,7 +300,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
struct dp_frontend *dpfe;
struct dp_client *dpcli;
DBusMessage *reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
DBusError dbus_error;
dbus_uint16_t cli_ver;
dbus_uint16_t cli_type;
@@ -310,7 +310,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
int type;
dpcli = talloc_get_type(data, struct dp_client);
- conn = sbus_get_connection(dpcli->conn_ctx);
+ dbus_conn = sbus_get_connection(dpcli->conn);
dbus_error_init(&dbus_error);
reply = dbus_pending_call_steal_reply(pending);
@@ -322,7 +322,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
DEBUG(0, ("Severe error. A reply callback was called but no reply was received and no timeout occurred\n"));
/* Destroy this connection */
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
@@ -338,7 +338,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
if (!ret) {
DEBUG(1,("be_identity_check failed, to parse message, killing connection\n"));
if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error);
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
@@ -347,7 +347,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
dpbe = talloc_zero(dpcli->dpctx, struct dp_backend);
if (!dpbe) {
DEBUG(0, ("Out of memory!\n"));
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
@@ -355,7 +355,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
dpbe->domain = talloc_strdup(dpbe, cli_domain);
if (!dpbe->name || !dpbe->domain) {
DEBUG(0, ("Out of memory!\n"));
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
@@ -373,14 +373,14 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
dpfe = talloc_zero(dpcli->dpctx, struct dp_frontend);
if (!dpfe) {
DEBUG(0, ("Out of memory!\n"));
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
dpfe->name = talloc_strdup(dpfe, cli_name);
if (!dpfe->name) {
DEBUG(0, ("Out of memory!\n"));
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
@@ -395,7 +395,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
default:
DEBUG(1, ("Unknown client type, killing connection\n"));
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
goto done;
}
@@ -414,7 +414,7 @@ static void be_identity_check(DBusPendingCall *pending, void *data)
* know that this connection isn't trustworthy.
* We'll destroy it now.
*/
- sbus_disconnect(dpcli->conn_ctx);
+ sbus_disconnect(dpcli->conn);
}
done:
@@ -426,7 +426,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data)
{
struct dp_be_request *bereq;
DBusMessage *reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
DBusError dbus_error;
dbus_uint16_t err_maj = 0;
dbus_uint32_t err_min = 0;
@@ -446,7 +446,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data)
DEBUG(0, ("Severe error. A reply callback was called but no reply was received and no timeout occurred\n"));
/* Destroy this connection */
- sbus_disconnect(bereq->be->dpcli->conn_ctx);
+ sbus_disconnect(bereq->be->dpcli->conn);
goto done;
}
@@ -461,7 +461,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data)
if (!ret) {
DEBUG(1,("Failed to parse message, killing connection\n"));
if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error);
- sbus_disconnect(bereq->be->dpcli->conn_ctx);
+ sbus_disconnect(bereq->be->dpcli->conn);
goto done;
}
@@ -483,7 +483,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data)
* know that this connection isn't trustworthy.
* We'll destroy it now.
*/
- sbus_disconnect(bereq->be->dpcli->conn_ctx);
+ sbus_disconnect(bereq->be->dpcli->conn);
}
if (err_maj) {
@@ -496,7 +496,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data)
bereq->req->pending_replies--;
talloc_free(bereq);
} else {
- conn = sbus_get_connection(bereq->req->src_cli->conn_ctx);
+ dbus_conn = sbus_get_connection(bereq->req->src_cli->conn);
err_maj = 0;
err_min = 0;
err_msg = "Success";
@@ -512,7 +512,7 @@ static void be_got_account_info(DBusPendingCall *pending, void *data)
}
/* finally send it */
- dbus_connection_send(conn, bereq->req->reply, NULL);
+ dbus_connection_send(dbus_conn, bereq->req->reply, NULL);
dbus_message_unref(bereq->req->reply);
talloc_free(bereq->req);
}
@@ -527,10 +527,10 @@ static int dp_send_acct_req(struct dp_be_request *bereq,
{
DBusMessage *msg;
DBusPendingCall *pending_reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t ret;
- conn = sbus_get_connection(bereq->be->dpcli->conn_ctx);
+ dbus_conn = sbus_get_connection(bereq->be->dpcli->conn);
/* create the message */
msg = dbus_message_new_method_call(NULL,
@@ -554,7 +554,7 @@ static int dp_send_acct_req(struct dp_be_request *bereq,
return EIO;
}
- ret = dbus_connection_send_with_reply(conn, msg, &pending_reply,
+ ret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply,
600000 /* TODO: set timeout */);
if (!ret || pending_reply == NULL) {
/*
@@ -575,7 +575,7 @@ static int dp_send_acct_req(struct dp_be_request *bereq,
return EOK;
}
-static int dp_get_account_info(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int dp_get_account_info(DBusMessage *message, struct sbus_connection *conn)
{
struct dp_client *dpcli;
struct dp_be_request *bereq;
@@ -590,7 +590,7 @@ static int dp_get_account_info(DBusMessage *message, struct sbus_conn_ctx *sconn
const char *errmsg = NULL;
int dpret = 0, ret = 0;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
dpcli = talloc_get_type(user_data, struct dp_client);
if (!dpcli) return EINVAL;
@@ -733,7 +733,7 @@ respond:
if (!dbret) return EIO;
/* send reply back immediately */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
@@ -743,7 +743,7 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data)
{
struct dp_be_request *bereq;
DBusMessage *reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
DBusError dbus_error;
dbus_bool_t ret;
struct pam_data *pd = NULL;
@@ -761,7 +761,7 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data)
DEBUG(0, ("Severe error. A reply callback was called but no reply was received and no timeout occurred\n"));
/* Destroy this connection */
- sbus_disconnect(bereq->be->dpcli->conn_ctx);
+ sbus_disconnect(bereq->be->dpcli->conn);
goto done;
}
@@ -773,7 +773,7 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data)
if (!ret) {
DEBUG(1,("Failed to parse message, killing connection\n"));
if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error);
- sbus_disconnect(bereq->be->dpcli->conn_ctx);
+ sbus_disconnect(bereq->be->dpcli->conn);
pd->pam_status = PAM_SYSTEM_ERR;
pd->domain = talloc_strdup(pd, "");
goto done;
@@ -797,11 +797,11 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data)
* We'll destroy it now.
*/
DEBUG(1,("Maybe timeout?\n"));
- sbus_disconnect(bereq->be->dpcli->conn_ctx);
+ sbus_disconnect(bereq->be->dpcli->conn);
goto done;
}
- conn = sbus_get_connection(bereq->req->src_cli->conn_ctx);
+ dbus_conn = sbus_get_connection(bereq->req->src_cli->conn);
ret = dp_pack_pam_response(bereq->req->reply, pd);
if (!ret) {
@@ -811,7 +811,7 @@ static void be_got_pam_reply(DBusPendingCall *pending, void *data)
}
/* finally send it */
- dbus_connection_send(conn, bereq->req->reply, NULL);
+ dbus_connection_send(dbus_conn, bereq->req->reply, NULL);
dbus_message_unref(bereq->req->reply);
talloc_free(bereq->req);
@@ -824,10 +824,10 @@ static int dp_call_pamhandler(struct dp_be_request *bereq, struct pam_data *pd)
{
DBusMessage *msg;
DBusPendingCall *pending_reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t ret;
- conn = sbus_get_connection(bereq->be->dpcli->conn_ctx);
+ dbus_conn = sbus_get_connection(bereq->be->dpcli->conn);
/* create the message */
msg = dbus_message_new_method_call(NULL,
@@ -848,8 +848,8 @@ static int dp_call_pamhandler(struct dp_be_request *bereq, struct pam_data *pd)
return EIO;
}
- ret = dbus_connection_send_with_reply(conn, msg, &pending_reply,
- 600000 /* TODO: set timeout */);
+ ret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply,
+ 600000 /* TODO: set timeout */);
if (!ret || pending_reply == NULL) {
/*
* Critical Failure
@@ -869,7 +869,7 @@ static int dp_call_pamhandler(struct dp_be_request *bereq, struct pam_data *pd)
return EOK;
}
-static int dp_pamhandler(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int dp_pamhandler(DBusMessage *message, struct sbus_connection *conn)
{
DBusMessage *reply;
DBusError dbus_error;
@@ -884,7 +884,7 @@ static int dp_pamhandler(DBusMessage *message, struct sbus_conn_ctx *sconn)
int pam_status=PAM_SUCCESS;
int domain_found=0;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
dpcli = talloc_get_type(user_data, struct dp_client);
if (!dpcli) return EINVAL;
@@ -964,7 +964,7 @@ respond:
if (!dbret) return EIO;
/* send reply back immediately */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
talloc_free(pd);
diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c
index d5cd6dd0..7db2047f 100644
--- a/server/providers/data_provider_be.c
+++ b/server/providers/data_provider_be.c
@@ -54,9 +54,9 @@
#define BE_CONF_ENTRY "config/domains/%s"
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn);
+static int service_identity(DBusMessage *message, struct sbus_connection *conn);
+static int service_pong(DBusMessage *message, struct sbus_connection *conn);
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn);
struct sbus_method mon_sbus_methods[] = {
{ SERVICE_METHOD_IDENTITY, service_identity },
@@ -65,10 +65,10 @@ struct sbus_method mon_sbus_methods[] = {
{ NULL, NULL }
};
-static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int be_check_online(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int be_get_account_info(DBusMessage *message, struct sbus_conn_ctx *sconn);
-static int be_pam_handler(DBusMessage *message, struct sbus_conn_ctx *sconn);
+static int be_identity(DBusMessage *message, struct sbus_connection *conn);
+static int be_check_online(DBusMessage *message, struct sbus_connection *conn);
+static int be_get_account_info(DBusMessage *message, struct sbus_connection *conn);
+static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn);
struct sbus_method be_methods[] = {
{ DP_CLI_METHOD_IDENTITY, be_identity },
@@ -89,7 +89,7 @@ static struct bet_data bet_data[] = {
-static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = DATA_PROVIDER_VERSION;
struct be_ctx *ctx;
@@ -97,7 +97,7 @@ static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
dbus_bool_t ret;
void *user_data;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
@@ -117,13 +117,13 @@ static int service_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_pong(DBusMessage *message, struct sbus_connection *conn)
{
DBusMessage *reply;
dbus_bool_t ret;
@@ -138,13 +138,13 @@ static int service_pong(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
}
-static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int service_res_init(DBusMessage *message, struct sbus_connection *conn)
{
int ret;
@@ -153,10 +153,10 @@ static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn)
return EIO;
}
- return service_pong(message, sconn);
+ return service_pong(message, conn);
}
-static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int be_identity(DBusMessage *message, struct sbus_connection *conn)
{
dbus_uint16_t version = DATA_PROVIDER_VERSION;
dbus_uint16_t clitype = DP_CLI_BACKEND;
@@ -165,7 +165,7 @@ static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
dbus_bool_t ret;
void *user_data;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
@@ -188,7 +188,7 @@ static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn)
}
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
@@ -244,7 +244,7 @@ static void online_chk_callback(struct be_req *req, int status,
{
struct be_online_req *oreq;
DBusMessage *reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t dbret;
dbus_uint16_t online;
dbus_uint16_t err_maj = 0;
@@ -274,8 +274,8 @@ static void online_chk_callback(struct be_req *req, int status,
return;
}
- conn = sbus_get_connection(req->be_ctx->dp_conn_ctx);
- dbus_connection_send(conn, reply, NULL);
+ dbus_conn = sbus_get_connection(req->be_ctx->dp_conn);
+ dbus_connection_send(dbus_conn, reply, NULL);
dbus_message_unref(reply);
DEBUG(4, ("Request processed. Returned %d,%d,%s\n",
@@ -286,7 +286,7 @@ static void online_chk_callback(struct be_req *req, int status,
}
-static int be_check_online(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int be_check_online(DBusMessage *message, struct sbus_connection *conn)
{
struct be_online_req *req;
struct be_req *be_req;
@@ -300,7 +300,7 @@ static int be_check_online(DBusMessage *message, struct sbus_conn_ctx *sconn)
dbus_uint32_t err_min;
const char *err_msg;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
@@ -358,7 +358,7 @@ done:
if (!dbret) return EIO;
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
@@ -369,7 +369,7 @@ static void acctinfo_callback(struct be_req *req, int status,
const char *errstr)
{
DBusMessage *reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t dbret;
dbus_uint16_t err_maj = 0;
dbus_uint32_t err_min = 0;
@@ -393,8 +393,8 @@ static void acctinfo_callback(struct be_req *req, int status,
return;
}
- conn = sbus_get_connection(req->be_ctx->dp_conn_ctx);
- dbus_connection_send(conn, reply, NULL);
+ dbus_conn = sbus_get_connection(req->be_ctx->dp_conn);
+ dbus_connection_send(dbus_conn, reply, NULL);
dbus_message_unref(reply);
DEBUG(4, ("Request processed. Returned %d,%d,%s\n",
@@ -404,7 +404,7 @@ static void acctinfo_callback(struct be_req *req, int status,
talloc_free(req);
}
-static int be_get_account_info(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int be_get_account_info(DBusMessage *message, struct sbus_connection *conn)
{
struct be_acct_req *req;
struct be_req *be_req;
@@ -424,7 +424,7 @@ static int be_get_account_info(DBusMessage *message, struct sbus_conn_ctx *sconn
be_req = NULL;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
@@ -536,7 +536,7 @@ done:
err_maj, err_min, err_msg));
/* send reply back */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
return EOK;
@@ -546,7 +546,7 @@ static void be_pam_handler_callback(struct be_req *req, int status,
const char *errstr) {
struct pam_data *pd;
DBusMessage *reply;
- DBusConnection *conn;
+ DBusConnection *dbus_conn;
dbus_bool_t dbret;
pd = talloc_get_type(req->req_data, struct pam_data);
@@ -559,8 +559,8 @@ static void be_pam_handler_callback(struct be_req *req, int status,
return;
}
- conn = sbus_get_connection(req->be_ctx->dp_conn_ctx);
- dbus_connection_send(conn, reply, NULL);
+ dbus_conn = sbus_get_connection(req->be_ctx->dp_conn);
+ dbus_connection_send(dbus_conn, reply, NULL);
dbus_message_unref(reply);
DEBUG(4, ("Sent result [%d][%s]\n", pd->pam_status, pd->domain));
@@ -568,7 +568,7 @@ static void be_pam_handler_callback(struct be_req *req, int status,
talloc_free(req);
}
-static int be_pam_handler(DBusMessage *message, struct sbus_conn_ctx *sconn)
+static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
{
DBusError dbus_error;
DBusMessage *reply;
@@ -580,7 +580,7 @@ static int be_pam_handler(DBusMessage *message, struct sbus_conn_ctx *sconn)
uint32_t pam_status = PAM_SYSTEM_ERR;
enum bet_type target = BET_NULL;
- user_data = sbus_conn_get_private_data(sconn);
+ user_data = sbus_conn_get_private_data(conn);
if (!user_data) return EINVAL;
ctx = talloc_get_type(user_data, struct be_ctx);
if (!ctx) return EINVAL;
@@ -660,7 +660,7 @@ done:
if (!ret) return EIO;
/* send reply back immediately */
- sbus_conn_send_reply(sconn, reply);
+ sbus_conn_send_reply(conn, reply);
dbus_message_unref(reply);
talloc_free(pd);
@@ -694,7 +694,7 @@ static int mon_cli_init(struct be_ctx *ctx)
}
ret = sbus_client_init(ctx, ctx->ev, ctx->mon_sm_ctx,
- sbus_address, &ctx->mon_conn_ctx,
+ sbus_address, &ctx->mon_conn,
NULL, ctx);
if (ret != EOK) {
DEBUG(0, ("Failed to connect to monitor services.\n"));
@@ -704,7 +704,7 @@ static int mon_cli_init(struct be_ctx *ctx)
return EOK;
}
-static void be_cli_reconnect_init(struct sbus_conn_ctx *sconn, int status, void *pvt);
+static void be_cli_reconnect_init(struct sbus_connection *conn, int status, void *pvt);
/* be_cli_init
* sbus channel to the data provider daemon */
@@ -733,7 +733,7 @@ static int be_cli_init(struct be_ctx *ctx)
}
ret = sbus_client_init(ctx, ctx->ev, ctx->dp_sm_ctx,
- sbus_address, &ctx->dp_conn_ctx,
+ sbus_address, &ctx->dp_conn,
NULL, ctx);
if (ret != EOK) {
DEBUG(0, ("Failed to connect to monitor services.\n"));
@@ -748,7 +748,7 @@ static int be_cli_init(struct be_ctx *ctx)
return ret;
}
- sbus_reconnect_init(ctx->dp_conn_ctx, max_retries,
+ sbus_reconnect_init(ctx->dp_conn, max_retries,
be_cli_reconnect_init, ctx);
return EOK;
@@ -757,7 +757,7 @@ static int be_cli_init(struct be_ctx *ctx)
static int be_finalize(struct be_ctx *ctx);
static void be_shutdown(struct be_req *req, int status, const char *errstr);
-static void be_cli_reconnect_init(struct sbus_conn_ctx *sconn, int status, void *pvt)
+static void be_cli_reconnect_init(struct sbus_connection *conn, int status, void *pvt)
{
int ret;
struct be_ctx *be_ctx = talloc_get_type(pvt, struct be_ctx);
@@ -765,7 +765,7 @@ static void be_cli_reconnect_init(struct sbus_conn_ctx *sconn, int status, void
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Add the methods back to the new connection */
- ret = sbus_conn_add_method_ctx(be_ctx->dp_conn_ctx,
+ ret = sbus_conn_add_method_ctx(be_ctx->dp_conn,
be_ctx->dp_sm_ctx);
if (ret != EOK) {
DEBUG(0, ("Could not re-add methods on reconnection.\n"));
diff --git a/server/providers/dp_backend.h b/server/providers/dp_backend.h
index 759dd996..f05a5420 100644
--- a/server/providers/dp_backend.h
+++ b/server/providers/dp_backend.h
@@ -71,10 +71,10 @@ struct be_ctx {
const char *conf_path;
struct sbus_method_ctx *mon_sm_ctx;
- struct sbus_conn_ctx *mon_conn_ctx;
+ struct sbus_connection *mon_conn;
struct sbus_method_ctx *dp_sm_ctx;
- struct sbus_conn_ctx *dp_conn_ctx;
+ struct sbus_connection *dp_conn;
struct loaded_be loaded_be[BET_MAX];
struct bet_info bet_info[BET_MAX];