summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-16 12:33:24 +0100
committerVolker Lendecke <vl@samba.org>2011-01-17 08:03:41 +0100
commitd5decfbb260a6770e5023abada56dbe5d9e02e7b (patch)
tree0bcf303e70c2aa90d16187724e7e659a65d370ee /source3/torture
parent5dee39b5bf65faaf8695b72dfc6247ef4789ef49 (diff)
downloadsamba-d5decfbb260a6770e5023abada56dbe5d9e02e7b.tar.gz
samba-d5decfbb260a6770e5023abada56dbe5d9e02e7b.tar.bz2
samba-d5decfbb260a6770e5023abada56dbe5d9e02e7b.zip
s3: Convert try_nttrans to cli_trans
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/scanner.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/source3/torture/scanner.c b/source3/torture/scanner.c
index 18f972571b..e499ffcdbe 100644
--- a/source3/torture/scanner.c
+++ b/source3/torture/scanner.c
@@ -259,39 +259,38 @@ static void nttrans_check_hit(const char *format, int op, int level, NTSTATUS st
check for existance of a nttrans call
****************************************************************************/
static NTSTATUS try_nttrans(struct cli_state *cli,
- int op,
- char *param, char *data,
- int param_len, int data_len,
- unsigned int *rparam_len, unsigned int *rdata_len)
+ int op,
+ uint8_t *param, uint8_t *data,
+ int32_t param_len, uint32_t data_len,
+ uint32_t *rparam_len,
+ uint32_t *rdata_len)
{
- char *rparam=NULL, *rdata=NULL;
-
- if (!cli_send_nt_trans(cli, op,
- 0,
- NULL, 0, 0,
- param, param_len, 2, /* param, length, max */
- data, data_len, cli->max_xmit /* data, length, max */
- )) {
- return cli_nt_error(cli);
- }
-
- cli_receive_nt_trans(cli,
- &rparam, rparam_len,
- &rdata, rdata_len);
+ uint8_t *rparam=NULL, *rdata=NULL;
+ NTSTATUS status;
+ status = cli_trans(talloc_tos(), cli, SMBnttrans,
+ NULL, -1, /* name, fid */
+ op, 0,
+ NULL, 0, 0, /* setup */
+ param, param_len, 2,
+ data, data_len, cli->max_xmit,
+ NULL, /* recv_flags2 */
+ NULL, 0, NULL, /* rsetup */
+ &rparam, 0, rparam_len,
+ &rdata, 0, rdata_len);
SAFE_FREE(rdata);
SAFE_FREE(rparam);
- return cli_nt_error(cli);
+ return status;
}
static NTSTATUS try_nttrans_len(struct cli_state *cli,
const char *format,
int op, int level,
- char *param, char *data,
- int param_len, int *data_len,
- unsigned int *rparam_len, unsigned int *rdata_len)
+ uint8_t *param, uint8_t *data,
+ int param_len, uint32_t *data_len,
+ uint32_t *rparam_len, uint32_t *rdata_len)
{
NTSTATUS ret=NT_STATUS_OK;
@@ -324,10 +323,10 @@ check for existance of a nttrans call
static bool scan_nttrans(struct cli_state *cli, int op, int level,
int fnum, int dnum, const char *fname)
{
- int data_len = 0;
- int param_len = 0;
- unsigned int rparam_len, rdata_len;
- char param[PARAM_SIZE], data[DATA_SIZE];
+ uint32_t data_len = 0;
+ uint32_t param_len = 0;
+ uint32_t rparam_len, rdata_len;
+ uint8_t param[PARAM_SIZE], data[DATA_SIZE];
NTSTATUS status;
memset(data, 0, sizeof(data));