make proto
[Samba.git] / source / rpcclient / cmd_wkssvc.c
blob52c110dbd5627371542ca87e30c5a88d95d5193a
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 NT Domain Authentication SMB / MSRPC client
5 Copyright (C) Andrew Tridgell 1994-1997
6 Copyright (C) Luke Kenneth Casson Leighton 1996-1997
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "includes.h"
25 #define DEBUG_TESTING
27 extern struct cli_state *smb_cli;
29 extern FILE* out_hnd;
32 /****************************************************************************
33 workstation get info query
34 ****************************************************************************/
35 void cmd_wks_query_info(struct client_info *info)
37 fstring dest_wks;
38 fstring tmp;
39 WKS_INFO_100 ctr;
40 uint32 info_level = 100;
42 BOOL res = True;
44 memset((char *)&ctr, '\0', sizeof(ctr));
46 fstrcpy(dest_wks, "\\\\");
47 fstrcat(dest_wks, info->dest_host);
48 strupper(dest_wks);
50 if (next_token_nr(NULL, tmp, NULL, sizeof(tmp)))
52 info_level = (uint32)strtol(tmp, (char**)NULL, 10);
55 DEBUG(4,("cmd_wks_query_info: server:%s info level: %d\n",
56 dest_wks, info_level));
58 DEBUG(5, ("cmd_wks_query_info: smb_cli->fd:%d\n", smb_cli->fd));
60 /* open LSARPC session. */
61 res = res ? cli_nt_session_open(smb_cli, PIPE_WKSSVC) : False;
63 /* send info level: receive requested info. hopefully. */
64 res = res ? do_wks_query_info(smb_cli,
65 dest_wks, info_level, &ctr) : False;
67 /* close the session */
68 cli_nt_session_close(smb_cli);
70 if (res)
72 DEBUG(5,("cmd_wks_query_info: query succeeded\n"));
74 #if 0
75 display_wks_info_100(out_hnd, ACTION_HEADER , &ctr);
76 display_wks_info_100(out_hnd, ACTION_ENUMERATE, &ctr);
77 display_wks_info_100(out_hnd, ACTION_FOOTER , &ctr);
78 #endif
81 else
83 DEBUG(5,("cmd_wks_query_info: query failed\n"));