01: /* jcifs smb client library in Java
02: * Copyright (C) 2000 "Michael B. Allen" <jcifs at samba dot org>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package jcifs.smb;
20:
21: import java.io.UnsupportedEncodingException;
22:
23: class NetShareEnum extends SmbComTransaction {
24:
25: private static final String DESCR = "WrLeh\u0000B13BWz\u0000";
26:
27: NetShareEnum() {
28: command = SMB_COM_TRANSACTION;
29: subCommand = NET_SHARE_ENUM; // not really true be used by upper logic
30: name = new String("\\PIPE\\LANMAN");
31: maxParameterCount = 8;
32:
33: // maxDataCount = 4096; why was this set?
34: maxSetupCount = (byte) 0x00;
35: setupCount = 0;
36: timeout = 5000;
37: }
38:
39: int writeSetupWireFormat(byte[] dst, int dstIndex) {
40: return 0;
41: }
42:
43: int writeParametersWireFormat(byte[] dst, int dstIndex) {
44: int start = dstIndex;
45: byte[] descr;
46:
47: try {
48: descr = DESCR.getBytes("ASCII");
49: } catch (UnsupportedEncodingException uee) {
50: return 0;
51: }
52:
53: writeInt2(NET_SHARE_ENUM, dst, dstIndex);
54: dstIndex += 2;
55: System.arraycopy(descr, 0, dst, dstIndex, descr.length);
56: dstIndex += descr.length;
57: writeInt2(0x0001, dst, dstIndex);
58: dstIndex += 2;
59: writeInt2(maxDataCount, dst, dstIndex);
60: dstIndex += 2;
61:
62: return dstIndex - start;
63: }
64:
65: int writeDataWireFormat(byte[] dst, int dstIndex) {
66: return 0;
67: }
68:
69: int readSetupWireFormat(byte[] buffer, int bufferIndex, int len) {
70: return 0;
71: }
72:
73: int readParametersWireFormat(byte[] buffer, int bufferIndex, int len) {
74: return 0;
75: }
76:
77: int readDataWireFormat(byte[] buffer, int bufferIndex, int len) {
78: return 0;
79: }
80:
81: public String toString() {
82: return new String("NetShareEnum[" + super .toString() + "]");
83: }
84: }
|