summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_echo.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/source3/rpcclient/cmd_echo.c b/source3/rpcclient/cmd_echo.c
index 4432f5b14b..0a69e5a11c 100644
--- a/source3/rpcclient/cmd_echo.c
+++ b/source3/rpcclient/cmd_echo.c
@@ -36,7 +36,7 @@ static NTSTATUS cmd_echo_add_one(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
if (argc == 2)
request = atoi(argv[1]);
- result = rpccli_echo_add_one(cli, mem_ctx, request, &response);
+ result = rpccli_echo_AddOne(cli, mem_ctx, request, &response);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -52,7 +52,7 @@ static NTSTATUS cmd_echo_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
{
uint32 size, i;
NTSTATUS result;
- char *in_data = NULL, *out_data = NULL;
+ uint8 *in_data = NULL, *out_data = NULL;
if (argc != 2) {
printf("Usage: %s num\n", argv[0]);
@@ -60,12 +60,13 @@ static NTSTATUS cmd_echo_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
}
size = atoi(argv[1]);
- in_data = (char *)SMB_MALLOC(size);
+ in_data = (uint8 *)SMB_MALLOC(size);
+ out_data = (uint8 *)SMB_MALLOC(size);
for (i = 0; i < size; i++)
in_data[i] = i & 0xff;
- result = rpccli_echo_data(cli, mem_ctx, size, in_data, &out_data);
+ result = rpccli_echo_EchoData(cli, mem_ctx, size, in_data, out_data);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -80,6 +81,7 @@ static NTSTATUS cmd_echo_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
done:
SAFE_FREE(in_data);
+ SAFE_FREE(out_data);
return result;
}
@@ -90,7 +92,7 @@ static NTSTATUS cmd_echo_source_data(struct rpc_pipe_client *cli,
{
uint32 size, i;
NTSTATUS result;
- char *out_data = NULL;
+ uint8 *out_data;
if (argc != 2) {
printf("Usage: %s num\n", argv[0]);
@@ -98,8 +100,9 @@ static NTSTATUS cmd_echo_source_data(struct rpc_pipe_client *cli,
}
size = atoi(argv[1]);
+ out_data = (uint8 *)SMB_MALLOC(size);
- result = rpccli_echo_source_data(cli, mem_ctx, size, &out_data);
+ result = rpccli_echo_SourceData(cli, mem_ctx, size, out_data);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -113,6 +116,8 @@ static NTSTATUS cmd_echo_source_data(struct rpc_pipe_client *cli,
}
done:
+ SAFE_FREE(out_data);
+
return result;
}
@@ -121,7 +126,7 @@ static NTSTATUS cmd_echo_sink_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
{
uint32 size, i;
NTSTATUS result;
- char *in_data = NULL;
+ uint8 *in_data = NULL;
if (argc != 2) {
printf("Usage: %s num\n", argv[0]);
@@ -129,12 +134,12 @@ static NTSTATUS cmd_echo_sink_data(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
}
size = atoi(argv[1]);
- in_data = (char *)SMB_MALLOC(size);
+ in_data = (uint8 *)SMB_MALLOC(size);
for (i = 0; i < size; i++)
in_data[i] = i & 0xff;
- result = rpccli_echo_sink_data(cli, mem_ctx, size, in_data);
+ result = rpccli_echo_SinkData(cli, mem_ctx, size, in_data);
if (!NT_STATUS_IS_OK(result))
goto done;
@@ -151,9 +156,9 @@ struct cmd_set echo_commands[] = {
{ "ECHO" },
- { "echoaddone", RPC_RTYPE_NTSTATUS, cmd_echo_add_one, NULL, PI_ECHO, NULL, "Add one to a number", "" },
- { "echodata", RPC_RTYPE_NTSTATUS, cmd_echo_data, NULL, PI_ECHO, NULL, "Echo data", "" },
- { "sinkdata", RPC_RTYPE_NTSTATUS, cmd_echo_sink_data, NULL, PI_ECHO, NULL, "Sink data", "" },
- { "sourcedata", RPC_RTYPE_NTSTATUS, cmd_echo_source_data, NULL, PI_ECHO, NULL, "Source data", "" },
+ { "echoaddone", RPC_RTYPE_NTSTATUS, cmd_echo_add_one, NULL, PI_RPCECHO, NULL, "Add one to a number", "" },
+ { "echodata", RPC_RTYPE_NTSTATUS, cmd_echo_data, NULL, PI_RPCECHO, NULL, "Echo data", "" },
+ { "sinkdata", RPC_RTYPE_NTSTATUS, cmd_echo_sink_data, NULL, PI_RPCECHO, NULL, "Sink data", "" },
+ { "sourcedata", RPC_RTYPE_NTSTATUS, cmd_echo_source_data, NULL, PI_RPCECHO, NULL, "Source data", "" },
{ NULL }
};