bool use_oplocks; /* should we use oplocks? */
bool use_level_II_oplocks; /* should we use level II oplocks? */
- /* a oplock break request handler */
- NTSTATUS (*oplock_handler)(struct cli_state *cli, uint16_t fnum, unsigned char level);
-
bool force_dos_errors;
bool case_sensitive; /* False by default. */
cli->protocol = PROTOCOL_NT1;
cli->timeout = 20000; /* Timeout is in milliseconds. */
cli->max_xmit = CLI_BUFFER_SIZE+4;
- cli->oplock_handler = cli_oplock_ack;
cli->case_sensitive = false;
cli->use_spnego = lp_client_use_spnego();
return tevent_req_simple_recv_ntstatus(req);
}
-NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level)
-{
- TALLOC_CTX *frame = talloc_stackframe();
- struct event_context *ev;
- struct tevent_req *req;
- NTSTATUS status = NT_STATUS_OK;
-
- if (cli_has_async_calls(cli)) {
- /*
- * Can't use sync call while an async call is in flight
- */
- status = NT_STATUS_INVALID_PARAMETER;
- goto fail;
- }
-
- ev = event_context_init(frame);
- if (ev == NULL) {
- status = NT_STATUS_NO_MEMORY;
- goto fail;
- }
-
- req = cli_oplock_ack_send(frame, ev, cli, fnum, level);
- if (req == NULL) {
- status = NT_STATUS_NO_MEMORY;
- goto fail;
- }
-
- if (!tevent_req_poll(req, ev)) {
- status = map_nt_error_from_unix(errno);
- goto fail;
- }
-
- status = cli_oplock_ack_recv(req);
- fail:
- TALLOC_FREE(frame);
- return status;
-}
-
-/****************************************************************************
-set the oplock handler for a connection
-****************************************************************************/
-
-void cli_oplock_handler(struct cli_state *cli,
- NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char))
-{
- cli->oplock_handler = handler;
-}
struct cli_state *cli,
uint16_t fnum, uint8_t level);
NTSTATUS cli_oplock_ack_recv(struct tevent_req *req);
-NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level);
-void cli_oplock_handler(struct cli_state *cli,
- NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char));
/* The following definitions come from libsmb/cliprint.c */