~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to source/rpcclient/cmd_wkssvc.c

  • Committer: jerry
  • Date: 2006-07-14 21:48:39 UTC
  • Revision ID: vcs-imports@canonical.com-20060714214839-586d8c489a8fcead
gutting trunk to move to svn:externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 2 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, write to the Free Software
19
 
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 
*/
21
 
 
22
 
THIS IS NO LONGER USED - NEEDS REMOVAL.
23
 
 
24
 
#include "includes.h"
25
 
 
26
 
#define DEBUG_TESTING
27
 
 
28
 
extern struct cli_state *smb_cli;
29
 
 
30
 
extern FILE* out_hnd;
31
 
 
32
 
 
33
 
/****************************************************************************
34
 
workstation get info query
35
 
****************************************************************************/
36
 
void cmd_wks_query_info(struct client_info *info)
37
 
{
38
 
        fstring dest_wks;
39
 
        fstring tmp;
40
 
        WKS_INFO_100 ctr;
41
 
        uint32 info_level = 100;
42
 
 
43
 
        BOOL res = True;
44
 
 
45
 
        memset((char *)&ctr, '\0', sizeof(ctr));
46
 
 
47
 
        fstrcpy(dest_wks, "\\\\");
48
 
        fstrcat(dest_wks, info->dest_host);
49
 
        strupper_m(dest_wks);
50
 
 
51
 
        if (next_token_nr(NULL, tmp, NULL, sizeof(tmp)))
52
 
        {
53
 
                info_level = (uint32)strtol(tmp, (char**)NULL, 10);
54
 
        }
55
 
 
56
 
        DEBUG(4,("cmd_wks_query_info: server:%s info level: %d\n",
57
 
                                dest_wks, info_level));
58
 
 
59
 
        DEBUG(5, ("cmd_wks_query_info: smb_cli->fd:%d\n", smb_cli->fd));
60
 
 
61
 
        /* open LSARPC session. */
62
 
        res = res ? cli_nt_session_open(smb_cli, PI_WKSSVC) : False;
63
 
 
64
 
        /* send info level: receive requested info.  hopefully. */
65
 
        res = res ? do_wks_query_info(smb_cli, 
66
 
                                dest_wks, info_level, &ctr) : False;
67
 
 
68
 
        /* close the session */
69
 
        cli_nt_session_close(smb_cli);
70
 
 
71
 
        if (res)
72
 
        {
73
 
                DEBUG(5,("cmd_wks_query_info: query succeeded\n"));
74
 
 
75
 
#if 0
76
 
                display_wks_info_100(out_hnd, ACTION_HEADER   , &ctr);
77
 
                display_wks_info_100(out_hnd, ACTION_ENUMERATE, &ctr);
78
 
                display_wks_info_100(out_hnd, ACTION_FOOTER   , &ctr);
79
 
#endif
80
 
 
81
 
        }
82
 
        else
83
 
        {
84
 
                DEBUG(5,("cmd_wks_query_info: query failed\n"));
85
 
        }
86
 
}