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 com.knowgate.jcifs.smb;
20:
21: import com.knowgate.jcifs.Config;
22: import com.knowgate.misc.Gadgets;
23:
24: class Trans2FindNext2 extends SmbComTransaction {
25:
26: private int sid, informationLevel, resumeKey, flags;
27: private String filename;
28:
29: Trans2FindNext2(int sid, int resumeKey, String filename) {
30: this .sid = sid;
31: this .resumeKey = resumeKey;
32: this .filename = filename;
33: command = SMB_COM_TRANSACTION2;
34: subCommand = TRANS2_FIND_NEXT2;
35: informationLevel = Trans2FindFirst2.SMB_FILE_BOTH_DIRECTORY_INFO;
36: flags = 0x00;
37: maxParameterCount = 8;
38: maxDataCount = Trans2FindFirst2.LIST_SIZE;
39: maxSetupCount = 0;
40: }
41:
42: void reset(int resumeKey, String lastName) {
43: super .reset();
44: this .resumeKey = resumeKey;
45: this .filename = lastName;
46: flags2 = 0;
47: }
48:
49: int writeSetupWireFormat(byte[] dst, int dstIndex) {
50: dst[dstIndex++] = subCommand;
51: dst[dstIndex++] = (byte) 0x00;
52: return 2;
53: }
54:
55: int writeParametersWireFormat(byte[] dst, int dstIndex) {
56: int start = dstIndex;
57:
58: writeInt2(sid, dst, dstIndex);
59: dstIndex += 2;
60: writeInt2(Trans2FindFirst2.LIST_COUNT, dst, dstIndex);
61: dstIndex += 2;
62: writeInt2(informationLevel, dst, dstIndex);
63: dstIndex += 2;
64: writeInt4(resumeKey, dst, dstIndex);
65: dstIndex += 4;
66: writeInt2(flags, dst, dstIndex);
67: dstIndex += 2;
68: dstIndex += writeString(filename, dst, dstIndex);
69:
70: return dstIndex - start;
71: }
72:
73: int writeDataWireFormat(byte[] dst, int dstIndex) {
74: return 0;
75: }
76:
77: int readSetupWireFormat(byte[] buffer, int bufferIndex, int len) {
78: return 0;
79: }
80:
81: int readParametersWireFormat(byte[] buffer, int bufferIndex, int len) {
82: return 0;
83: }
84:
85: int readDataWireFormat(byte[] buffer, int bufferIndex, int len) {
86: return 0;
87: }
88:
89: public String toString() {
90: return new String("Trans2FindNext2[" + super .toString()
91: + ",sid=" + sid + ",searchCount="
92: + Trans2FindFirst2.LIST_SIZE + ",informationLevel=0x"
93: + Gadgets.toHexString(informationLevel, 3)
94: + ",resumeKey=0x" + Gadgets.toHexString(resumeKey, 4)
95: + ",flags=0x" + Gadgets.toHexString(flags, 2)
96: + ",filename=" + filename + "]");
97: }
98: }
|