1 /* jcifs smb client library in Java 2 * Copyright (C) 2000 "Michael B. Allen" <jcifs at samba dot org> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * 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 jcifs.Config; 22 import jcifs.util.Hexdump; 23 24 class Trans2FindNext2 extends SmbComTransaction { 25 26 private int sid, informationLevel, resumeKey, flags; 27 private String filename; 28 Trans2FindNext2( int sid, int resumeKey, String filename )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 reset( int resumeKey, String lastName )42 void reset( int resumeKey, String lastName ) { 43 super.reset(); 44 this.resumeKey = resumeKey; 45 this.filename = lastName; 46 flags2 = 0; 47 } 48 writeSetupWireFormat( byte[] dst, int dstIndex )49 int writeSetupWireFormat( byte[] dst, int dstIndex ) { 50 dst[dstIndex++] = subCommand; 51 dst[dstIndex++] = (byte)0x00; 52 return 2; 53 } writeParametersWireFormat( byte[] dst, int dstIndex )54 int writeParametersWireFormat( byte[] dst, int dstIndex ) { 55 int start = dstIndex; 56 57 writeInt2( sid, dst, dstIndex ); 58 dstIndex += 2; 59 writeInt2( Trans2FindFirst2.LIST_COUNT, dst, dstIndex ); 60 dstIndex += 2; 61 writeInt2( informationLevel, dst, dstIndex ); 62 dstIndex += 2; 63 writeInt4( resumeKey, dst, dstIndex ); 64 dstIndex += 4; 65 writeInt2( flags, dst, dstIndex ); 66 dstIndex += 2; 67 dstIndex += writeString( filename, dst, dstIndex ); 68 69 return dstIndex - start; 70 } writeDataWireFormat( byte[] dst, int dstIndex )71 int writeDataWireFormat( byte[] dst, int dstIndex ) { 72 return 0; 73 } readSetupWireFormat( byte[] buffer, int bufferIndex, int len )74 int readSetupWireFormat( byte[] buffer, int bufferIndex, int len ) { 75 return 0; 76 } readParametersWireFormat( byte[] buffer, int bufferIndex, int len )77 int readParametersWireFormat( byte[] buffer, int bufferIndex, int len ) { 78 return 0; 79 } readDataWireFormat( byte[] buffer, int bufferIndex, int len )80 int readDataWireFormat( byte[] buffer, int bufferIndex, int len ) { 81 return 0; 82 } toString()83 public String toString() { 84 return new String( "Trans2FindNext2[" + super.toString() + 85 ",sid=" + sid + 86 ",searchCount=" + Trans2FindFirst2.LIST_SIZE + 87 ",informationLevel=0x" + Hexdump.toHexString( informationLevel, 3 ) + 88 ",resumeKey=0x" + Hexdump.toHexString( resumeKey, 4 ) + 89 ",flags=0x" + Hexdump.toHexString( flags, 2 ) + 90 ",filename=" + filename + "]" ); 91 } 92 } 93