diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-09-15 22:49:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:51:51 -0500 |
commit | e5db7fee0f5cb3bd7434cdefebabc7a8376aa0d4 (patch) | |
tree | db7c10f2390939cd426d943af4693fd888f41c99 /source3/rpcclient | |
parent | 47debfd03a57815d9c4d67406cfa522ece1a7bc5 (diff) | |
download | samba-e5db7fee0f5cb3bd7434cdefebabc7a8376aa0d4.tar.gz samba-e5db7fee0f5cb3bd7434cdefebabc7a8376aa0d4.tar.bz2 samba-e5db7fee0f5cb3bd7434cdefebabc7a8376aa0d4.zip |
r18572: Use the autogenerated client and server for the echo interface and implement
some of the missing functions. RPC-ECHO now passes against Samba3.
(This used to be commit 9e9a05366176454cc1779acc6c2b6070743f5939)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_echo.c | 31 |
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 } }; |