From Ronald Henderson: make "format_text()", on Windows, escape all
[obnox/wireshark/wip.git] / packet-dcerpc-cds_clerkserver.c
1 /* packet-dcerpc-cds_clerkserver.c
2  *
3  * Routines for cds_clerkserver  dissection
4  * Routines for dcerpc Afs4Int dissection
5  * Copyright 2002, Jaime Fournier <jafour1@yahoo.com>
6  * This information is based off the released idl files from opengroup.
7  * ftp://ftp.opengroup.org/pub/dce122/dce/src/directory.tar.gz directory/cds/stubs/cds_clerkserver.idl
8  *      
9  * $Id: packet-dcerpc-cds_clerkserver.c,v 1.2 2002/11/08 19:42:39 guy Exp $
10  *
11  * Ethereal - Network traffic analyzer
12  * By Gerald Combs <gerald@ethereal.com>
13  * Copyright 1998 Gerald Combs
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33
34
35 #ifdef HAVE_SYS_TYPES_H
36 #include <sys/types.h>
37 #endif
38
39 #include <string.h>
40
41 #include <glib.h>
42 #include <epan/packet.h>
43 #include "packet-dcerpc.h"
44
45
46 static int proto_cds_clerkserver = -1;
47 static int hf_cds_clerkserver_opnum = -1;
48
49
50 static gint ett_cds_clerkserver = -1;
51
52
53 static e_uuid_t uuid_cds_clerkserver = { 0x257df1c9, 0xc6d3, 0x11ca, { 0x85, 0x54, 0x08, 0x00, 0x2b, 0x1c, 0x8f, 0x1f } };
54 static guint16  ver_cds_clerkserver = 1;
55
56
57
58 static dcerpc_sub_dissector cds_clerkserver_dissectors[] = {
59     {  0, "AddReplica", NULL, NULL},
60     {  1, "AllowClearinghouses", NULL, NULL},
61     {  2, "Combine", NULL, NULL},
62     {  3, "CreateChild", NULL, NULL},
63     {  4, "CreateDirectory", NULL, NULL},
64     {  5, "CreateSoftLink", NULL, NULL},
65     {  6, "CreateObject", NULL, NULL},
66     {  7, "DeleteChild", NULL, NULL},
67     {  8, "DeleteObject", NULL, NULL},
68     {  9, "DeleteSoftLink", NULL, NULL},
69     { 10, "DeleteDirectory", NULL, NULL},
70     { 11, "DisallowClearinghouses", NULL, NULL},
71     { 12, "DoUpdate", NULL, NULL},
72     { 13, "EnumerateAttributes", NULL, NULL},
73     { 14, "EnumerateChildren", NULL, NULL},
74     { 15, "EnumerateObjects", NULL, NULL},
75     { 16, "EnumerateSoftLinks", NULL, NULL},
76     { 17, "LinkReplica", NULL, NULL},
77     { 18, "ModifyAttribute", NULL, NULL},
78     { 19, "ModifyReplica", NULL, NULL},
79     { 20, "NewEpoch", NULL, NULL},
80     { 21, "ReadAttribute", NULL, NULL},
81     { 22, "RemoveReplica", NULL, NULL},
82     { 23, "ResolveName", NULL, NULL},
83     { 24, "Skulk", NULL, NULL},
84     { 25, "TestAttribute", NULL, NULL},
85     { 26, "TestGroup", NULL, NULL},
86     { 0, NULL, NULL, NULL }
87 };
88
89
90 static const value_string cds_clerkserver_opnum_vals[] = {
91     {  0, "AddReplica" },
92     {  1, "AllowClearinghouses" },
93     {  2, "Combine" },
94     {  3, "CreateChild" },
95     {  4, "CreateDirectory" },
96     {  5, "CreateSoftLink" },
97     {  6, "CreateObject" },
98     {  7, "DeleteChild" },
99     {  8, "DeleteObject" },
100     {  9, "DeleteSoftLink" },
101     { 10, "DeleteDirectory" },
102     { 11, "DisallowClearinghouses" },
103     { 12, "DoUpdate" },
104     { 13, "EnumerateAttributes" },
105     { 14, "EnumerateChildren" },
106     { 15, "EnumerateObjects" },
107     { 16, "EnumerateSoftLinks" },
108     { 17, "LinkReplica" },
109     { 18, "ModifyAttribute" },
110     { 19, "ModifyReplica" },
111     { 20, "NewEpoch" },
112     { 21, "ReadAttribute" },
113     { 22, "RemoveReplica" },
114     { 23, "ResolveName" },
115     { 24, "Skulk" },
116     { 25, "TestAttribute" },
117     { 26, "TestGroup" },
118     { 0, NULL }
119 };
120
121 void
122 proto_register_cds_clerkserver (void)
123 {
124         static hf_register_info hf[] = {
125           { &hf_cds_clerkserver_opnum,
126             { "Operation", "cds_clerkserver.opnum", FT_UINT16, BASE_DEC,
127               VALS(cds_clerkserver_opnum_vals), 0x0, "Operation", HFILL }}
128         };
129
130         static gint *ett[] = {
131                 &ett_cds_clerkserver,
132         };
133         proto_cds_clerkserver = proto_register_protocol ("CDS Clerk Server Calls", "CDS_CLERK", "cds_clerkserver");
134         proto_register_field_array (proto_cds_clerkserver, hf, array_length (hf));
135         proto_register_subtree_array (ett, array_length (ett));
136 }
137
138 void
139 proto_reg_handoff_cds_clerkserver (void)
140 {
141         /* Register the protocol as dcerpc */
142         dcerpc_init_uuid (proto_cds_clerkserver, ett_cds_clerkserver, &uuid_cds_clerkserver, ver_cds_clerkserver, cds_clerkserver_dissectors, hf_cds_clerkserver_opnum);
143 }