1 18 19 package com.knowgate.jcifs.smb; 20 21 import java.util.Date ; 22 import java.io.IOException ; 23 import java.io.InputStream ; 24 25 import com.knowgate.misc.Gadgets; 26 27 class SmbComNTCreateAndXResponse extends AndXServerMessageBlock { 28 29 static final int EXCLUSIVE_OPLOCK_GRANTED = 1; 30 static final int BATCH_OPLOCK_GRANTED = 2; 31 static final int LEVEL_II_OPLOCK_GRANTED = 3; 32 33 byte oplockLevel; 34 int fid, 35 createAction, 36 extFileAttributes, 37 fileType, 38 deviceState; 39 long creationTime, 40 lastAccessTime, 41 lastWriteTime, 42 changeTime, 43 allocationSize, 44 endOfFile; 45 boolean directory; 46 47 SmbComNTCreateAndXResponse() { 48 } 49 50 int writeParameterWordsWireFormat( byte[] dst, int dstIndex ) { 51 return 0; 52 } 53 int writeBytesWireFormat( byte[] dst, int dstIndex ) { 54 return 0; 55 } 56 int readParameterWordsWireFormat( byte[] buffer, int bufferIndex ) { 57 int start = bufferIndex; 58 59 oplockLevel = buffer[bufferIndex++]; 60 fid = readInt2( buffer, bufferIndex ); 61 bufferIndex += 2; 62 createAction = readInt4( buffer, bufferIndex ); 63 bufferIndex += 4; 64 creationTime = readTime( buffer, bufferIndex ); 65 bufferIndex += 8; 66 lastAccessTime = readTime( buffer, bufferIndex ); 67 bufferIndex += 8; 68 lastWriteTime = readTime( buffer, bufferIndex ); 69 bufferIndex += 8; 70 changeTime = readTime( buffer, bufferIndex ); 71 bufferIndex += 8; 72 extFileAttributes = readInt4( buffer, bufferIndex ); 73 bufferIndex += 4; 74 allocationSize = readInt8( buffer, bufferIndex ); 75 bufferIndex += 8; 76 endOfFile = readInt8( buffer, bufferIndex ); 77 bufferIndex += 8; 78 fileType = readInt2( buffer, bufferIndex ); 79 bufferIndex += 2; 80 deviceState = readInt2( buffer, bufferIndex ); 81 bufferIndex += 2; 82 directory = ( buffer[bufferIndex++] & 0xFF ) > 0; 83 84 return bufferIndex - start; 85 } 86 int readBytesWireFormat( byte[] buffer, int bufferIndex ) { 87 return 0; 88 } 89 int readBytesDirectWireFormat( InputStream in, int byteCount, 90 byte[] buffer, int bufferIndex ) throws IOException { 91 return 0; 92 } 93 public String toString() { 94 return new String ( "SmbComNTCreateAndXResponse[" + 95 super.toString() + 96 ",oplockLevel=" + oplockLevel + 97 ",fid=" + fid + 98 ",createAction=0x" + Gadgets.toHexString( createAction, 4 ) + 99 ",creationTime=" + new Date ( creationTime ) + 100 ",lastAccessTime=" + new Date ( lastAccessTime ) + 101 ",lastWriteTime=" + new Date ( lastWriteTime ) + 102 ",changeTime=" + new Date ( changeTime ) + 103 ",extFileAttributes=0x" + Gadgets.toHexString( extFileAttributes, 4 ) + 104 ",allocationSize=" + allocationSize + 105 ",endOfFile=" + endOfFile + 106 ",fileType=" + fileType + 107 ",deviceState=" + deviceState + 108 ",directory=" + directory + "]" ); 109 } 110 } 111 | Popular Tags |