summaryrefslogtreecommitdiff
path: root/source4/libcli/util
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-02-08 00:51:07 +0000
committerTim Potter <tpot@samba.org>2004-02-08 00:51:07 +0000
commit4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 (patch)
tree2115d25166961cea7d49836d53a05e98c796ff8a /source4/libcli/util
parentf0c9a54b30cfa627b4ddcbc24fe943b21472df34 (diff)
downloadsamba-4639eb5a58f8c0906afdc8e8f8f67f82e9547f75.tar.gz
samba-4639eb5a58f8c0906afdc8e8f8f67f82e9547f75.tar.bz2
samba-4639eb5a58f8c0906afdc8e8f8f67f82e9547f75.zip
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)
Diffstat (limited to 'source4/libcli/util')
-rw-r--r--source4/libcli/util/clierror.c30
1 files changed, 16 insertions, 14 deletions
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;
}