struct winbindd_domain;
+enum winbindd_child_dispatch_type {
+ WINBINDD_CHILD_DISPATCH_SYNC = 0,
+ WINBINDD_CHILD_DISPATCH_ASYNC,
+};
+
struct winbindd_child_dispatch_table {
const char *name;
enum winbindd_cmd struct_cmd;
- enum winbindd_result (*struct_fn)(struct winbindd_domain *domain,
- struct winbindd_cli_state *state);
+ enum winbindd_child_dispatch_type type;
+ union {
+ struct {
+ enum winbindd_result (*struct_fn)(struct winbindd_domain *domain,
+ struct winbindd_cli_state *state);
+ } sync;
+ struct {
+ struct tevent_req *(*struct_fn_send)(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct winbindd_domain *domain,
+ struct winbindd_cli_state *state);
+ enum winbindd_result (*struct_fn_recv)(struct tevent_req *req);
+ } async;
+ };
};
struct winbindd_child {
{
.name = "PING",
.struct_cmd = WINBINDD_PING,
- .struct_fn = winbindd_dual_ping,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_ping,
},{
.name = "LIST_TRUSTDOM",
.struct_cmd = WINBINDD_LIST_TRUSTDOM,
- .struct_fn = winbindd_dual_list_trusted_domains,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_list_trusted_domains,
},{
.name = "INIT_CONNECTION",
.struct_cmd = WINBINDD_INIT_CONNECTION,
- .struct_fn = winbindd_dual_init_connection,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_init_connection,
},{
.name = "PAM_AUTH",
.struct_cmd = WINBINDD_PAM_AUTH,
- .struct_fn = winbindd_dual_pam_auth,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_pam_auth,
},{
.name = "AUTH_CRAP",
.struct_cmd = WINBINDD_PAM_AUTH_CRAP,
- .struct_fn = winbindd_dual_pam_auth_crap,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_pam_auth_crap,
},{
.name = "PAM_LOGOFF",
.struct_cmd = WINBINDD_PAM_LOGOFF,
- .struct_fn = winbindd_dual_pam_logoff,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_pam_logoff,
},{
.name = "CHNG_PSWD_AUTH_CRAP",
.struct_cmd = WINBINDD_PAM_CHNG_PSWD_AUTH_CRAP,
- .struct_fn = winbindd_dual_pam_chng_pswd_auth_crap,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_pam_chng_pswd_auth_crap,
},{
.name = "PAM_CHAUTHTOK",
.struct_cmd = WINBINDD_PAM_CHAUTHTOK,
- .struct_fn = winbindd_dual_pam_chauthtok,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_pam_chauthtok,
},{
.name = "NDRCMD",
.struct_cmd = WINBINDD_DUAL_NDRCMD,
- .struct_fn = winbindd_dual_ndrcmd,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_ndrcmd,
},{
.name = NULL,
}
{
.name = "PING",
.struct_cmd = WINBINDD_PING,
- .struct_fn = winbindd_dual_ping,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_ping,
},{
.name = "NDRCMD",
.struct_cmd = WINBINDD_DUAL_NDRCMD,
- .struct_fn = winbindd_dual_ndrcmd,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_ndrcmd,
},{
.name = NULL,
}
{
.name = "PING",
.struct_cmd = WINBINDD_PING,
- .struct_fn = winbindd_dual_ping,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_ping,
},{
.name = "NDRCMD",
.struct_cmd = WINBINDD_DUAL_NDRCMD,
- .struct_fn = winbindd_dual_ndrcmd,
+ .type = WINBINDD_CHILD_DISPATCH_SYNC,
+ .sync.struct_fn = winbindd_dual_ndrcmd,
},{
.name = NULL,
}