change a whole bunch of ethereal into wireshark
[obnox/wireshark/wip.git] / epan / dissectors / packet-dcom-sysact.c
1 /* packet-dcerpc-sysact.c
2  * Routines for the ISystemActivator interface
3  * Copyright 2004, Jelmer Vernooij <jelmer@samba.org>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29
30 #include <string.h>
31
32 #include <glib.h>
33 #include <epan/packet.h>
34 #include "packet-dcerpc.h"
35 #include "packet-dcom.h"
36
37
38 static int proto_ISystemActivator = -1;
39
40 static int hf_opnum = -1;
41
42 static gint ett_ISystemActivator = -1;
43
44 static e_uuid_t uuid_ISystemActivator = { 0x000001a0, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };
45 static guint16  ver_ISystemActivator = 0;
46
47
48 static int
49 dissect_remsysact_remotecreateinstance_rqst(tvbuff_t *tvb, int offset,
50         packet_info *pinfo, proto_tree *tree, guint8 *drep)
51 {
52
53     offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
54
55     offset = dissect_dcom_tobedone_data(tvb, offset, pinfo, tree, drep, 
56         tvb_ensure_length_remaining(tvb, offset));
57
58         return offset;
59 }
60
61
62 static int
63 dissect_remsysact_remotecreateinstance_resp(tvbuff_t *tvb, int offset,
64         packet_info *pinfo, proto_tree *tree, guint8 *drep)
65 {
66
67     offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
68
69     offset = dissect_dcom_tobedone_data(tvb, offset, pinfo, tree, drep, 
70         tvb_ensure_length_remaining(tvb, offset));
71
72         return offset;
73 }
74
75
76
77
78 static dcerpc_sub_dissector ISystemActivator_dissectors[] = {
79     { 0, "QueryInterfaceIRemoteSCMActivator", NULL, NULL },
80     { 1, "AddRefIRemoteISCMActivator", NULL, NULL },
81     { 2, "ReleaseIRemoteISCMActivator", NULL, NULL },
82     { 3, "RemoteGetClassObject", NULL, NULL },
83     { 4, "RemoteCreateInstance", dissect_remsysact_remotecreateinstance_rqst, dissect_remsysact_remotecreateinstance_resp },
84     { 0, NULL, NULL, NULL },
85 };
86
87 void
88 proto_register_ISystemActivator (void)
89 {
90         static hf_register_info hf[] = {
91                 { &hf_opnum,
92                   { "Operation", "isystemactivator.opnum", FT_UINT16, BASE_DEC,
93                     NULL, 0x0, "", HFILL }},
94         };
95         static gint *ett[] = {
96                 &ett_ISystemActivator
97         };
98         proto_ISystemActivator = proto_register_protocol ("ISystemActivator ISystemActivator Resolver", "ISystemActivator", "isystemactivator");
99         proto_register_field_array (proto_ISystemActivator, hf, array_length (hf));
100         proto_register_subtree_array (ett, array_length (ett));
101 }
102
103 void
104 proto_reg_handoff_ISystemActivator (void)
105 {
106         /* Register the protocol as dcerpc */
107         dcerpc_init_uuid (proto_ISystemActivator, ett_ISystemActivator, &uuid_ISystemActivator, ver_ISystemActivator, ISystemActivator_dissectors, hf_opnum);
108 }