size_t size_hint);
void cli_chain_uncork(struct cli_state *cli);
-/*
- * Convenience function to get the SMB part out of an async_req
- */
-
-struct cli_request *cli_request_get(struct async_req *req);
-
NTSTATUS cli_pull_reply(struct async_req *req,
uint8_t *pwct, uint16_t **pvwv,
uint16_t *pnum_bytes, uint8_t **pbytes);
static char *cli_request_print(TALLOC_CTX *mem_ctx, struct async_req *req)
{
char *result = async_req_print(mem_ctx, req);
- struct cli_request *cli_req = cli_request_get(req);
+ struct cli_request *cli_req = talloc_get_type_abort(
+ req->private_data, struct cli_request);
if (result == NULL) {
return NULL;
static int cli_async_req_destructor(struct async_req *req)
{
- struct cli_request *cli_req = cli_request_get(req);
+ struct cli_request *cli_req = talloc_get_type_abort(
+ req->private_data, struct cli_request);
int i, pending;
bool found = false;
uint8_t *pwct, uint16_t **pvwv,
uint16_t *pnum_bytes, uint8_t **pbytes)
{
- struct cli_request *cli_req = cli_request_get(req);
+ struct cli_request *cli_req = talloc_get_type_abort(
+ req->private_data, struct cli_request);
uint8_t wct, cmd;
uint16_t num_bytes;
size_t wct_ofs, bytes_offset;
return NT_STATUS_OK;
}
-/**
- * Convenience function to get the SMB part out of an async_req
- * @param[in] req The request to look at
- * @retval The private_data as struct cli_request
- */
-
-struct cli_request *cli_request_get(struct async_req *req)
-{
- if (req == NULL) {
- return NULL;
- }
- return talloc_get_type_abort(req->private_data, struct cli_request);
-}
-
/**
* A PDU has arrived on cli->evt_inbuf
* @param[in] cli The cli_state that received something
return;
}
- cli_req = cli_request_get(req);
+ cli_req = talloc_get_type_abort(req->private_data, struct cli_request);
if ((num_bytes != cli_req->data.echo.data.length)
|| (memcmp(cli_req->data.echo.data.data, bytes,
TALLOC_FREE(data_copy);
return NULL;
}
- req = cli_request_get(result);
+ req = talloc_get_type_abort(result->private_data, struct cli_request);
client_set_trans_sign_state_on(cli, req->mid);
return NULL;
}
- req = cli_request_get(result);
+ req = talloc_get_type_abort(result->private_data, struct cli_request);
req->data.read.ofs = offset;
req->data.read.size = size;
NTSTATUS cli_read_andx_recv(struct async_req *req, ssize_t *received,
uint8_t **rcvbuf)
{
- struct cli_request *cli_req = cli_request_get(req);
+ struct cli_request *cli_req = talloc_get_type_abort(
+ req->private_data, struct cli_request);
uint8_t wct;
uint16_t *vwv;
uint16_t num_bytes;
read_req->async.priv, struct async_req);
struct cli_pull_state *state = talloc_get_type_abort(
pull_req->private_data, struct cli_pull_state);
- struct cli_request *read_state = cli_request_get(read_req);
+ struct cli_request *read_state = talloc_get_type_abort(
+ read_req->private_data, struct cli_request);
NTSTATUS status;
status = cli_read_andx_recv(read_req, &read_state->data.read.received,
return;
}
- top_read = cli_request_get(state->reqs[state->top_req]);
+ top_read = talloc_get_type_abort(
+ state->reqs[state->top_req]->private_data,
+ struct cli_request);
DEBUG(10, ("cli_pull_read_done: Pushing %d bytes, %d already "
"pushed\n", (int)top_read->data.read.received,