From 4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 8 Feb 2004 00:51:07 +0000 Subject: Convert libcli routines to use cli_tree instead of cli_state. Port smbtorture to use the new interface. Part 2 will be to eliminate cli_state from smbtorture as this is now the only place where it is used. (This used to be commit db1cc96af62ea42837d60592877fc3f93cef143b) --- source4/libcli/util/clierror.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'source4/libcli/util') diff --git a/source4/libcli/util/clierror.c b/source4/libcli/util/clierror.c index 4fa1daa3be..97436d2106 100644 --- a/source4/libcli/util/clierror.c +++ b/source4/libcli/util/clierror.c @@ -25,14 +25,15 @@ /*************************************************************************** Return an error message from the last response ****************************************************************************/ -const char *cli_errstr(struct cli_state *cli) +const char *cli_errstr(struct cli_tree *tree) { - switch (cli->transport->error.etype) { + switch (tree->session->transport->error.etype) { case ETYPE_DOS: - return dos_errstr(cli->transport->error.e.dos.eclass, - cli->transport->error.e.dos.ecode); + return dos_errstr( + tree->session->transport->error.e.dos.eclass, + tree->session->transport->error.e.dos.ecode); case ETYPE_NT: - return nt_errstr(cli->transport->error.e.nt_status); + return nt_errstr(tree->session->transport->error.e.nt_status); case ETYPE_SOCKET: return "socket_error"; @@ -48,15 +49,16 @@ const char *cli_errstr(struct cli_state *cli) /* Return the 32-bit NT status code from the last packet */ -NTSTATUS cli_nt_error(struct cli_state *cli) +NTSTATUS cli_nt_error(struct cli_tree *tree) { - switch (cli->transport->error.etype) { + switch (tree->session->transport->error.etype) { case ETYPE_NT: - return cli->transport->error.e.nt_status; + return tree->session->transport->error.e.nt_status; case ETYPE_DOS: - return dos_to_ntstatus(cli->transport->error.e.dos.eclass, - cli->transport->error.e.dos.ecode); + return dos_to_ntstatus( + tree->session->transport->error.e.dos.eclass, + tree->session->transport->error.e.dos.ecode); case ETYPE_SOCKET: return NT_STATUS_UNSUCCESSFUL; @@ -87,13 +89,13 @@ void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode) /* Return true if the last packet was an error */ -BOOL cli_is_error(struct cli_state *cli) +BOOL cli_is_error(struct cli_tree *tree) { - return NT_STATUS_IS_ERR(cli_nt_error(cli)); + return NT_STATUS_IS_ERR(cli_nt_error(tree)); } /* Return true if the last error was a DOS error */ -BOOL cli_is_dos_error(struct cli_state *cli) +BOOL cli_is_dos_error(struct cli_tree *tree) { - return cli->transport->error.etype == ETYPE_DOS; + return tree->session->transport->error.etype == ETYPE_DOS; } -- cgit