struct winbindd_domain;
-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);
-};
-
struct winbindd_child {
pid_t pid;
struct winbindd_domain *domain;
struct tevent_timer *lockout_policy_event;
struct tevent_timer *machine_password_change_event;
-
- const struct winbindd_child_dispatch_table *table;
};
/* Structures to hold per domain information */
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
-static const struct winbindd_child_dispatch_table domain_dispatch_table[] = {
- {
- .name = "NDRCMD",
- .struct_cmd = WINBINDD_DUAL_NDRCMD,
- .struct_fn = winbindd_dual_ndrcmd,
- },{
- .name = NULL,
- }
-};
-
void setup_domain_child(struct winbindd_domain *domain)
{
int i;
for (i=0; i<lp_winbind_max_domain_connections(); i++) {
setup_child(domain, &domain->children[i],
- domain_dispatch_table,
"log.wb", domain->name);
domain->children[i].domain = domain;
}
struct winbindd_cli_state *state)
{
struct winbindd_domain *domain = child->domain;
- const struct winbindd_child_dispatch_table *table = child->table;
/* Free response data - we may be interrupted and receive another
command before being able to send this data off. */
state->mem_ctx = talloc_tos();
/* Process command */
-
- for (; table->name; table++) {
- if (state->request->cmd == table->struct_cmd) {
- DEBUG(10,("child_process_request: request fn %s\n",
- table->name));
- state->response->result = table->struct_fn(domain, state);
- return;
- }
- }
+ state->response->result = winbindd_dual_ndrcmd(domain, state);
DEBUG(1, ("child_process_request: unknown request fn number %d\n",
(int)state->request->cmd));
}
void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
- const struct winbindd_child_dispatch_table *table,
const char *logprefix,
const char *logname)
{
child->pid = 0;
child->sock = -1;
child->domain = domain;
- child->table = table;
child->queue = tevent_queue_create(NULL, "winbind_child");
SMB_ASSERT(child->queue != NULL);
return static_idmap_child.binding_handle;
}
-static const struct winbindd_child_dispatch_table idmap_dispatch_table[] = {
- {
- .name = "NDRCMD",
- .struct_cmd = WINBINDD_DUAL_NDRCMD,
- .struct_fn = winbindd_dual_ndrcmd,
- },{
- .name = NULL,
- }
-};
-
static void init_idmap_child_done(struct tevent_req *subreq);
void init_idmap_child(void)
/*
* We're done, so start the idmap child
*/
- setup_child(NULL, &static_idmap_child,
- idmap_dispatch_table,
- "log.winbindd", "idmap");
+ setup_child(NULL, &static_idmap_child, "log.winbindd", "idmap");
tevent_req_done(req);
return;
}
return static_locator_child.binding_handle;
}
-static const struct winbindd_child_dispatch_table locator_dispatch_table[] = {
- {
- .name = "NDRCMD",
- .struct_cmd = WINBINDD_DUAL_NDRCMD,
- .struct_fn = winbindd_dual_ndrcmd,
- },{
- .name = NULL,
- }
-};
-
void init_locator_child(void)
{
- setup_child(NULL, &static_locator_child,
- locator_dispatch_table,
- "log.winbindd", "locator");
+ setup_child(NULL, &static_locator_child, "log.winbindd", "locator");
}
ndr_print_string(ndr, "logfilename", r->logfilename);
/* struct fd_event event; */
ndr_print_ptr(ndr, "lockout_policy_event", r->lockout_policy_event);
- ndr_print_ptr(ndr, "table", r->table);
ndr->depth--;
}
struct winbindd_response **presponse, int *err);
void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
- const struct winbindd_child_dispatch_table *table,
const char *logprefix,
const char *logname);
void winbind_child_died(pid_t pid);