r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[tprouty/samba.git] / source3 / rpcclient / cmd_wkssvc.c
1 /* 
2    Unix SMB/CIFS implementation.
3    NT Domain Authentication SMB / MSRPC client
4    Copyright (C) Andrew Tridgell 1994-1997
5    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
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 THIS IS NO LONGER USED - NEEDS REMOVAL.
22
23 #include "includes.h"
24
25 #define DEBUG_TESTING
26
27 extern struct cli_state *smb_cli;
28
29 extern FILE* out_hnd;
30
31
32 /****************************************************************************
33 workstation get info query
34 ****************************************************************************/
35 void cmd_wks_query_info(struct client_info *info)
36 {
37         fstring dest_wks;
38         fstring tmp;
39         WKS_INFO_100 ctr;
40         uint32 info_level = 100;
41
42         BOOL res = True;
43
44         memset((char *)&ctr, '\0', sizeof(ctr));
45
46         fstrcpy(dest_wks, "\\\\");
47         fstrcat(dest_wks, info->dest_host);
48         strupper_m(dest_wks);
49
50         if (next_token_nr(NULL, tmp, NULL, sizeof(tmp)))
51         {
52                 info_level = (uint32)strtol(tmp, (char**)NULL, 10);
53         }
54
55         DEBUG(4,("cmd_wks_query_info: server:%s info level: %d\n",
56                                 dest_wks, info_level));
57
58         DEBUG(5, ("cmd_wks_query_info: smb_cli->fd:%d\n", smb_cli->fd));
59
60         /* open LSARPC session. */
61         res = res ? cli_nt_session_open(smb_cli, PI_WKSSVC) : False;
62
63         /* send info level: receive requested info.  hopefully. */
64         res = res ? do_wks_query_info(smb_cli, 
65                                 dest_wks, info_level, &ctr) : False;
66
67         /* close the session */
68         cli_nt_session_close(smb_cli);
69
70         if (res)
71         {
72                 DEBUG(5,("cmd_wks_query_info: query succeeded\n"));
73
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
79
80         }
81         else
82         {
83                 DEBUG(5,("cmd_wks_query_info: query failed\n"));
84         }
85 }