first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[nivanova/samba-autobuild/.git] / source3 / rpcclient / cmd_brs.c
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    NT Domain Authentication SMB / MSRPC client
5    Copyright (C) Andrew Tridgell 1994-1999
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1999
7    
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.
12    
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.
17    
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.
21 */
22
23
24
25 #ifdef SYSLOG
26 #undef SYSLOG
27 #endif
28
29 #include "includes.h"
30 #include "nterr.h"
31
32 extern int DEBUGLEVEL;
33
34 #define DEBUG_TESTING
35
36 extern FILE* out_hnd;
37
38
39 /****************************************************************************
40 Browser get info query
41 ****************************************************************************/
42 void cmd_brs_query_info(struct client_info *info, int argc, char *argv[])
43 {
44         fstring dest_brs;
45         BRS_INFO_100 ctr;
46         uint32 info_level = 100;
47
48         BOOL res = True;
49
50         bzero(&ctr, sizeof(ctr));
51
52         fstrcpy(dest_brs, "\\\\");
53         fstrcat(dest_brs, info->dest_host);
54         strupper(dest_brs);
55
56         if (argc > 1)
57         {
58                 info_level = (uint32)strtol(argv[1], (char**)NULL, 10);
59         }
60
61         DEBUG(4,("cmd_brs_query_info: server:%s info level: %d\n",
62                                 dest_brs, info_level));
63
64         /* send info level: receive requested info.  hopefully. */
65         res = res ? brs_query_info( dest_brs, info_level, &ctr) : False;
66
67         if (res)
68         {
69                 DEBUG(5,("cmd_brs_query_info: query succeeded\n"));
70
71 #if 0
72                 display_brs_info_100(out_hnd, ACTION_HEADER   , &ctr);
73                 display_brs_info_100(out_hnd, ACTION_ENUMERATE, &ctr);
74                 display_brs_info_100(out_hnd, ACTION_FOOTER   , &ctr);
75 #endif
76
77         }
78         else
79         {
80                 DEBUG(5,("cmd_brs_query_info: query failed\n"));
81         }
82 }
83