From 069a5fe72d38f8e15b4416992453ac41a425ce9a Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 16 Nov 2011 14:52:40 -0500 Subject: RESPONDER: Refactor DP requests into tevent_req style --- src/responder/common/responder.h | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'src/responder/common/responder.h') diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h index 1b39fdd5b..3b5ab8a42 100644 --- a/src/responder/common/responder.h +++ b/src/responder/common/responder.h @@ -89,6 +89,8 @@ struct resp_ctx { struct sss_names_ctx *names; + hash_table_t *dp_request_table; + void *pvt_ctx; }; @@ -163,17 +165,41 @@ struct cli_protocol_version *register_cli_protocol_version(void); typedef void (*sss_dp_callback_t)(uint16_t err_maj, uint32_t err_min, const char *err_msg, void *ptr); -void handle_requests_after_reconnect(void); +struct dp_callback_ctx { + sss_dp_callback_t callback; + void *ptr; + + void *mem_ctx; + struct cli_ctx *cctx; +}; -int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx, - sss_dp_callback_t callback, void *callback_ctx, - int timeout, const char *domain, - bool fast_reply, int type, - const char *opt_name, uint32_t opt_id); +void handle_requests_after_reconnect(void); int responder_logrotate(DBusMessage *message, struct sbus_connection *conn); +/* Send a request to the data provider + * Once this function is called, the communication + * with the data provider will always run to + * completion. Freeing the returned tevent_req will + * cancel the notification of completion, but not + * the data provider action. + */ +struct tevent_req * +sss_dp_get_account_send(TALLOC_CTX *mem_ctx, + struct resp_ctx *rctx, + struct sss_domain_info *dom, + bool fast_reply, + int type, + const char *opt_name, + uint32_t opt_id); +errno_t +sss_dp_get_account_recv(TALLOC_CTX *mem_ctx, + struct tevent_req *req, + dbus_uint16_t *err_maj, + dbus_uint32_t *err_min, + char **err_msg); + bool sss_utf8_check(const uint8_t *s, size_t n); #endif /* __SSS_RESPONDER_H__ */ -- cgit