summaryrefslogtreecommitdiff
path: root/source4/libcli/resolve
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/resolve')
-rw-r--r--source4/libcli/resolve/host.c18
-rw-r--r--source4/libcli/resolve/nbtlist.c20
-rw-r--r--source4/libcli/resolve/resolve.c46
3 files changed, 42 insertions, 42 deletions
diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c
index a5edfcbc8a..13503b66b3 100644
--- a/source4/libcli/resolve/host.c
+++ b/source4/libcli/resolve/host.c
@@ -66,7 +66,7 @@ static int host_destructor(void *ptr)
*/
static void run_child(struct composite_context *c, int fd)
{
- struct host_state *state = talloc_get_type(c->private, struct host_state);
+ struct host_state *state = talloc_get_type(c->private_data, struct host_state);
struct ipv4_addr ip;
const char *address;
@@ -84,10 +84,10 @@ static void run_child(struct composite_context *c, int fd)
handle a read event on the pipe
*/
static void pipe_handler(struct event_context *ev, struct fd_event *fde,
- uint16_t flags, void *private)
+ uint16_t flags, void *private_data)
{
- struct composite_context *c = talloc_get_type(private, struct composite_context);
- struct host_state *state = talloc_get_type(c->private, struct host_state);
+ struct composite_context *c = talloc_get_type(private_data, struct composite_context);
+ struct host_state *state = talloc_get_type(c->private_data, struct host_state);
char address[128];
int ret;
@@ -113,7 +113,7 @@ static void pipe_handler(struct event_context *ev, struct fd_event *fde,
if (state->reply_addr == NULL) goto failed;
c->status = NT_STATUS_OK;
- c->state = SMBCLI_REQUEST_DONE;
+ c->state = COMPOSITE_STATE_DONE;
if (c->async.fn) {
c->async.fn(c);
}
@@ -121,7 +121,7 @@ static void pipe_handler(struct event_context *ev, struct fd_event *fde,
failed:
c->status = NT_STATUS_BAD_NETWORK_NAME;
- c->state = SMBCLI_REQUEST_ERROR;
+ c->state = COMPOSITE_STATE_ERROR;
if (c->async.fn) {
c->async.fn(c);
}
@@ -148,8 +148,8 @@ struct composite_context *resolve_name_host_send(struct nbt_name *name,
status = nbt_name_dup(state, name, &state->name);
if (!NT_STATUS_IS_OK(status)) goto failed;
- c->state = SMBCLI_REQUEST_SEND;
- c->private = state;
+ c->state = COMPOSITE_STATE_IN_PROGRESS;
+ c->private_data = state;
c->event_ctx = talloc_reference(c, event_ctx);
/* setup a pipe to chat to our child */
@@ -206,7 +206,7 @@ NTSTATUS resolve_name_host_recv(struct composite_context *c,
status = composite_wait(c);
if (NT_STATUS_IS_OK(status)) {
- struct host_state *state = talloc_get_type(c->private, struct host_state);
+ struct host_state *state = talloc_get_type(c->private_data, struct host_state);
*reply_addr = talloc_steal(mem_ctx, state->reply_addr);
}
diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c
index 7080c62e43..4fb4ccbb20 100644
--- a/source4/libcli/resolve/nbtlist.c
+++ b/source4/libcli/resolve/nbtlist.c
@@ -44,8 +44,8 @@ struct nbtlist_state {
static void nbtlist_handler(struct nbt_name_request *req)
{
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);
+ struct composite_context);
+ struct nbtlist_state *state = talloc_get_type(c->private_data, struct nbtlist_state);
int i;
for (i=0;i<state->num_queries;i++) {
@@ -54,20 +54,20 @@ static void nbtlist_handler(struct nbt_name_request *req)
if (i == state->num_queries) {
/* not for us?! */
c->status = NT_STATUS_INTERNAL_ERROR;
- c->state = SMBCLI_REQUEST_ERROR;
+ c->state = COMPOSITE_STATE_ERROR;
goto done;
- }
+ }
c->status = nbt_name_query_recv(req, state, &state->io_queries[i]);
if (!NT_STATUS_IS_OK(c->status)) {
- c->state = SMBCLI_REQUEST_ERROR;
+ c->state = COMPOSITE_STATE_ERROR;
} else {
if (state->io_queries[i].out.num_addrs < 1) {
- c->state = SMBCLI_REQUEST_ERROR;
+ c->state = COMPOSITE_STATE_ERROR;
c->status = NT_STATUS_UNEXPECTED_NETWORK_ERROR;
} else {
struct nbt_name_query *q = &state->io_queries[i];
- c->state = SMBCLI_REQUEST_DONE;
+ c->state = COMPOSITE_STATE_DONE;
/* favor a local address if possible */
state->reply_addr = NULL;
for (i=0;i<q->out.num_addrs;i++) {
@@ -150,8 +150,8 @@ struct composite_context *resolve_name_nbtlist_send(struct nbt_name *name,
state->queries[i]->async.private = c;
}
- c->state = SMBCLI_REQUEST_SEND;
- c->private = state;
+ c->state = COMPOSITE_STATE_IN_PROGRESS;
+ c->private_data = state;
c->event_ctx = talloc_reference(c, state->nbtsock->event_ctx);
return c;
@@ -172,7 +172,7 @@ NTSTATUS resolve_name_nbtlist_recv(struct composite_context *c,
status = composite_wait(c);
if (NT_STATUS_IS_OK(status)) {
- struct nbtlist_state *state = talloc_get_type(c->private, struct nbtlist_state);
+ struct nbtlist_state *state = talloc_get_type(c->private_data, struct nbtlist_state);
*reply_addr = talloc_steal(mem_ctx, state->reply_addr);
}
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c
index c21b29b57f..c9e2fa503b 100644
--- a/source4/libcli/resolve/resolve.c
+++ b/source4/libcli/resolve/resolve.c
@@ -28,7 +28,7 @@
struct resolve_state {
struct nbt_name name;
const char **methods;
- struct composite_context *req;
+ struct composite_context *creq;
const char *reply_addr;
};
@@ -65,26 +65,26 @@ static const struct resolve_method *find_method(const char *name)
/*
handle completion of one name resolve method
*/
-static void resolve_handler(struct composite_context *req)
+static void resolve_handler(struct composite_context *creq)
{
- struct composite_context *c = req->async.private;
- struct resolve_state *state = talloc_get_type(c->private, struct resolve_state);
+ struct composite_context *c = creq->async.private_data;
+ struct resolve_state *state = talloc_get_type(c->private_data, struct resolve_state);
const struct resolve_method *method = find_method(state->methods[0]);
- c->status = method->recv_fn(req, state, &state->reply_addr);
+ c->status = method->recv_fn(creq, state, &state->reply_addr);
if (!NT_STATUS_IS_OK(c->status)) {
state->methods++;
- state->req = setup_next_method(c);
- if (state->req != NULL) {
+ state->creq = setup_next_method(c);
+ if (state->creq != NULL) {
return;
}
}
if (!NT_STATUS_IS_OK(c->status)) {
- c->state = SMBCLI_REQUEST_ERROR;
+ c->state = COMPOSITE_STATE_ERROR;
} else {
- c->state = SMBCLI_REQUEST_DONE;
+ c->state = COMPOSITE_STATE_DONE;
}
if (c->async.fn) {
c->async.fn(c);
@@ -94,23 +94,23 @@ static void resolve_handler(struct composite_context *req)
static struct composite_context *setup_next_method(struct composite_context *c)
{
- struct resolve_state *state = talloc_get_type(c->private, struct resolve_state);
- struct composite_context *req = NULL;
+ struct resolve_state *state = talloc_get_type(c->private_data, struct resolve_state);
+ struct composite_context *creq = NULL;
do {
const struct resolve_method *method = find_method(state->methods[0]);
if (method) {
- req = method->send_fn(&state->name, c->event_ctx);
+ creq = method->send_fn(&state->name, c->event_ctx);
}
- if (req == NULL && state->methods[0]) state->methods++;
- } while (!req && state->methods[0]);
+ if (creq == NULL && state->methods[0]) state->methods++;
+ } while (!creq && state->methods[0]);
- if (req) {
- req->async.fn = resolve_handler;
- req->async.private = c;
+ if (creq) {
+ creq->async.fn = resolve_handler;
+ creq->async.private_data = c;
}
- return req;
+ return creq;
}
/*
@@ -136,8 +136,8 @@ struct composite_context *resolve_name_send(struct nbt_name *name, struct event_
state->methods = str_list_copy(state, methods);
if (state->methods == NULL) goto failed;
- c->state = SMBCLI_REQUEST_SEND;
- c->private = state;
+ c->state = COMPOSITE_STATE_IN_PROGRESS;
+ c->private_data = state;
if (event_ctx == NULL) {
c->event_ctx = event_context_init(c);
if (c->event_ctx == NULL) goto failed;
@@ -154,8 +154,8 @@ struct composite_context *resolve_name_send(struct nbt_name *name, struct event_
return c;
}
- state->req = setup_next_method(c);
- if (state->req == NULL) goto failed;
+ state->creq = setup_next_method(c);
+ if (state->creq == NULL) goto failed;
return c;
@@ -175,7 +175,7 @@ NTSTATUS resolve_name_recv(struct composite_context *c,
status = composite_wait(c);
if (NT_STATUS_IS_OK(status)) {
- struct resolve_state *state = talloc_get_type(c->private, struct resolve_state);
+ struct resolve_state *state = talloc_get_type(c->private_data, struct resolve_state);
*reply_addr = talloc_steal(mem_ctx, state->reply_addr);
}