KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jcifs > smb > Trans2GetDfsReferral


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 class Trans2GetDfsReferral extends SmbComTransaction {
22
23     private int maxReferralLevel = 3;
24
25     Trans2GetDfsReferral( String JavaDoc filename ) {
26         path = filename;
27         command = SMB_COM_TRANSACTION2;
28         subCommand = TRANS2_GET_DFS_REFERRAL;
29         totalDataCount = 0;
30         maxParameterCount = 0;
31         maxDataCount = 4096;
32         maxSetupCount = (byte)0x00;
33     }
34
35     int writeSetupWireFormat( byte[] dst, int dstIndex ) {
36         dst[dstIndex++] = subCommand;
37         dst[dstIndex++] = (byte)0x00;
38         return 2;
39     }
40     int writeParametersWireFormat( byte[] dst, int dstIndex ) {
41         int start = dstIndex;
42
43         writeInt2( maxReferralLevel, dst, dstIndex );
44         dstIndex += 2;
45         dstIndex += writeString( path, dst, dstIndex );
46
47         return dstIndex - start;
48     }
49     int writeDataWireFormat( byte[] dst, int dstIndex ) {
50         return 0;
51     }
52     int readSetupWireFormat( byte[] buffer, int bufferIndex, int len ) {
53         return 0;
54     }
55     int readParametersWireFormat( byte[] buffer, int bufferIndex, int len ) {
56         return 0;
57     }
58     int readDataWireFormat( byte[] buffer, int bufferIndex, int len ) {
59         return 0;
60     }
61     public String JavaDoc toString() {
62         return new String JavaDoc( "Trans2GetDfsReferral[" + super.toString() +
63             ",maxReferralLevel=0x" + maxReferralLevel +
64             ",filename=" + path + "]" );
65     }
66 }
67
Popular Tags