f3ff8113e930c587517023e22819e660bf70947f
[samba.git] / source3 / rpcclient / cmd_wkssvc.c
1 /*
2    Unix SMB/CIFS implementation.
3    RPC pipe client
4
5    Copyright (C) Günther Deschner 2007
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "includes.h"
22 #include "rpcclient.h"
23
24 static WERROR cmd_wkssvc_wkstagetinfo(struct rpc_pipe_client *cli,
25                                       TALLOC_CTX *mem_ctx,
26                                       int argc,
27                                       const char **argv)
28 {
29         NTSTATUS status;
30         WERROR werr;
31         uint32_t level = 100;
32         union wkssvc_NetWkstaInfo info;
33         const char *server_name;
34
35         server_name = cli->cli->desthost;
36
37         status = rpccli_wkssvc_NetWkstaGetInfo(cli, mem_ctx,
38                                                server_name,
39                                                level,
40                                                &info,
41                                                &werr);
42         if (!NT_STATUS_IS_OK(status)) {
43                 return ntstatus_to_werror(status);
44         }
45
46         return werr;
47 }
48
49 struct cmd_set wkssvc_commands[] = {
50
51         { "WKSSVC" },
52         { "wkstagetinfo", RPC_RTYPE_WERROR, NULL, cmd_wkssvc_wkstagetinfo, PI_WKSSVC, NULL, "Query WKSSVC Workstation Information", "" },
53         { NULL }
54 };