KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > filesys > smb > dcerpc > DCECommand


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.filesys.smb.dcerpc;
18
19 /**
20  * DCE/RPC Command Codes
21  */

22 public class DCECommand
23 {
24
25     // DCE/RPC Packet Types
26

27     public final static byte REQUEST = 0x00;
28     public final static byte RESPONSE = 0x02;
29     public final static byte FAULT = 0x03;
30     public final static byte BIND = 0x0B;
31     public final static byte BINDACK = 0x0C;
32     public final static byte ALTCONT = 0x0E;
33     public final static byte AUTH3 = 0x0F;
34     public final static byte BINDCONT = 0x10;
35
36     /**
37      * Convert the command type to a string
38      *
39      * @param cmd int
40      * @return String
41      */

42     public final static String JavaDoc getCommandString(int cmd)
43     {
44
45         // Determine the PDU command type
46

47         String JavaDoc ret = "";
48         switch (cmd)
49         {
50         case REQUEST:
51             ret = "Request";
52             break;
53         case RESPONSE:
54             ret = "Repsonse";
55             break;
56         case FAULT:
57             ret = "Fault";
58             break;
59         case BIND:
60             ret = "Bind";
61             break;
62         case BINDACK:
63             ret = "BindAck";
64             break;
65         case ALTCONT:
66             ret = "AltCont";
67             break;
68         case AUTH3:
69             ret = "Auth3";
70             break;
71         case BINDCONT:
72             ret = "BindCont";
73             break;
74         }
75         return ret;
76     }
77 }
Popular Tags