KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jcifs > smb > SmbComNtTransactionResponse


1 /* jcifs smb client library in Java
2  * Copyright (C) 2005 "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 abstract class SmbComNtTransactionResponse extends SmbComTransactionResponse {
22
23     SmbComNtTransactionResponse() {
24         super();
25     }
26
27     int readParameterWordsWireFormat( byte[] buffer, int bufferIndex ) {
28         int start = bufferIndex;
29
30         buffer[bufferIndex++] = (byte)0x00; // Reserved
31
buffer[bufferIndex++] = (byte)0x00; // Reserved
32
buffer[bufferIndex++] = (byte)0x00; // Reserved
33

34         totalParameterCount = readInt4( buffer, bufferIndex );
35         if( bufDataStart == 0 ) {
36             bufDataStart = totalParameterCount;
37         }
38         bufferIndex += 4;
39         totalDataCount = readInt4( buffer, bufferIndex );
40         bufferIndex += 4;
41         parameterCount = readInt4( buffer, bufferIndex );
42         bufferIndex += 4;
43         parameterOffset = readInt4( buffer, bufferIndex );
44         bufferIndex += 4;
45         parameterDisplacement = readInt4( buffer, bufferIndex );
46         bufferIndex += 4;
47         dataCount = readInt4( buffer, bufferIndex );
48         bufferIndex += 4;
49         dataOffset = readInt4( buffer, bufferIndex );
50         bufferIndex += 4;
51         dataDisplacement = readInt4( buffer, bufferIndex );
52         bufferIndex += 4;
53         setupCount = buffer[bufferIndex] & 0xFF;
54         bufferIndex += 2;
55         if( setupCount != 0 ) {
56             if( log.level >= 3 )
57                 log.println( "setupCount is not zero: " + setupCount );
58         }
59
60         return bufferIndex - start;
61     }
62 }
63
Popular Tags