From 9a70f446fc4abc2bd1278772810c0e8132f4bea4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Jan 2005 08:30:44 +0000 Subject: r5126: the composite code is no longer client specific or smb specific, so rename the core structure to composite_context and the wait routine to composite_wait() (suggestion from metze) (This used to be commit cf11d05e35179c2c3e51c5ab370cd0a3fb15f24a) --- source4/libcli/resolve/bcast.c | 8 ++++---- source4/libcli/resolve/host.c | 16 ++++++++-------- source4/libcli/resolve/nbtlist.c | 16 ++++++++-------- source4/libcli/resolve/resolve.c | 28 ++++++++++++++-------------- source4/libcli/resolve/wins.c | 6 +++--- 5 files changed, 37 insertions(+), 37 deletions(-) (limited to 'source4/libcli/resolve') diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c index 9aefa32fae..5fb6e6dd5c 100644 --- a/source4/libcli/resolve/bcast.c +++ b/source4/libcli/resolve/bcast.c @@ -28,12 +28,12 @@ /* broadcast name resolution method - async send */ -struct smbcli_composite *resolve_name_bcast_send(struct nbt_name *name, +struct composite_context *resolve_name_bcast_send(struct nbt_name *name, struct event_context *event_ctx) { int num_interfaces = iface_count(); const char **address_list; - struct smbcli_composite *c; + struct composite_context *c; int i; address_list = talloc_array(NULL, const char *, num_interfaces+1); @@ -58,7 +58,7 @@ struct smbcli_composite *resolve_name_bcast_send(struct nbt_name *name, /* broadcast name resolution method - recv side */ -NTSTATUS resolve_name_bcast_recv(struct smbcli_composite *c, +NTSTATUS resolve_name_bcast_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, const char **reply_addr) { return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr); @@ -71,7 +71,7 @@ NTSTATUS resolve_name_bcast(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr) { - struct smbcli_composite *c = resolve_name_bcast_send(name, NULL); + struct composite_context *c = resolve_name_bcast_send(name, NULL); return resolve_name_bcast_recv(c, mem_ctx, reply_addr); } diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c index 5b28a850fc..9bf278154d 100644 --- a/source4/libcli/resolve/host.c +++ b/source4/libcli/resolve/host.c @@ -63,7 +63,7 @@ static int host_destructor(void *ptr) /* the blocking child */ -static void run_child(struct smbcli_composite *c, int fd) +static void run_child(struct composite_context *c, int fd) { struct host_state *state = talloc_get_type(c->private, struct host_state); struct ipv4_addr ip; @@ -85,7 +85,7 @@ static void run_child(struct smbcli_composite *c, int fd) static void pipe_handler(struct event_context *ev, struct fd_event *fde, struct timeval t, uint16_t flags) { - struct smbcli_composite *c = talloc_get_type(fde->private, struct smbcli_composite); + struct composite_context *c = talloc_get_type(fde->private, struct composite_context); struct host_state *state = talloc_get_type(c->private, struct host_state); char address[128]; int ret; @@ -129,17 +129,17 @@ failed: /* gethostbyname name resolution method - async send */ -struct smbcli_composite *resolve_name_host_send(struct nbt_name *name, +struct composite_context *resolve_name_host_send(struct nbt_name *name, struct event_context *event_ctx) { - struct smbcli_composite *c; + struct composite_context *c; struct host_state *state; NTSTATUS status; int fd[2] = { -1, -1 }; struct fd_event fde; int ret; - c = talloc_zero(NULL, struct smbcli_composite); + c = talloc_zero(NULL, struct composite_context); if (c == NULL) goto failed; state = talloc(c, struct host_state); @@ -201,12 +201,12 @@ failed: /* gethostbyname name resolution method - recv side */ -NTSTATUS resolve_name_host_recv(struct smbcli_composite *c, +NTSTATUS resolve_name_host_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, const char **reply_addr) { NTSTATUS status; - status = smb_composite_wait(c); + status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct host_state *state = talloc_get_type(c->private, struct host_state); @@ -224,7 +224,7 @@ NTSTATUS resolve_name_host(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr) { - struct smbcli_composite *c = resolve_name_host_send(name, NULL); + struct composite_context *c = resolve_name_host_send(name, NULL); return resolve_name_host_recv(c, mem_ctx, reply_addr); } diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c index 08dc90c39d..5a9e31e09d 100644 --- a/source4/libcli/resolve/nbtlist.c +++ b/source4/libcli/resolve/nbtlist.c @@ -43,8 +43,8 @@ struct nbtlist_state { */ static void nbtlist_handler(struct nbt_name_request *req) { - struct smbcli_composite *c = talloc_get_type(req->async.private, - struct smbcli_composite); + struct composite_context *c = talloc_get_type(req->async.private, + struct composite_context); struct nbtlist_state *state = talloc_get_type(c->private, struct nbtlist_state); int i; @@ -81,18 +81,18 @@ done: /* nbtlist name resolution method - async send */ -struct smbcli_composite *resolve_name_nbtlist_send(struct nbt_name *name, +struct composite_context *resolve_name_nbtlist_send(struct nbt_name *name, struct event_context *event_ctx, const char **address_list, BOOL broadcast, BOOL wins_lookup) { - struct smbcli_composite *c; + struct composite_context *c; struct nbtlist_state *state; int i; NTSTATUS status; - c = talloc_zero(NULL, struct smbcli_composite); + c = talloc_zero(NULL, struct composite_context); if (c == NULL) goto failed; state = talloc(c, struct nbtlist_state); @@ -143,12 +143,12 @@ failed: /* nbt list of addresses name resolution method - recv side */ -NTSTATUS resolve_name_nbtlist_recv(struct smbcli_composite *c, +NTSTATUS resolve_name_nbtlist_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, const char **reply_addr) { NTSTATUS status; - status = smb_composite_wait(c); + status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct nbtlist_state *state = talloc_get_type(c->private, struct nbtlist_state); @@ -168,7 +168,7 @@ NTSTATUS resolve_name_nbtlist(struct nbt_name *name, BOOL broadcast, BOOL wins_lookup, const char **reply_addr) { - struct smbcli_composite *c = resolve_name_nbtlist_send(name, NULL, address_list, + struct composite_context *c = resolve_name_nbtlist_send(name, NULL, address_list, broadcast, wins_lookup); return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr); } diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c index 054f10d529..eb35a7cb99 100644 --- a/source4/libcli/resolve/resolve.c +++ b/source4/libcli/resolve/resolve.c @@ -27,17 +27,17 @@ struct resolve_state { struct nbt_name name; const char **methods; - struct smbcli_composite *req; + struct composite_context *req; const char *reply_addr; }; -static struct smbcli_composite *setup_next_method(struct smbcli_composite *c); +static struct composite_context *setup_next_method(struct composite_context *c); /* pointers to the resolver backends */ static const struct resolve_method { const char *name; - struct smbcli_composite *(*send_fn)(struct nbt_name *, struct event_context *); - NTSTATUS (*recv_fn)(struct smbcli_composite *, TALLOC_CTX *, const char **); + struct composite_context *(*send_fn)(struct nbt_name *, struct event_context *); + NTSTATUS (*recv_fn)(struct composite_context *, TALLOC_CTX *, const char **); } methods[] = { { "bcast", resolve_name_bcast_send, resolve_name_bcast_recv }, { "wins", resolve_name_wins_send, resolve_name_wins_recv }, @@ -63,9 +63,9 @@ static const struct resolve_method *find_method(const char *name) /* handle completion of one name resolve method */ -static void resolve_handler(struct smbcli_composite *req) +static void resolve_handler(struct composite_context *req) { - struct smbcli_composite *c = req->async.private; + struct composite_context *c = req->async.private; struct resolve_state *state = talloc_get_type(c->private, struct resolve_state); const struct resolve_method *method = find_method(state->methods[0]); @@ -90,10 +90,10 @@ static void resolve_handler(struct smbcli_composite *req) } -static struct smbcli_composite *setup_next_method(struct smbcli_composite *c) +static struct composite_context *setup_next_method(struct composite_context *c) { struct resolve_state *state = talloc_get_type(c->private, struct resolve_state); - struct smbcli_composite *req = NULL; + struct composite_context *req = NULL; do { const struct resolve_method *method = find_method(state->methods[0]); @@ -114,13 +114,13 @@ static struct smbcli_composite *setup_next_method(struct smbcli_composite *c) /* general name resolution - async send */ -struct smbcli_composite *resolve_name_send(struct nbt_name *name, struct event_context *event_ctx) +struct composite_context *resolve_name_send(struct nbt_name *name, struct event_context *event_ctx) { - struct smbcli_composite *c; + struct composite_context *c; struct resolve_state *state; NTSTATUS status; - c = talloc_zero(NULL, struct smbcli_composite); + c = talloc_zero(NULL, struct composite_context); if (c == NULL) goto failed; state = talloc(c, struct resolve_state); @@ -156,12 +156,12 @@ failed: /* general name resolution method - recv side */ -NTSTATUS resolve_name_recv(struct smbcli_composite *c, +NTSTATUS resolve_name_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, const char **reply_addr) { NTSTATUS status; - status = smb_composite_wait(c); + status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { struct resolve_state *state = talloc_get_type(c->private, struct resolve_state); @@ -177,6 +177,6 @@ NTSTATUS resolve_name_recv(struct smbcli_composite *c, */ NTSTATUS resolve_name(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr) { - struct smbcli_composite *c = resolve_name_send(name, NULL); + struct composite_context *c = resolve_name_send(name, NULL); return resolve_name_recv(c, mem_ctx, reply_addr); } diff --git a/source4/libcli/resolve/wins.c b/source4/libcli/resolve/wins.c index 5a0e067832..aa4ec0cea4 100644 --- a/source4/libcli/resolve/wins.c +++ b/source4/libcli/resolve/wins.c @@ -28,7 +28,7 @@ /* wins name resolution method - async send */ -struct smbcli_composite *resolve_name_wins_send(struct nbt_name *name, +struct composite_context *resolve_name_wins_send(struct nbt_name *name, struct event_context *event_ctx) { const char **address_list = lp_wins_server_list(); @@ -39,7 +39,7 @@ struct smbcli_composite *resolve_name_wins_send(struct nbt_name *name, /* wins name resolution method - recv side */ -NTSTATUS resolve_name_wins_recv(struct smbcli_composite *c, +NTSTATUS resolve_name_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx, const char **reply_addr) { return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr); @@ -52,7 +52,7 @@ NTSTATUS resolve_name_wins(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr) { - struct smbcli_composite *c = resolve_name_wins_send(name, NULL); + struct composite_context *c = resolve_name_wins_send(name, NULL); return resolve_name_wins_recv(c, mem_ctx, reply_addr); } -- cgit