3516525ca958071cca71d26ac2a0016f08456a4f
[obnox/wireshark/wip.git] / packet-dcerpc-afs4int.c
1 /* packet-dcerpc-afs4int.c
2  *
3  * Routines for dcerpc Afs4Int dissection
4  * Copyright 2002, Jaime Fournier <jafour1@yahoo.com> 
5  * This information is based off the released idl files from opengroup.
6  * ftp://ftp.opengroup.org/pub/dce122/dce/src/file.tar.gz file/fsint/afs4int.idl
7  *
8  * $Id: packet-dcerpc-afs4int.c,v 1.2 2002/11/08 19:42:39 guy Exp $
9  *
10  * Ethereal - Network traffic analyzer
11  * By Gerald Combs <gerald@ethereal.com>
12  * Copyright 1998 Gerald Combs
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27  */
28
29 #ifdef HAVE_CONFIG_H
30 #include "config.h"
31 #endif
32
33
34 #ifdef HAVE_SYS_TYPES_H
35 #include <sys/types.h>
36 #endif
37
38 #include <string.h>
39
40 #include <glib.h>
41 #include <epan/packet.h>
42 #include "packet-dcerpc.h"
43
44
45 static int proto_afs4int = -1;
46 static int hf_afs4int_opnum = -1;
47
48
49 static gint ett_afs4int = -1;
50
51
52 static e_uuid_t uuid_afs4int = { 0x4d37f2dd, 0xed93, 0x0000, { 0x02, 0xc0, 0x37, 0xcf, 0x1e, 0x00, 0x00, 0x00 } };
53 static guint16  ver_afs4int = 4;
54
55
56
57 static dcerpc_sub_dissector afs4int_dissectors[] = {
58         {  0, "SetContext", NULL, NULL },
59         {  1, "LookupRoot", NULL, NULL },
60         {  2, "FetchData", NULL, NULL },
61         {  3, "FetchACL", NULL, NULL },
62         {  4, "FetchStatus", NULL, NULL },
63         {  5, "StoreData", NULL, NULL },
64         {  6, "StoreACL", NULL, NULL },
65         {  7, "StoreStatus", NULL, NULL },
66         {  8, "RemoveFile", NULL, NULL },
67         {  9, "CreateFile", NULL, NULL },
68         { 10, "Rename", NULL, NULL },
69         { 11, "Symlink", NULL, NULL },
70         { 12, "HardLink", NULL, NULL },
71         { 13, "MakeDir", NULL, NULL },
72         { 14, "RemoveDir", NULL, NULL },
73         { 15, "Readdir", NULL, NULL },
74         { 16, "Lookup", NULL, NULL },
75         { 17, "GetToken", NULL, NULL },
76         { 18, "ReleaseTokens", NULL, NULL },
77         { 19, "GetTime", NULL, NULL },
78         { 20, "MakeMountPoint", NULL, NULL },
79         { 21, "GetStatistics", NULL, NULL },
80         { 22, "BulkFetchVV", NULL, NULL },
81         { 23, "BulkKeepAlive", NULL, NULL },
82         { 24, "ProcessQuota", NULL, NULL },
83         { 25, "GetServerInterfaces", NULL, NULL },
84         { 26, "SetParams", NULL, NULL },
85         { 27, "BulkFetchStatus", NULL, NULL },
86         {  0, NULL, NULL, NULL }
87 };
88
89
90 static const value_string afs4int_opnum_vals[] = {
91         {  0, "SetContext" },
92         {  1, "LookupRoot" },
93         {  2, "FetchData" },
94         {  3, "FetchACL" },
95         {  4, "FetchStatus" },
96         {  5, "StoreData" },
97         {  6, "StoreACL" },
98         {  7, "StoreStatus" },
99         {  8, "RemoveFile" },
100         {  9, "CreateFile" },
101         { 10, "Rename" },
102         { 11, "Symlink" },
103         { 12, "HardLink" },
104         { 13, "MakeDir" },
105         { 14, "RemoveDir" },
106         { 15, "Readdir" },
107         { 16, "Lookup" },
108         { 17, "GetToken" },
109         { 18, "ReleaseTokens" },
110         { 19, "GetTime" },
111         { 20, "MakeMountPoint" },
112         { 21, "GetStatistics" },
113         { 22, "BulkFetchVV" },
114         { 23, "BulkKeepAlive" },
115         { 24, "ProcessQuota" },
116         { 25, "GetServerInterfaces" },
117         { 26, "SetParams" },
118         { 27, "BulkFetchStatus" },
119         {  0, NULL }
120 };
121
122
123
124 void
125 proto_register_afs4int (void)
126 {
127         static hf_register_info hf[] = {
128           { &hf_afs4int_opnum,
129             { "Operation", "afs4int.opnum", FT_UINT16, BASE_DEC,
130               VALS(afs4int_opnum_vals), 0x0, "Operation", HFILL }}
131         };  
132
133
134         static gint *ett[] = {
135                 &ett_afs4int,
136         };
137         proto_afs4int = proto_register_protocol ("DCE DFS Calls", "DCE_DFS", "dce_dfs");
138         proto_register_field_array (proto_afs4int, hf, array_length (hf));
139         proto_register_subtree_array (ett, array_length (ett));
140
141 }
142 void
143 proto_reg_handoff_afs4int (void)
144 {
145         /* Register the protocol as dcerpc */
146         dcerpc_init_uuid (proto_afs4int, ett_afs4int, &uuid_afs4int, ver_afs4int, afs4int_dissectors, hf_afs4int_opnum);
147 }
148