diff options
author | Simo Sorce <idra@samba.org> | 2008-02-01 14:24:31 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-02-01 14:24:31 -0500 |
commit | 2fffc9a1b1fe2a1490e867bb38462e50c282d2b3 (patch) | |
tree | 428e09c9b35138db8b7ca7161c659a71aa129d29 /source3/rpcclient/cmd_wkssvc.c | |
parent | 93a3c5b3f9927973b4ad1496f593ea147052d1e1 (diff) | |
parent | b708005a7106db26d7df689b887b419c9f2ea41c (diff) | |
download | samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.tar.gz samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.tar.bz2 samba-2fffc9a1b1fe2a1490e867bb38462e50c282d2b3.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit 7dbfc7bdc65314466a83e8121b35c9bcb24b2631)
Diffstat (limited to 'source3/rpcclient/cmd_wkssvc.c')
-rw-r--r-- | source3/rpcclient/cmd_wkssvc.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c index d136cd0d45..68f408cf48 100644 --- a/source3/rpcclient/cmd_wkssvc.c +++ b/source3/rpcclient/cmd_wkssvc.c @@ -124,11 +124,48 @@ static WERROR cmd_wkssvc_messagebuffersend(struct rpc_pipe_client *cli, return werr; } +static WERROR cmd_wkssvc_enumeratecomputernames(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) +{ + const char *server_name; + enum wkssvc_ComputerNameType name_type = NetAllComputerNames; + NTSTATUS status; + struct wkssvc_ComputerNamesCtr *ctr = NULL; + WERROR werr; + + server_name = cli->cli->desthost; + + if (argc >= 2) { + name_type = atoi(argv[1]); + } + + status = rpccli_wkssvc_NetrEnumerateComputerNames(cli, mem_ctx, + server_name, + name_type, 0, + &ctr, + &werr); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + + if (W_ERROR_IS_OK(werr)) { + int i=0; + for (i = 0; i < ctr->count; i++) { + printf("name: %d %s\n", i, ctr->computer_name->string); + } + } + + return werr; +} + struct cmd_set wkssvc_commands[] = { { "WKSSVC" }, { "wkssvc_wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" }, { "wkssvc_getjoininformation", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_getjoininformation, PI_WKSSVC, NULL, "Query WKSSVC Join Information", "" }, { "wkssvc_messagebuffersend", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_messagebuffersend, PI_WKSSVC, NULL, "Send WKSSVC message", "" }, + { "wkssvc_enumeratecomputernames", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_enumeratecomputernames, PI_WKSSVC, NULL, "Enumerate WKSSVC computer names", "" }, { NULL } }; |